372f8fd633
'make test-c' passes TEST_BINS as 'tests/test_json.exe' etc.; Python's subprocess on Windows hands that to CreateProcess, which rejects forward-slash relative paths for the executable (WinError 2), so the runner this script exists for (running tests from any Windows shell) failed on every test. os.path.normpath makes it 'tests\test_json.exe' on Windows and is a no-op elsewhere. Verified: all 8 suites run via 'make test-c' on Windows 11 / MinGW GCC 16.1 and paths are unchanged on POSIX. Co-authored-by: olorin <io@zyphyr.co> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
21 lines
537 B
Python
21 lines
537 B
Python
#!/usr/bin/env python3
|
|
"""Run C test binaries, exiting non-zero on the first failure.
|
|
|
|
Used by `make test-c` so the test runner works from any shell (cmd.exe,
|
|
PowerShell, Git Bash, MSYS2) without a POSIX `for` loop. Each test binary
|
|
is a positional argument.
|
|
"""
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
failed = []
|
|
for binary in sys.argv[1:]:
|
|
rc = subprocess.call([os.path.normpath(binary)])
|
|
if rc != 0:
|
|
failed.append(binary)
|
|
if failed:
|
|
for f in failed:
|
|
print(f"FAILED: {f}", file=sys.stderr)
|
|
sys.exit(1)
|