test(tools): add test coverage for check_test_registration #1623
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1623"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Amirtheshwaran on 2026-10-08T15:06:14Z.
What
Add unit test coverage for
tools/check_test_registration.py, refactor its entrypoint for testability, and register the test suite inCMakeLists.txt.main(argv=None)returning exit status (0on success,1on error) and invoke viaraise SystemExit(main()).ninja -t targets alland readCTestTestfile.cmakewithencoding="utf-8", errors="replace"to prevent decode errors on non-UTF-8 host code pages.tools/tests/test_check_test_registration.pycovering:built(): parses test executables from Ninja rules, strips.exe, and filters non-test targets.registered(): recursively parsesCTestTestfile.cmakeacross POSIX and Windows paths and handles argument tokens.main(): validates CLI--listmode, failure on unconfigured/empty test directories, clean exit when unrun tests matchKNOWN_UNRUN, failure on unregistered fresh executables, and failure on stale entries inKNOWN_UNRUN.check_test_registrationin rootCMakeLists.txtunderBUILD_TESTING.Tested
Windows 11, Python 3.11:
python -m unittest discover -s tools/tests -v: 21 tests pass in 1.0s (including all 7CheckTestRegistrationTeststest cases).python tools/check_conventions.py --base origin/main: passed (All conventions checks passed.).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T18:17:16Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)CMakeLists.txtL43Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:53:11Z.
Closing: this refactors
check_test_registration.pyso it can be unit-tested, but nothing in it is broken on main and the tests pass without the change. If you hit a real failure in the script (the code page case, for example), a PR with that failure and its fix is welcome.Pull request closed