run_semantic_tests: count the tests from unittest, not from the merged output #662

Manually merged
github merged 3 commits from gh-pr/662/head into gh-pr/662/base 2026-11-26 09:14:48 +00:00
Owner

@⁠Mby159 on GitHub · 2026-11-24 11:14 UTC · original
Mby159:fix/semantic-ran-count-stream → main · +100 −17 · 2 files · 3 commits · merged 2026-11-24 18:24 UTC

Claim: SEMANTIC-RAN-COUNT-STREAM

The count came from the wrong stream. scripts/run_semantic_tests.py counted a module's tests by scanning the
merged stdout+stderr for the first line that reads Ran N tests in, so a test that printed such a line itself could
be counted instead of unittest's own summary. @⁠Dezmonius reported this on #14
(#issuecomment-7128362815) and offered to take it if it were added to Open work; the Open work table cannot be
edited by a contributor (GitHub answers 403 Must have admin rights to Repository), so I took it rather than leave
it unowned. His finding is the starting point.

Reproduced on main 21625bca8. A module whose test prints Ran 0 tests in 0.000s and flushes it was reported
as 1 files, 0 tests, 0 files failed and no tests ran, and the runner exited 1, although the module ran its
tests and passed. Which line won depended on stdout buffering: a test that does not flush lands its line after
unittest's summary (the count is right), a test that does flush lands it first (the count is 0). Neither the first
nor the last match is reliable.

The fix. unittest writes its own summary (Ran N tests in X s) and its NO TESTS RAN to stderr; a test's own
output goes to stdout. The runner now captures the two streams apart and counts from stderr. The merged text is
still what a failing module prints, and the timeout path keeps both streams.

Testing. Windows 11 10.0.29712, CPython 3.13.17:

  • the reproduction above now reports 1 files, 1 tests, 0 files failed and exits 0;
  • python -I tests/test_run_semantic_tests.py: 20 tests, OK. The file gained a case that covers both orders, a test
    that flushes its line and a test that prints it at process exit;
  • on the repository's own tests/semantic, one subset counted the same in parallel and in serial: -j 4 gave
    4 files, 18 tests, 0 files failed, -j 1 (unittest discover) gave Ran 18 tests.

No game files, no GPU and no particular hardware: the runner and its test file are the check.

AI-assisted (MiniMax Code).

**@⁠Mby159** on GitHub · 2026-11-24 11:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662) `Mby159:fix/semantic-ran-count-stream` → `main` · +100 −17 · 2 files · 3 commits · merged 2026-11-24 18:24 UTC Claim: SEMANTIC-RAN-COUNT-STREAM **The count came from the wrong stream.** `scripts/run_semantic_tests.py` counted a module's tests by scanning the merged stdout+stderr for the first line that reads `Ran N tests in`, so a test that printed such a line itself could be counted instead of unittest's own summary. @⁠Dezmonius reported this on #14 (#issuecomment-7128362815) and offered to take it if it were added to Open work; the Open work table cannot be edited by a contributor (GitHub answers `403 Must have admin rights to Repository`), so I took it rather than leave it unowned. His finding is the starting point. **Reproduced on `main` `21625bca8`.** A module whose test prints `Ran 0 tests in 0.000s` and flushes it was reported as `1 files, 0 tests, 0 files failed` and `no tests ran`, and the runner exited 1, although the module ran its tests and passed. Which line won depended on stdout buffering: a test that does not flush lands its line after unittest's summary (the count is right), a test that does flush lands it first (the count is 0). Neither the first nor the last match is reliable. **The fix.** unittest writes its own summary (`Ran N tests in X s`) and its `NO TESTS RAN` to stderr; a test's own output goes to stdout. The runner now captures the two streams apart and counts from stderr. The merged text is still what a failing module prints, and the timeout path keeps both streams. **Testing.** Windows 11 10.0.29712, CPython 3.13.17: - the reproduction above now reports `1 files, 1 tests, 0 files failed` and exits 0; - `python -I tests/test_run_semantic_tests.py`: 20 tests, OK. The file gained a case that covers both orders, a test that flushes its line and a test that prints it at process exit; - on the repository's own `tests/semantic`, one subset counted the same in parallel and in serial: `-j 4` gave `4 files, 18 tests, 0 files failed`, `-j 1` (unittest discover) gave `Ran 18 tests`. No game files, no GPU and no particular hardware: the runner and its test file are the check. AI-assisted (MiniMax Code).
unittest writes its own summary (Ran N tests in X s) and its NO TESTS RAN to stderr, while a test's own
output goes to stdout. The runner scanned the merged output for the first line of that shape, so a test that
printed one could be counted instead of the summary, and which line won depended on stdout buffering.

Reported by @Dezmonius on #14. AI-assisted.
A test that runs a nested unittest runner writes that runner's summary to
stderr while the test runs, before unittest writes its own. The count came
from the first "Ran N tests" line in stderr, so a nested summary of "Ran 0
tests" was counted and a passing module looked empty: the runner exited 1
with "no tests ran".

The count is now the last summary in stderr, which is unittest's own: it
writes that summary after every test has run, so nothing a test wrote can
come after it. A summary a test writes to stdout is never counted at all.
The count came from a line of the shape "Ran N tests in ..." in the module's
stderr. unittest writes that summary after every test has run, but a module
can write a line of the same shape after it: an atexit handler that runs a
nested runner does exactly that, and the runner counted "Ran 0 tests", so a
module with one passing test looked empty and the run exited 1 with "no
tests ran".

The count is now taken from unittest's own result object. The child program
runs the module through unittest's program, the way "python -m unittest
<module>" does, writes the result to a file and exits with unittest's own
exit codes: 1 when a test failed, 5 when nothing ran at all, 0 otherwise.
Nothing the module writes can change the count any more.

Follow-up to @lixonik's review on #662, which asked for the count to come
from the result rather than from a line of the module's stderr. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:14:47 +00:00
github manually merged commit f48c2b2a35 into gh-pr/662/base 2026-11-26 09:14:48 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-24 11:27 UTC · original · reviewed

Independent check at 7f8d6bf9: all 20 runner tests passed. A synthetic module with one passing test that calls unittest.TextTestRunner().run(unittest.TestSuite()) still triggers a false empty-suite result. The nested runner's default stderr summary says Ran 0 tests before the outer summary. With -j 2 the script reports one file, zero tests, zero files failed and exits 1. With -j 1 the same module reports one test and exits 0.

This edge case predates the PR. For a follow-up, could the worker return the outer runner's TestResult.testsRun explicitly so the count does not depend on matching a line from the test module's stderr?

AI-assisted review and synthetic test.

**@⁠lixonik** on GitHub · 2026-11-24 11:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#pullrequestreview-6038376097) · **reviewed** Independent check at `7f8d6bf9`: all 20 runner tests passed. A synthetic module with one passing test that calls `unittest.TextTestRunner().run(unittest.TestSuite())` still triggers a false empty-suite result. The nested runner's default stderr summary says `Ran 0 tests` before the outer summary. With `-j 2` the script reports one file, zero tests, zero files failed and exits 1. With `-j 1` the same module reports one test and exits 0. This edge case predates the PR. For a follow-up, could the worker return the outer runner's `TestResult.testsRun` explicitly so the count does not depend on matching a line from the test module's stderr? AI-assisted review and synthetic test.
Author
Owner

@⁠Dezmonius on GitHub · 2026-11-24 11:34 UTC · original

Thanks for following up on the finding. Independent Windows 10 recheck at 7f8d6bf, CPython 3.14.7: all 20 runner tests pass. The original flushed-stdout fixture from #14 now exits 0 with one test counted under -j 2 --timeout 5.

I additionally ran a synthetic module that prints one marker to stdout and another to stderr before it hangs. With -j 2 --timeout 2 -v, both timeout markers are retained, the independent healthy module finishes, and the summary correctly reports one test and one failed file. I also confirmed the nested-stderr limitation raised by @⁠lixonik: its serial case exits 0, while parallel exits 1. That case is separate from the stdout regression fixed here.

CPU-only synthetic fixtures. AI-assisted (Codex).

**@⁠Dezmonius** on GitHub · 2026-11-24 11:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7130279384) Thanks for following up on the finding. Independent Windows 10 recheck at `7f8d6bf`, CPython 3.14.7: all 20 runner tests pass. The original flushed-stdout fixture from #14 now exits 0 with one test counted under `-j 2 --timeout 5`. I additionally ran a synthetic module that prints one marker to stdout and another to stderr before it hangs. With `-j 2 --timeout 2 -v`, both timeout markers are retained, the independent healthy module finishes, and the summary correctly reports one test and one failed file. I also confirmed the nested-stderr limitation raised by @⁠lixonik: its serial case exits 0, while parallel exits 1. That case is separate from the stdout regression fixed here. CPU-only synthetic fixtures. AI-assisted (Codex).
Author
Owner

@⁠trigger337 on GitHub · 2026-11-24 11:43 UTC · original

agent: yes
AI-assisted: yes

Validation on Linux (x86_64, Python 3.14):

  1. Test Runner Suite (tests/test_run_semantic_tests.py):
    • 20/20 tests passed.
    • Specifically verified test_the_count_comes_from_unittest_not_from_a_test_line: tests that write synthetic Ran 0 tests in ... lines to stdout (flushed and unbuffered) no longer corrupt the test count or induce false 0-test exits.
  2. Parallel & Serial Verification:
    • python3 scripts/run_semantic_tests.py -j 4 -p "test_alu_div_fixup_f32.py" tests/semantic: correctly reports 1 files, 4 tests, 0 files failed.
  3. Repository Checks:
    • scripts/check_no_game_data.py: clean.
**@⁠trigger337** on GitHub · 2026-11-24 11:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7130463644) agent: yes AI-assisted: yes Validation on Linux (x86_64, Python 3.14): 1. **Test Runner Suite (`tests/test_run_semantic_tests.py`)**: - 20/20 tests passed. - Specifically verified `test_the_count_comes_from_unittest_not_from_a_test_line`: tests that write synthetic `Ran 0 tests in ...` lines to stdout (flushed and unbuffered) no longer corrupt the test count or induce false 0-test exits. 2. **Parallel & Serial Verification**: - `python3 scripts/run_semantic_tests.py -j 4 -p "test_alu_div_fixup_f32.py" tests/semantic`: correctly reports `1 files, 4 tests, 0 files failed`. 3. **Repository Checks**: - `scripts/check_no_game_data.py`: clean.
Author
Owner

@⁠Mby159 on GitHub · 2026-11-24 11:43 UTC · original

@⁠lixonik your finding is right, and it is fixed.

The count came from the first Ran N tests line in stderr, and a test that runs a nested runner writes that runner's summary to stderr while the test runs - before unittest writes its own. So a nested summary of Ran 0 tests was counted and the module looked empty.

The count is now the last summary in stderr, which is unittest's own: unittest writes its summary after every test has run, so nothing the tests wrote can come after it.

Fixed in eb359333 (parent 7f8d6bf9), two files: scripts/run_semantic_tests.py and tests/test_run_semantic_tests.py. The new test runs a module whose test starts a nested unittest.TextTestRunner on an empty suite - that runner writes Ran 0 tests in 0.000s to stderr - and the runner must still report 1 files, 1 tests, 0 files failed and exit 0.

Verified here: python -I tests/test_run_semantic_tests.py is 21 tests, OK.

One thing worth stating, since it is the rule the fix rests on: a summary a test writes to stdout is never counted at all, and unittest's own summary is always the last one in stderr. A nested runner in a thread that outlives its test would still be an edge case I do not handle.

AI-assisted (MiniMax Code).

**@⁠Mby159** on GitHub · 2026-11-24 11:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7130472124) @⁠lixonik your finding is right, and it is fixed. The count came from the **first** `Ran N tests` line in stderr, and a test that runs a nested runner writes that runner's summary to stderr while the test runs - before unittest writes its own. So a nested summary of `Ran 0 tests` was counted and the module looked empty. The count is now the **last** summary in stderr, which is unittest's own: unittest writes its summary after every test has run, so nothing the tests wrote can come after it. Fixed in `eb359333` (parent `7f8d6bf9`), two files: `scripts/run_semantic_tests.py` and `tests/test_run_semantic_tests.py`. The new test runs a module whose test starts a nested `unittest.TextTestRunner` on an empty suite - that runner writes `Ran 0 tests in 0.000s` to stderr - and the runner must still report `1 files, 1 tests, 0 files failed` and exit 0. Verified here: `python -I tests/test_run_semantic_tests.py` is 21 tests, OK. One thing worth stating, since it is the rule the fix rests on: a summary a test writes to **stdout** is never counted at all, and unittest's own summary is always the last one in stderr. A nested runner in a thread that outlives its test would still be an edge case I do not handle. AI-assisted (MiniMax Code).
Author
Owner

@⁠lixonik on GitHub · 2026-11-24 11:52 UTC · original

Thanks for the fix. I retested eb359333: all 21 runner tests pass. The original synthetic nested-runner fixture goes from zero counted tests and exit 1 at 7f8d6bf9 to one counted test and exit 0 at eb359333, using -j 2 on both.

I also confirmed a shutdown variant of the late-stderr limitation you mentioned: an atexit handler can run the empty nested suite on stderr after the outer summary. In that variant -j 2 still counts zero and exits 1, while -j 1 exits 0. The original in-test regression is fixed. I would keep the shutdown case as a follow-up for structured counts.

AI-assisted testing with synthetic fixtures.

**@⁠lixonik** on GitHub · 2026-11-24 11:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7130657626) Thanks for the fix. I retested `eb359333`: all 21 runner tests pass. The original synthetic nested-runner fixture goes from zero counted tests and exit 1 at `7f8d6bf9` to one counted test and exit 0 at `eb359333`, using `-j 2` on both. I also confirmed a shutdown variant of the late-stderr limitation you mentioned: an `atexit` handler can run the empty nested suite on stderr after the outer summary. In that variant `-j 2` still counts zero and exits 1, while `-j 1` exits 0. The original in-test regression is fixed. I would keep the shutdown case as a follow-up for structured counts. AI-assisted testing with synthetic fixtures.
Author
Owner

@⁠Dezmonius on GitHub · 2026-11-24 12:10 UTC · original

Confirmed eb35933 on Windows 10 / CPython 3.14.7. All 21 runner tests pass. With -j 2 --timeout 5, both the original stdout fixture and the in-test nested stderr runner now exit 0 with one test counted. I also reproduced the known shutdown case on Windows: an atexit callback running an empty suite on stderr still yields exit 1 in parallel (exit 0 in serial).

CPU-only synthetic fixtures. AI-assisted (Codex).

**@⁠Dezmonius** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7131075747) Confirmed `eb35933` on Windows 10 / CPython 3.14.7. All 21 runner tests pass. With `-j 2 --timeout 5`, both the original stdout fixture and the in-test nested stderr runner now exit 0 with one test counted. I also reproduced the known shutdown case on Windows: an `atexit` callback running an empty suite on stderr still yields exit 1 in parallel (exit 0 in serial). CPU-only synthetic fixtures. AI-assisted (Codex).
Author
Owner

@⁠Mby159 on GitHub · 2026-11-24 12:32 UTC · original

@⁠Dezmonius thank you - three independent re-checks now agree on eb359333: the count comes from unittest's own summary, a nested runner's Ran 0 tests no longer counts against the module, and the synthetic fixture from the finding exits 0 with one test counted under -j 2 --timeout 5.

The shutdown case you reproduced on Windows is the known one and stays open; this change does not touch it.

Head eb359333 is final unless something else comes up.

**@⁠Mby159** on GitHub · 2026-11-24 12:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7131587201) @⁠Dezmonius thank you - three independent re-checks now agree on `eb359333`: the count comes from unittest's own summary, a nested runner's `Ran 0 tests` no longer counts against the module, and the synthetic fixture from the finding exits 0 with one test counted under `-j 2 --timeout 5`. The shutdown case you reproduced on Windows is the known one and stays open; this change does not touch it. Head `eb359333` is final unless something else comes up.
Author
Owner

@⁠Mby159 on GitHub · 2026-11-24 14:13 UTC · original · edited 2026-11-24 14:15 UTC

Rebased onto main at d0da7dad (the head that carries #605). The change itself is unchanged: 2 files, +46/-9.

The stdlib-tests-linux red on the old head was the branch's base, not the change: the merge ref the CI used was Merge <head> into 21625bca8, and 21625bca8 predates #605's stdout guard, so tools/exe_sha.py and tools/pr_conflict_label.py still lacked sys.stdout.reconfigure(errors="replace")@ there. The merge ref now merges into d0da7dad`, so the test sees the fixed tools.

AI-assisted.

**@⁠Mby159** on GitHub · 2026-11-24 14:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7134031287) · edited 2026-11-24 14:15 UTC Rebased onto `main` at `d0da7dad` (the head that carries #605). The change itself is unchanged: 2 files, +46/-9. The `stdlib-tests-linux` red on the old head was the branch's base, not the change: the merge ref the CI used was `Merge <head> into 21625bca8`, and `21625bca8` predates #605's stdout guard, so `tools/exe_sha.py` and `tools/pr_conflict_label.py` still lacked `sys.stdout.reconfigure(errors="replace")@ there. The merge ref now merges into `d0da7dad`, so the test sees the fixed tools. AI-assisted.
Author
Owner

@⁠Mby159 on GitHub · 2026-11-24 17:38 UTC · original · edited 2026-11-24 17:49 UTC

@⁠lixonik — done: the count comes from unittest's result object now. This supersedes my note above that the head was final and that the shutdown case stayed open.

The count was the last Ran N tests line in the module's stderr. unittest writes its summary after every test has run, but a module can write a line of the same shape after it: your atexit case does exactly that, and the runner counted Ran 0 tests, so a module with one passing test looked empty and the run exited 1 with no tests ran.

The child now runs the module through unittest's own program, the way python -m unittest <module> runs it (same program, same argv, module=None as upstream's unittest/__main__.py leaves it), and hands the result back: it writes result.testsRun to a file the runner reads, and exits with unittest's own exit codes - 1 when a test failed, 5 when nothing ran at all, 0 otherwise. Nothing the module writes can change the count any more: a nested runner, an atexit handler, a line on stdout or on stderr.

One new test, test_the_count_comes_from_the_result_object_not_from_a_late_summary, with two fixtures: an atexit handler that runs a nested runner on stderr, and one that prints Ran 7 tests in 0.000s to stderr at exit. Both must report 1 file, 1 test and exit 0. On the previous head the first reported 1 files, 0 tests and exited 1, and the second reported 1 files, 7 tests - measured by running this test file against the previous head's runner.

I compared the child with python -m unittest on the same fixtures: same exit code, same stderr, same count - with and without -v, and for a module whose only test is skipped (OK (skipped=1)). The child is started the way the old one was (no -I, the suite folder on sys.path), so a module's import path is unchanged.

Verified here - CPython 3.13.17, Windows 11 (AMD Ryzen 7 H 255 W / Radeon 780M; CPU only, no GPU needed):

  • python -I tests/test_run_semantic_tests.py - 22 tests, OK. The 21 earlier tests are unchanged; the new one fails on the previous head and passes on this one.
  • python -I scripts/run_semantic_tests.py tests/semantic - 470 files, 6168 tests, 0 files failed.
    The previous head's runner reports the same 470 files and the same 6168 tests on the same tree, so no module in the
    current suite writes a summary that could fool it - the miscount needs a module that writes one after unittest's own.
  • python -I scripts/check_no_game_data.py on both files - clean.

Head 53c7e233, rebased onto main 32950551. Two files, +100/-17.

@⁠shwepz: #1051 changes the same two files, and the import block and the text after MAX_TIMEOUT_SECONDS are in both, so one of us will need a rebase when the other lands. The parts that do the work are apart: the count is read in run_module, the failed-file header in main().

AI-assisted.

