Skip to content

Run CTest CMake fixtures from Windows artifacts under Wine - #4041

Open
ligmaSec wants to merge 3 commits into
ItsNotRexed:mainfrom
ligmaSec:ci/wine-ctest-cmake
Open

ligmaSec wants to merge 3 commits into
ItsNotRexed:mainfrom
ligmaSec:ci/wine-ctest-cmake

Conversation

@ligmaSec

@ligmaSec ligmaSec commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claim in coordination #3918. Supersedes #3961.

What and why

The Windows CTest inventory records CMake script tests as commands for the Windows build runner. run_wine_tests.py skipped them all, and the workflow separately reconstructed the async loader command. That left the other loader checks and the pipeline-checker CLI outside the normal Wine test report.

Recognize the repository's loader and pipeline-checker CMake fixtures in the inventory. Invoke the Linux CMake with the corresponding checkout script and mapped artifact paths, and have the fixture use the configured Wine command. The results use the same timeout, status and summary handling as the direct executable tests. The workflow now requires the async, dynamic GDK and bundled-DLL checks through this path. The testing guide includes the command for a downloaded Windows CI artifact.

Tested

  • Debian 13, Wine 10.0, Xvfb, Python 3.13.5 and CMake 3.31.6. The Windows artifact from 49475796 and its matching scripts gave 16 passed, 0 failed, 0 skipped in a selected loader and CLI run. The artifact root contained spaces. The same inventory's four CMake fixtures were skipped by the old runner and all passed with this change: async, dynamic GDK, bundled DLL, and pipeline-checker CLI.
  • Ran the 55 Wine-runner tests, 12 CI/CTest registration tests, documentation link and path checks, line-ending checks, and actionlint with ShellCheck. The runner suite exercises native CMake with a synthetic child command, including spaces and a literal semicolon.
  • The local artifact predates the newer startup command-line, Unicode path, and game-directory fixtures. Those need the current hosted build to verify their Windows binaries under Wine.

Synthetic fixtures only. AI-assisted (Codex).

Integration with Wine timeouts

The CMake launch assertion now checks the subprocess handle, so it works with both launch paths. All 55 standalone runner tests passed and all 56 passed in a clean trial merge with #4589. On Wine 10.0, a timed-out CMake fixture from that combined runner stopped its Windows helper before the next test, which passed under the same prefix. Synthetic fixtures only.

Verification after integrating main

Tested the runner with the upstream Windows build from d0835dd9 and its matching checkout in a path containing a space. All 13 selected tests passed on both Debian Wine 10.0 and WineHQ Stable 11.0. The selection includes every CMake script in that artifact, covering startup arguments, dynamic and bundled DLLs, async loading, Unicode console paths, the game directory and the pipeline-checker CLI.

The refreshed runner also recognizes the newer atexit fixture. It passed all eight termination paths on both Wine versions with a locally cross-built x64 Windows loader and guest (clang-cl 21.1.8). Python 3.12.16 passed all 76 targeted runner, CTest fixture and registration tests. A failed CTest setup still prevents a script fixture from launching. Synthetic fixtures only.

@evilclanker9000

Copy link
Copy Markdown
Contributor

Independent check of 22788c9 against aa2988c. The three focused Python tests passed with synthetic artifact metadata. They covered skipping unrelated commands, diagnosing missing inputs, and passing the mapped pipeline tool and test directory to the stubbed launcher with the CTest timeout. The Windows artifact includes the executable and DLL paths used by the loader checks. The hosted Runtime run is awaiting action, so this does not verify the new required Wine cases end to end.

This complements #3792. This PR runs known CMake script commands with locally mapped paths. #3792 orders CTest FIXTURES_SETUP and FIXTURES_REQUIRED tests and reports setup failures to consumers. Both touch run_test, so the branches should preserve both behaviors when combined.

AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 22788c9a on Windows 11: python -I tests/test_run_wine_tests.py -> 55 tests, OK (5 skipped); compileall and git diff --check clean.

