Repository navigation
build(quest): the q15t host tests are CMake targets, not shell scripts - #2071
Merged
Merged
Conversation
#2053) ADR 0041: native code is built by CMake. src/quest/tests/q15t is now a CMake project with its own presets (q15t-host-tests: the host compiler; q15t-ndk-checks: the NDK toolchain file named by Q15T_NDK). Each mod/<module>.sh becomes mod/<module>.cmake holding that module's test programs and, for the modules the repack checks, its arm64 compile check. run_host_tests.sh goes; `just test-quest-q15t [module]` configures, builds and runs ctest in both configures. The checks that read built output stay scripts under check/ (static-initializer sections, the dronemuzzle and powerboost thunk listings, the qemu run, the exported page symbol). The mutation run configures a scratch copy of the project with Q15T_PLUGIN_DIR pointing at the mutated sources instead of compiling by hand. Same compile flags per program as the old command lines; the ctest names are <module>.<program>, labelled by module, and the timeouts the scripts passed to `timeout` are ctest TIMEOUT properties. Co-Authored-By: claude-main <agents@sprock.io> Co-Authored-By: Andrew Bates <a@sprock.io>
…r command left (#2053) Co-Authored-By: claude-main <agents@sprock.io> Co-Authored-By: Andrew Bates <a@sprock.io>
…-host-tests-cmake * origin/main: docs(adr): ADR 0041, native code is built by CMake, not scripts (#2058)
…-host-tests-cmake * origin/main: fix(installer): refuse an install over a release that cannot be compared (#2056) test(plugin-gate): pin the case-insensitive comparison of a staged plugin's name (#2063) fix(runtime): replace the C-style casts left in dll_load_hook.cpp (#665) (#2059) test(quest-data): guard the rig.warns[0] reads in data_step_test (#1940) (#2057)
The row and the shape bullet named files that are CMake targets now; the presets rule names the project-local presets file. Co-Authored-By: claude-main <agents@sprock.io> Co-Authored-By: Andrew Bates <a@sprock.io>
…efix (#2053) docs/standards/naming.md: a CMake target is nevr_<name>; tools/tests/test_naming.py caught the check objects, stand-in libraries and the thunk program. Output file names and ctest names are unchanged. Co-Authored-By: claude-main <agents@sprock.io> Co-Authored-By: Andrew Bates <a@sprock.io>
…-host-tests-cmake * origin/main: build(tools): the signature fixture DLLs and the VM probe are CMake targets (#2070) build: compile checks and test-scripting use presets and targets (#2068) build(quest): quest_patch_libr15 is a CMake target built through a preset (#2050) (#2067) fix(quest): add the Controller Hand Flip toggle to the NEVR settings page (#2044) # Conflicts: # docs/adr/0041-native-code-is-built-by-cmake.md
…s, not the removed scripts (#2053) Co-Authored-By: claude-main <agents@sprock.io> Co-Authored-By: Andrew Bates <a@sprock.io>
thesprockee
pushed a commit
that referenced
this pull request
Nov 4, 2026
…t-host-tests-cmake * origin/main: build(quest): the q15t host tests are CMake targets, not shell scripts (#2071)
thesprockee
pushed a commit
that referenced
this pull request
Nov 4, 2026
…-pin-cmake-combat-libs * origin/main: build(quest): the q15t host tests are CMake targets, not shell scripts (#2071) # Conflicts: # docs/adr/0041-native-code-is-built-by-cmake.md
metis-sprock
added a commit
that referenced
this pull request
Nov 4, 2026
Main turned the Quest host tests into CMake targets (#2074, #2071), which removed the shell recipes this branch had edited. The branch's two Quest test changes move into the new groups: the nevr_config_set_test target in shared.cmake (and its name in the pinned list of the shared group), and nevr_config.cpp plus the host yaml-cpp in the texture_menu_hook_test link in hooks.cmake. The N43 verify sensor and its comment hunk in the justfile are applied on main's justfile. Refs #1232 Refs #2060 Co-Authored-By: nevr-file-writes <agents@sprock.io> Co-Authored-By: Andrew Bates <a@sprock.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2053
ADR 0041: the q15t plugin's host tests were compiled by
run_host_tests.shand 37mod/*.shscripts. They are now a CMake project,src/quest/tests/q15t/CMakeLists.txt, with its ownCMakePresets.jsonbeside it (the project is separate fromsrc/quest/CMakeLists.txt, which is Android-only and needs vcpkg).just test-quest-q15t [module]configures, builds and runs ctest; the scripts that built are gone.q15t-host-tests: the host compiler, 82 ctest tests (<module>.<program>, labelled by module,mod_<module>target per module).q15t-ndk-checks: the same project configured with the NDK toolchain file named byQ15T_NDK(the recipe falls back toANDROID_NDK_HOME, the variable the dronekill and dronemuzzle scripts read;Q15T_SKIP_NDK=1skips and says so,Q15T_SKIP_QEMU=1as before). It builds the 14 arm64 objects and the freestanding thunk program; 17 ctest tests.mod/<module>.shbecamemod/<module>.cmake, one per module, included by a glob. The same file holds the module's host programs and its arm64 check, so adding a module is one file.check/arm64_no_static_init.sh,check/dronemuzzle_thunks.sh,check/powerboost_thunk.sh(+ its.wantlisting),check/run_qemu.sh,check/dynamic_symbol.sh.mutants.shno longer compiles: each mutant is a scratch copy ofsrc/, configured with the preset and-DQ15T_PLUGIN_DIR=<copy>, the module'smod_<module>target built, its label run. The arm64 checks are not part of a mutant's verdict (they judge a build, not a rule).-Ddefine; they usesedon a scratch copy (mutants.sh), so the configure variable carries the copy's location instead.run_host_tests.shkept the shared-slice re-exec and the 2 GiB address-space cap (ulimit -v); both are now in the recipe (the re-exec) and around each ctest run (the cap). Thetimeout Nof a script is the test'sTIMEOUTproperty.mod/<m>.shandQ15T_MODULE=<m> bash .../run_host_tests.shnow namemod/<m>.cmakeandjust test-quest-q15t <m>.Search statement
git grep -nE '(^|[[:space:]])(g\+\+|clang\+\+)[[:space:]]' origin/main -- src/quest/tests/q15t | wc -l: 55 lines in 39 files at the base (the issue's 51 inmod/plusrun_host_tests.shand the thunk comment); on this tip: 1 (a comment inpb_thunk_qemu.cpp).git log -S run_host_tests --oneline -- src/quest justfile docs: the script's own history only; no CMake form existed (git grep -n add_test origin/main -- src/quest/plugins/q15treturns nothing, as the issue says).git grep -nE '<the ADR regex>' -- justfile tools .github '*.sh' ':!tools/tests'): no hit injustfilefortest-quest-q15t, none inmutants.sh; one name-only hit incheck/arm64_no_static_init.sh, anechoof the pass linearm64 build of <m>: ok (NDK r26d clang++, no .init_array/.ctors), kept so that the pass line is the one the old run printed. The rest of the V1 list belongs to build(quest): pin the game's NDK (r21b) here and build the combat script libraries with CMake on it #2047, build(quest): the Quest host tests are CMake targets, not g++ lines in recipes #2049, build(quest): quest_patch_libr15 is a CMake target, not a g++ line in a recipe #2050, build(tools): test fixture and probe binaries are CMake targets, not compiled by Python #2051, build: compile checks and test-scripting use presets and targets #2052.Siblings
Shape: a compiler or linker command in a recipe or script.
justfile,test-quest-*(18 other recipes): not this PR, build(quest): the Quest host tests are CMake targets, not g++ lines in recipes #2049.quest-patcher: build(quest): quest_patch_libr15 is a CMake target, not a g++ line in a recipe #2050.test-android,test-scripting,echo-symbols-sync.yml: build: compile checks and test-scripting use presets and targets #2052. Fixture DLLs: build(tools): test fixture and probe binaries are CMake targets, not compiled by Python #2051. Combat libs: build(quest): pin the game's NDK (r21b) here and build the combat script libraries with CMake on it #2047.src/quest/tests/q15t/mutants.d/*.sh(33 files):runmlines only, no compiler; the new test scans them.Symbols
Edited: recipe
test-quest-q15t(justfile);mutants.sh(judge,run,runm); comments naming the old script inhost_test.cpp,host_overrides.h,pb_thunk_qemu.cpp,dronemuzzle_test.cpp,src/quest/plugins/q15t/README.md; 21docs/quest/q15t/modules/*.mdlines.New:
src/quest/tests/q15t/CMakeLists.txt(q15t_host_test,q15t_extra_run,q15t_arm64_object),CMakePresets.json,mod/*.cmake,check/*,tools/tests/test_q15t_host_tests_cmake.py.Removed:
run_host_tests.sh,mod/*.sh(37, incl. the helpermod/pbhud_ndk.sh).Read, not edited:
src/quest/plugins/q15t/CMakeLists.txt(the plugin's own flags, which the arm64 checks repeat),src/quest/CMakePresets.json(untouched, so no conflict with #2049), the test sources.Parity (old recipe on the base, new recipe on this tip; both with the NDK, qemu present)
Old:
just test-quest-q15texit 0, 98 pass lines. New:just test-quest-q15texit 0, ctest100% tests passed out of 82(host) andout of 17(NDK). After replacing addresses, the multiset of pass lines is identical (98 = 98) except two lines that now print through the shared script:dronekill: arm64 compile ok, no .init_arrayanddronemuzzle: arm64 compile ok, no .init_arraybecamearm64 build of dronekill|dronemuzzle: ok (NDK r26d clang++, no .init_array/.ctors).host_testx3 arms,gates_test,library_name_testcore.host_test_0_0,_1_0,_0_1,core.gates_test,core.library_name_testhost_test: all checks pass (hz match90=.., t26=..)x3,gates_test: all checks pass,library_name_test: all checks passmod/<m>.sh, 36 modules<m>.<program>per program run (36mod/*.cmake, e.g.ecfxx3,ecx4 runs + the symbol check,bvhx2,wiringx35)<program>: all checks passed(or: OK,all checks pass) as before.init_arraycheck: decals, plugin_early, hudmeter, instmodel, music, pfx, pfxtev, powerboost, sensorwd, shaderstep, shieldgamma, tablestep, dronekill, dronemuzzle<m>.arm64_<obj>x14arm64 build of <m>: ok ...dronemuzzle.arm64_thunks42 lines of instruction words and relocationspowerboost.arm64_thunk_disassembly,powerboost.pb_thunk_qemumatches the expected 15 instructions and 5 relocations,pb_thunk_qemu: all checks passedFlags per host program are the old command line's (
-std=c++17 -g -O1 -fno-exceptions -fno-rtti -Wall -Wextra -Werror,-I plugin/src -I sdk/include, the same-Ds,-rdynamic,-pthread,-ldl -lpthread). The arm64 objects keep-O2 -fno-exceptions -fno-rtti -fvisibility=hidden -Wall -Wextra -Werrorand add what the NDK toolchain file adds to every compile (-g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security,-fPIC); the plugin's own build gets the same. The old dronekill/dronemuzzle checks looked forinit_arrayonly; all 14 now use the pbhud pattern.init_array|.ctors.Mutants
tools/tests/test_q15t_host_tests_cmake.py), old text put back:mod/aibots.shfrom the base -> FAILtest_the_old_scripts_are_gone;run_host_tests.shfrom the base -> FAILtest_the_old_scripts_are_goneandtest_the_scripts_that_remain_run_no_compiler; ag++ -std=c++17 ...line in the recipe -> FAILtest_the_recipe_runs_cmake_and_ctest_and_no_compiler.mod/peerclamp.cmakeemptied) -> 3 FAIL (test_the_configure_registers_the_tests_the_scripts_ran:peerclamp.peerclamp_testmissing;test_every_test_source_is_compiled_by_a_target:peerclamp_test.cpp;test_a_label_per_module_file).got_swapout ofmod/aibots.cmake) ->cmake --build --target mod_aibotsfails (undefined referenceinimport_hook.cpp,ninja: build stopped).pfx.cpp->pfx.arm64_pfx ***Failed,0% tests passed, 1 tests failed out of 1.no_build_check,hz_never_switch,tick_no_vptr,gate_link_never;peerclamp:pc_stamp_ge,pc_no_key_test,pc_stride;wiring:wire_caps_over_ecfx,wire_drop_ec,tick_cap_ignored;powerboost:pb_no_rollback,pb_take_uncapped): all killed. A no-op mutant (a duplicated#include) reportsSURVIVEDand exit 2, forrunandrunm. Not run: the full mutation run (about an hour).Verification on the tip
All on tip
6f529fef(base618ccf41), innevr-builds.slice, NDK r26d and qemu-aarch64 present:just test-quest-q15t: exit 0; ctest100% tests passed out of 82(host) andout of 17(NDK). Alsojust test-quest-q15t powerboost(1 host + 3 NDK tests, exit 0),Q15T_SKIP_NDK=1 just test-quest-q15t decals(exit 0, prints that the arm64 checks were NOT run), and with no NDK set and no skip: exit 1 with the message namingQ15T_NDK.just test-tools: exit 1,6 failed, 3706 passed, 73 skipped; the 6 are the known failures (test_heavy_guard.pyx5 ids, test: test_heavy_guard fails on main since heavy_guard.py was disabled by an early return #2015;test_agents_budget.py::test_agents_md_is_within_its_line_budget, docs(agents): AGENTS.md states only what binds: no fictional addendum, a generated N-rules index, a line budget #1313). An earlier run on the previous tip also failedtest_naming.py::test_cmake_targets_carry_the_prefix(this PR's targets lackednevr_; fixed by renaming them) andtest_verify_doc_paths(ADR 0041 cited the removed script; fixed: its row, a bullet and the presets sentence).python3 tools/verify_doc_paths.py:doc-paths: OK.python3 tools/verify_gtest_floor.py:runtime GTest declarations=3111 (base ... had 3111).just buildand the PC login test (no PC source, CMake or runtime change),just verify(main only), the full mutation run (about an hour; 12 mutants compared above), a run on a headset.Platform parity: Quest-side host tests only; PC unaffected (not applicable).
Branch lifecycle: deleted when this PR merges or closes.
Read AGENTS.md at 618ccf4