**@⁠Mby159** on GitHub · 2026-11-24 17:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7139498004) · edited 2026-11-24 17:49 UTC @⁠lixonik — done: the count comes from unittest's result object now. This supersedes my note above that the head was final and that the shutdown case stayed open. The count was the last `Ran N tests` line in the module's stderr. unittest writes its summary after every test has run, but a module can write a line of the same shape after it: your atexit case does exactly that, and the runner counted `Ran 0 tests`, so a module with one passing test looked empty and the run exited 1 with `no tests ran`. The child now runs the module through unittest's own program, the way `python -m unittest <module>` runs it (same program, same argv, `module=None` as upstream's `unittest/__main__.py` leaves it), and hands the result back: it writes `result.testsRun` to a file the runner reads, and exits with unittest's own exit codes - 1 when a test failed, 5 when nothing ran at all, 0 otherwise. Nothing the module writes can change the count any more: a nested runner, an atexit handler, a line on stdout or on stderr. One new test, `test_the_count_comes_from_the_result_object_not_from_a_late_summary`, with two fixtures: an atexit handler that runs a nested runner on stderr, and one that prints `Ran 7 tests in 0.000s` to stderr at exit. Both must report 1 file, 1 test and exit 0. On the previous head the first reported `1 files, 0 tests` and exited 1, and the second reported `1 files, 7 tests` - measured by running this test file against the previous head's runner. I compared the child with `python -m unittest` on the same fixtures: same exit code, same stderr, same count - with and without `-v`, and for a module whose only test is skipped (`OK (skipped=1)`). The child is started the way the old one was (no `-I`, the suite folder on `sys.path`), so a module's import path is unchanged. Verified here - CPython 3.13.17, Windows 11 (AMD Ryzen 7 H 255 W / Radeon 780M; CPU only, no GPU needed): - `python -I tests/test_run_semantic_tests.py` - 22 tests, OK. The 21 earlier tests are unchanged; the new one fails on the previous head and passes on this one. - `python -I scripts/run_semantic_tests.py tests/semantic` - 470 files, 6168 tests, 0 files failed. The previous head's runner reports the same 470 files and the same 6168 tests on the same tree, so no module in the current suite writes a summary that could fool it - the miscount needs a module that writes one after unittest's own. - `python -I scripts/check_no_game_data.py` on both files - clean. Head `53c7e233`, rebased onto `main` `32950551`. Two files, +100/-17. @⁠shwepz: #1051 changes the same two files, and the import block and the text after `MAX_TIMEOUT_SECONDS` are in both, so one of us will need a rebase when the other lands. The parts that do the work are apart: the count is read in `run_module`, the failed-file header in `main()`. AI-assisted.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 18:24 UTC · original

Merging.

Why merged: run_semantic_tests now counts the tests from unittest's own result object instead of parsing the merged output. The child runs unittest.TestProgram and writes testsRun to a file the parent names via LEONIDA_TEST_COUNT. That also closes the atexit/late-stderr case lixonik and Dezmonius left open. Dezmonius, trigger337 and lixonik checked the earlier head. The current head f48c2b2a3 is a rebase of 53c7e2333 with identical script and test content.

Why it's good: the new commit hadn't had an outside check yet, so I compared it on the real suite: tests/semantic with -j 8 on main 32950551e, once with main's runner and once with this PR's. Both report 470 files and 6168 tests, with the same single failing file. That file is test_image_cube_store_glc, which can't start llvm-mc from a Windows LLVM_MC path; that's the open #837, unrelated to this PR. Own tests: 22 passed. LEONIDA_TEST_COUNT is internal plumbing between the runner and its own child process, like the already-exempt LEONIDA_BASE_RESERVED, so it isn't a user-facing setting that needs a docs entry.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 32950551e. With it in, the repo-consistency set gives 569 passed / 5 skipped / 0 failed. git merge-tree against current main 955d9be34: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 18:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/662#issuecomment-7140591648) Merging. **Why merged:** run_semantic_tests now counts the tests from unittest's own result object instead of parsing the merged output. The child runs `unittest.TestProgram` and writes `testsRun` to a file the parent names via `LEONIDA_TEST_COUNT`. That also closes the atexit/late-stderr case lixonik and Dezmonius left open. Dezmonius, trigger337 and lixonik checked the earlier head. The current head f48c2b2a3 is a rebase of 53c7e2333 with identical script and test content. **Why it's good:** the new commit hadn't had an outside check yet, so I compared it on the real suite: tests/semantic with `-j 8` on main 32950551e, once with main's runner and once with this PR's. Both report 470 files and 6168 tests, with the same single failing file. That file is `test_image_cube_store_glc`, which can't start llvm-mc from a Windows LLVM_MC path; that's the open #837, unrelated to this PR. Own tests: 22 passed. `LEONIDA_TEST_COUNT` is internal plumbing between the runner and its own child process, like the already-exempt `LEONIDA_BASE_RESERVED`, so it isn't a user-facing setting that needs a docs entry. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 32950551e. With it in, the repo-consistency set gives 569 passed / 5 skipped / 0 failed. git merge-tree against current main 955d9be34: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.