From 372f8fd633081acb1407412e7aab21c9b32441b2 Mon Sep 17 00:00:00 2001 From: Tom Olorin <1800017+juicyroots@users.noreply.github.com> Date: Tue, 14 Jul 2026 09:01:12 -0700 Subject: [PATCH] =?UTF-8?q?run=5Ftests:=20normpath=20test=20binaries=20?= =?UTF-8?q?=E2=80=94=20forward-slash=20relative=20paths=20fail=20CreatePro?= =?UTF-8?q?cess=20on=20Windows=20(#196)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '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 Co-authored-by: Claude Fable 5 --- c/tools/run_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c/tools/run_tests.py b/c/tools/run_tests.py index e2c17ac..1aee5a4 100644 --- a/c/tools/run_tests.py +++ b/c/tools/run_tests.py @@ -5,12 +5,13 @@ 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([binary]) + rc = subprocess.call([os.path.normpath(binary)]) if rc != 0: failed.append(binary) if failed: