Skip to content

test_cpp_preflight: take the Visual Studio route on any host - #409

Open
Wpaif wants to merge 1 commit into
NotRexed:mainfrom
Wpaif:fix/cpp-preflight-test
Open

Wpaif wants to merge 1 commit into
NotRexed:mainfrom
Wpaif:fix/cpp-preflight-test

Conversation

@Wpaif

@Wpaif Wpaif commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

What

tests/test_cpp_preflight.py's end-to-end case (test_library_failure_stops_check_and_build_before_reading_input) runs make_game.main() and expects the Visual Studio library check (check_cpp_library). But check_windows_sdk picks its route from the host:

  • on Linux it goes to check_linux_compiler, which asks the toolchain for clang; the test's fake toolchain only answers clang++, so the case failed with AssertionError: Unexpected tool requested: clang (and then FileNotFoundError on the missing .nup);
  • on Windows with the builder zip, bundled_mingw() finds llvm-mingw and the route is check_mingw, so the case would not test the Visual Studio check there either.

The case now pins make_game.LINUX to False and bundled_mingw to "", so it always exercises the route it asserts on. The other three cases were already host-neutral.

CI

The test now passes on Linux with g++, so I added it to the Linux job of source-regressions.yml (python -I -B tests/test_cpp_preflight.py --cxx g++). The docstring called it Windows-only, so if you'd rather keep it out of CI, I'm happy to drop that step.

Testing

  • python -I -B tests/test_cpp_preflight.py --cxx g++ on Linux: 4/4 pass (before: 1 failure, 1 error on main).
  • Using the test's own HOOKSHOT_CPP_TEST_SOURCE with a copy of make_game.py whose check_windows_sdk skips check_cpp_library: both subtests fail, so the case still catches the regression it is for.
  • Not run on Windows (I only have Linux).

🤖 Generated with Claude Code

The end-to-end case runs make_game.main() and expects the Visual Studio
library check, but check_windows_sdk goes to check_linux_compiler on Linux
and to check_mingw when llvm-mingw sits beside the builder: the fake
toolchain was asked for "clang" and the case failed. It now pins LINUX
off and bundled_mingw to "", so the route under test is the one it
checks, and the test runs in the Linux source-regressions job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Wpaif
Wpaif force-pushed the fix/cpp-preflight-test branch from 6e2ed30 to 667ca67 Compare November 8, 2026 00:09
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.

1 participant