The new cases recognize the loader and pipeline-checker CMake fixtures from the Windows CTest inventory and keep the non-fixture commands unchanged; the skips are the host-only Wine cases. The workflow no longer reconstructs the async loader command separately, so the Wine report and the Windows report now cover the same fixture set. No blocking issue; this supersedes #3961 as stated.

@ligmaSec

Copy link
Copy Markdown
Contributor Author

I checked the interaction with #3792 at 3ff2bfe8 and #4034 at e8ea6447 in a local integration checkout on Debian 13. #4034 merged cleanly. #3792 overlaps in run_test. Keeping the CMake command builder and applying the failed-setup check after command selection preserves both paths.

The combined runner passed all 56 runner tests and all five fixture-order tests. I also exercised an actual local CMake consumer listed ahead of its setup in the inventory, using --root . in a checkout path containing spaces. With a passing setup, it ran the setup first and then CMake. With a failed setup, it reported the required consumer failure and never launched CMake. Synthetic inputs, AI-assisted (Codex).

@JRamos1993

Copy link
Copy Markdown
Contributor

Tested 791fe943 merged onto main 1cc6e3c1 on Windows 11, CPython 3.14.3, CPU only: pass.

  • python -I tests/test_run_wine_tests.py: 66 tests OK (skipped=8).
  • Negative control (scripts/run_wine_tests.py from main, the PR's tests kept): tests/test_run_wine_tests.py 66 tests FAILED (failures=7, skipped=8).
  • py_compile on the 2 changed Python files: OK; git diff --check: clean.

No game files. AI-assisted (Claude Code).

@NJ1912

NJ1912 commented Nov 23, 2026

Copy link
Copy Markdown

Code read of 791fe943 (merges cleanly onto main 167feec5): no defects found in the runner change; three notes.

  • On CI coverage: this PR's Runtime run can't check the new requirements even after approval, because the wine job is skipped on pull_request (.github/workflows/runtime.yml:303). Before this PR, run_tiny_gdk_load and run_tiny_bundled_load (runtime.yml:353) did not run under Wine in CI. The description reports Wine results for Debian 10.0 and WineHQ 11.0, but the wine (ubuntu) leg runs Ubuntu 24.04's 9.0 (runtime.yml:295). Without a workflow_dispatch run on the fork (docs/testing.md:96-97), the first run that enforces them is the push to main after merge.
  • CMAKE_FIXTURES (scripts/run_wine_tests.py:39-48) is a hand-kept list; anything not in it ends up as skip (:175-177, :216-217). On current main that covers gta6rt_stack and vk_pipeline_check_stack (check_stack_reserve.cmake, main runtime/CMakeLists.txt:1103-1105, :1224-1227), which is fine for a header-only check, but a future LOADER/GUEST script would also only show up as skip. That already happened once: check_atexit.cmake came in from main and had to be added by hand in the merge 791fe943. A small test comparing this table with the -DRUNNER=... -P .../test/*.cmake registrations would catch it.
  • Nit: tests/test_run_wine_tests.py:397 and :415 patch subprocess.run, but on Linux/macOS run_test_process launches through subprocess.Popen (scripts/run_wine_tests.py:307), so launch.assert_not_called() (:399, :419) can't fail there. The status assertions still cover the behaviour; patching rwt.run_test_process, as :427 does, would make the check work on both paths.

Not run: code read only, no tests run. AI-assisted review.

@kiwi3007

Copy link
Copy Markdown

Tested 791fe943 against base 75a5f543 on CachyOS with Wine 11.21 in a dedicated Wine prefix. Both runners used Windows CI artifact 14841428160, built from 04d02082, with the matching fixture scripts.

  • PR runner passed run_startup_cmdline, run_tiny_game_console_paths, and run_tiny_game_dir (3 passed, 0 failed, 0 skipped).
  • Base runner skipped all three because their CTest commands invoke the Windows CMake executable.
  • python -I tests/test_run_wine_tests.py passed all 66 tests on the PR. With the same tests against the base runner, seven failed.

Synthetic fixtures only. CPU-only validation. AI-assisted with Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants