[PR #1252] [MERGED] test_ctest_registration: read a named skip code (kSkip) by its value (red on main since #927) #1284

Closed
opened 2026-11-26 20:20:43 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1252
Author: @Boost9898
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: fix/host-region-skip-code


📝 Commits (1)

  • a04f203 test_ctest_registration: read a named skip code by its constexpr value

📊 Changes

1 file changed (+20 additions, -3 deletions)

View changed files

📝 tests/test_ctest_registration.py (+20 -3)

📄 Description

Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144141333

What and why

#927 added runtime/test/vk_host_region_import_test.cpp, registered twice with SKIP_RETURN_CODE 77. Its skip paths return kSkip;, where constexpr int kSkip = 77; (line 29). whole_test_skips_not_77 in tests/test_ctest_registration.py compares the returned token itself with "77", so it reports ('test/vk_host_region_import_test.cpp:341', 'kSkip') (once per registration), and test_whole_test_skips_return_the_skip_code fails on main 66d4f5aa3.

The test binary is right: it exits 77. This PR changes the check, not the test. A returned name now counts by the value of its constexpr int in the same source file. A name that resolves to something else, or that isn't defined there, is still reported. So the check stays as strict as before for literal codes, and a kSkip = 0 would still be caught.

A new unit test covers kSkip = 77 (passes), kSkip = 0 (reported) and an undefined name (reported), on a synthetic CMake text and source in a temp folder.

Tested

Apple M4, macOS 26.5.1, Python 3.14.8 and 3.12.10, CPU only, no game files.

  • tests/test_ctest_registration.py: fails on main 66d4f5aa3. With this change, 5 OK on both versions. With the old check and the new unit test, it fails again.
  • python -m compileall, git diff --check and scripts/check_no_game_data.py on the changed file: clean.

GPUs tested: n/a (no GPU tests involved)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule changes)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1252 **Author:** [@Boost9898](https://github.com/Boost9898) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `fix/host-region-skip-code` --- ### 📝 Commits (1) - [`a04f203`](https://github.com/ubiquitarianism/leonida/commit/a04f2036094b92cfc0b04ead594c7249ded347f7) test_ctest_registration: read a named skip code by its constexpr value ### 📊 Changes **1 file changed** (+20 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_ctest_registration.py` (+20 -3) </details> ### 📄 Description Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144141333 ### What and why #927 added `runtime/test/vk_host_region_import_test.cpp`, registered twice with `SKIP_RETURN_CODE 77`. Its skip paths `return kSkip;`, where `constexpr int kSkip = 77;` (line 29). `whole_test_skips_not_77` in `tests/test_ctest_registration.py` compares the returned token itself with `"77"`, so it reports `('test/vk_host_region_import_test.cpp:341', 'kSkip')` (once per registration), and `test_whole_test_skips_return_the_skip_code` fails on `main` `66d4f5aa3`. The test binary is right: it exits 77. This PR changes the check, not the test. A returned name now counts by the value of its `constexpr int` in the same source file. A name that resolves to something else, or that isn't defined there, is still reported. So the check stays as strict as before for literal codes, and a `kSkip = 0` would still be caught. A new unit test covers `kSkip = 77` (passes), `kSkip = 0` (reported) and an undefined name (reported), on a synthetic CMake text and source in a temp folder. ### Tested Apple M4, macOS 26.5.1, Python 3.14.8 and 3.12.10, CPU only, no game files. - `tests/test_ctest_registration.py`: fails on `main` `66d4f5aa3`. With this change, 5 OK on both versions. With the old check and the new unit test, it fails again. - `python -m compileall`, `git diff --check` and `scripts/check_no_game_data.py` on the changed file: clean. GPUs tested: n/a (no GPU tests involved) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule changes) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:43 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1284
No description provided.