test_cpp_preflight: take the Visual Studio route on any host #409
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!409
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/cpp-preflight-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
tests/test_cpp_preflight.py's end-to-end case (test_library_failure_stops_check_and_build_before_reading_input) runsmake_game.main()and expects the Visual Studio library check (check_cpp_library). Butcheck_windows_sdkpicks its route from the host:check_linux_compiler, which asks the toolchain forclang; the test's fake toolchain only answersclang++, so the case failed withAssertionError: Unexpected tool requested: clang(and thenFileNotFoundErroron the missing.nup);bundled_mingw()finds llvm-mingw and the route ischeck_mingw, so the case would not test the Visual Studio check there either.The case now pins
make_game.LINUXtoFalseandbundled_mingwto"", 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 ofsource-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 onmain).HOOKSHOT_CPP_TEST_SOURCEwith a copy ofmake_game.pywhosecheck_windows_sdkskipscheck_cpp_library: both subtests fail, so the case still catches the regression it is for.🤖 Generated with Claude Code