A YAML comment line such as '# python3 tools/tests/test_x.py' counted as a run, because only a comment after a space was stripped. Skip lines whose first non-blank character is '#', also inside run blocks, and strip a trailing comment after any whitespace.
check_test_registration.py only audits built test executables, so a Python test that no add_test or workflow names is silently skipped. Add a --scripts mode that lists the tracked test_*.py scripts and fails for any not run by an add_test of a CMakeLists or a python step of a workflow, and register it as a ctest so the relinker builds run it.
Ninja Multi-Config writes one add_test per configuration and a final NOT_AVAILABLE one for the same name. The audit kept only the last, so every test executable was reported as never run.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove test_built_uses_configured_ninja_outside_path per review: it copied
whatever ninja was on PATH and asserted one existed, so the suite failed on
exactly the setup this PR fixes. The rewritten tests already verify the
configured CMAKE_MAKE_PROGRAM is the program that runs; the suite now passes
with and without Ninja on PATH on Windows and Linux.
tools/check_test_registration.py invoked bare ninja from PATH, so the audit failed with FileNotFoundError when the configured Ninja lived outside PATH. Read CMAKE_MAKE_PROGRAM from the build directory CMakeCache.txt and fail honestly when it is missing. Adapt the mocked built tests to a configured build and add a regression that runs a real Ninja from a path with spaces outside PATH.