tests: ignore commented CMake registrations when checking CTest coverage #2199

Open
github-bot wants to merge 1 commit from github-bot/gh-2199 into main AGit
Owner

@⁠EdenBendheim on GitHub · 2026-11-26 05:24 UTC · original
EdenBendheim:ubiq/ctest-registration-comments → main · +61 −3 · 1 files · 1 commits · open

Claimed in the coordination issue as: TEST-CTEST-REGISTRATION-COMMENTS (claim)

Commenting out add_test(...) left the registration checker green for a built executable. In a throwaway CMake project, ctest -N listed zero tests while the checker reported zero missing registrations. The checker now strips CMake line and bracket comments before scanning declarations and skip properties. It preserves literal # characters in quoted, escaped and bracket arguments.

Three regression cases failed on main a73a57e13. With this change, all 10 registration tests pass on Python 3.12.14 and 3.14.3 on macOS, and the checker flags the omitted executable from the CMake fixture. Compile, diff and changed-file game-data checks passed. Simulated merge with #1418 was clean.

GPUs tested: n/a. All tests used synthetic inputs.

AI-assisted: yes. Created with gpt-6.2-astra in Codex.

**@⁠EdenBendheim** on GitHub · 2026-11-26 05:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2199) `EdenBendheim:ubiq/ctest-registration-comments` → `main` · +61 −3 · 1 files · 1 commits · open Claimed in the coordination issue as: TEST-CTEST-REGISTRATION-COMMENTS ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608)) Commenting out `add_test(...)` left the registration checker green for a built executable. In a throwaway CMake project, `ctest -N` listed zero tests while the checker reported zero missing registrations. The checker now strips CMake line and bracket comments before scanning declarations and skip properties. It preserves literal `#` characters in quoted, escaped and bracket arguments. Three regression cases failed on main `a73a57e13`. With this change, all 10 registration tests pass on Python 3.12.14 and 3.14.3 on macOS, and the checker flags the omitted executable from the CMake fixture. Compile, diff and changed-file game-data checks passed. Simulated merge with #1418 was clean. GPUs tested: n/a. All tests used synthetic inputs. AI-assisted: yes. Created with gpt-6.2-astra in Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:22:03 +00:00
Author
Owner

@⁠real-rusher on GitHub · 2026-11-26 10:12 UTC · original

Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. python -I tests/test_ctest_registration.py: 10 tests OK against the real runtime/CMakeLists.txt.

Compared with main's helpers on a small CMake text (one live test, plus a commented-out add_executable and add_test): main's built_test_executables() and registered_commands() count disabled_test and orphan_test from the comments; this PR's count only live_test. compileall clean.

AI-assisted: yes (Claude Code)

**@⁠real-rusher** on GitHub · 2026-11-26 10:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2199#issuecomment-7189054554) Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. python -I tests/test_ctest_registration.py: 10 tests OK against the real runtime/CMakeLists.txt. Compared with main's helpers on a small CMake text (one live test, plus a commented-out add_executable and add_test): main's built_test_executables() and registered_commands() count disabled_test and orphan_test from the comments; this PR's count only live_test. compileall clean. AI-assisted: yes (Claude Code)
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-26 10:32 UTC · original

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_ctest_registration.py: 10 passed (main: 6 passed).

(AI-assisted test run; output checked by hand.)

**@⁠DeadlyChirp** on GitHub · 2026-11-26 10:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2199#issuecomment-7189502992) Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_ctest_registration.py`: 10 passed (main: 6 passed). (AI-assisted test run; output checked by hand.)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2199/head:github-bot/gh-2199'
git switch 'github-bot/gh-2199'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2199'
git switch 'github-bot/gh-2199'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2199'
git switch 'github-bot/gh-2199'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2199'
git switch 'main'
git merge --squash 'github-bot/gh-2199'
git switch 'main'
git merge --ff-only 'github-bot/gh-2199'
git switch 'main'
git merge 'github-bot/gh-2199'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.