Skip to content

build(quest): the q15t host tests are CMake targets, not shell scripts - #2071

Merged
metis-sprock merged 8 commits into
mainfrom
claude-main/2053-q15t-host-tests-cmake
Nov 4, 2026
Merged

metis-sprock merged 8 commits into
mainfrom
claude-main/2053-q15t-host-tests-cmake

Conversation

@metis-sprock

Copy link
Copy Markdown
Contributor

Closes #2053

ADR 0041: the q15t plugin's host tests were compiled by run_host_tests.sh and 37 mod/*.sh scripts. They are now a CMake project, src/quest/tests/q15t/CMakeLists.txt, with its own CMakePresets.json beside it (the project is separate from src/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.

  • Preset q15t-host-tests: the host compiler, 82 ctest tests (<module>.<program>, labelled by module, mod_<module> target per module).
  • Preset q15t-ndk-checks: the same project configured with the NDK toolchain file named by Q15T_NDK (the recipe falls back to ANDROID_NDK_HOME, the variable the dronekill and dronemuzzle scripts read; Q15T_SKIP_NDK=1 skips and says so, Q15T_SKIP_QEMU=1 as before). It builds the 14 arm64 objects and the freestanding thunk program; 17 ctest tests.
  • mod/<module>.sh became mod/<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.
  • Kept as scripts, because they read built output or run a built program (ADR 0041 rule 4): check/arm64_no_static_init.sh, check/dronemuzzle_thunks.sh, check/powerboost_thunk.sh (+ its .want listing), check/run_qemu.sh, check/dynamic_symbol.sh.
  • mutants.sh no longer compiles: each mutant is a scratch copy of src/, configured with the preset and -DQ15T_PLUGIN_DIR=<copy>, the module's mod_<module> target built, its label run. The arm64 checks are not part of a mutant's verdict (they judge a build, not a rule).
  • The issue's Work item 3 says the mutants use a -D define; they use sed on a scratch copy (mutants.sh), so the configure variable carries the copy's location instead.
  • run_host_tests.sh kept 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). The timeout N of a script is the test's TIMEOUT property.
  • Docs that named mod/<m>.sh and Q15T_MODULE=<m> bash .../run_host_tests.sh now name mod/<m>.cmake and just test-quest-q15t <m>.

Search statement

Siblings

Shape: a compiler or linker command in a recipe or script.

Symbols

Edited: recipe test-quest-q15t (justfile); mutants.sh (judge, run, runm); comments naming the old script in host_test.cpp, host_overrides.h, pb_thunk_qemu.cpp, dronemuzzle_test.cpp, src/quest/plugins/q15t/README.md; 21 docs/quest/q15t/modules/*.md lines.
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 helper mod/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-q15t exit 0, 98 pass lines. New: just test-quest-q15t exit 0, ctest 100% tests passed out of 82 (host) and out 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_array and dronemuzzle: arm64 compile ok, no .init_array became arm64 build of dronekill|dronemuzzle: ok (NDK r26d clang++, no .init_array/.ctors).

Old (script) New ctest tests Pass line
host_test x3 arms, gates_test, library_name_test core.host_test_0_0, _1_0, _0_1, core.gates_test, core.library_name_test host_test: all checks pass (hz match90=.., t26=..) x3, gates_test: all checks pass, library_name_test: all checks pass
mod/<m>.sh, 36 modules one <m>.<program> per program run (36 mod/*.cmake, e.g. ecfx x3, ec x4 runs + the symbol check, bvh x2, wiring x35) <program>: all checks passed (or : OK, all checks pass) as before
arm64 compile + .init_array check: decals, plugin_early, hudmeter, instmodel, music, pfx, pfxtev, powerboost, sensorwd, shaderstep, shieldgamma, tablestep, dronekill, dronemuzzle <m>.arm64_<obj> x14 arm64 build of <m>: ok ...
dronemuzzle thunk count (>= 38) dronemuzzle.arm64_thunks 42 lines of instruction words and relocations
powerboost thunk listing diff, qemu run powerboost.arm64_thunk_disassembly, powerboost.pb_thunk_qemu matches the expected 15 instructions and 5 relocations, pb_thunk_qemu: all checks passed

Flags 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 -Werror and 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 for init_array only; all 14 now use the pbhud pattern .init_array|.ctors.

Mutants

  • Check (tools/tests/test_q15t_host_tests_cmake.py), old text put back: mod/aibots.sh from the base -> FAIL test_the_old_scripts_are_gone; run_host_tests.sh from the base -> FAIL test_the_old_scripts_are_gone and test_the_scripts_that_remain_run_no_compiler; a g++ -std=c++17 ... line in the recipe -> FAIL test_the_recipe_runs_cmake_and_ctest_and_no_compiler.
  • Build, target deleted (mod/peerclamp.cmake emptied) -> 3 FAIL (test_the_configure_registers_the_tests_the_scripts_ran: peerclamp.peerclamp_test missing; test_every_test_source_is_compiled_by_a_target: peerclamp_test.cpp; test_a_label_per_module_file).
  • Build, a source dropped from a target (got_swap out of mod/aibots.cmake) -> cmake --build --target mod_aibots fails (undefined reference in import_hook.cpp, ninja: build stopped).
  • NDK check, a static initializer added to a scratch copy of pfx.cpp -> pfx.arm64_pfx ***Failed, 0% tests passed, 1 tests failed out of 1.
  • Mutation harness, same verdicts before and after on 12 mutants (core: 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) reports SURVIVED and exit 2, for run and runm. Not run: the full mutation run (about an hour).
  • Restored tree: the test passes (12 tests, 39 subtests).

Verification on the tip

All on tip 6f529fef (base 618ccf41), in nevr-builds.slice, NDK r26d and qemu-aarch64 present:

  • just test-quest-q15t: exit 0; ctest 100% tests passed out of 82 (host) and out of 17 (NDK). Also just 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 naming Q15T_NDK.
  • just test-tools: exit 1, 6 failed, 3706 passed, 73 skipped; the 6 are the known failures (test_heavy_guard.py x5 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 failed test_naming.py::test_cmake_targets_carry_the_prefix (this PR's targets lacked nevr_; fixed by renaming them) and test_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).
  • Not run: just build and 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

metis-sprock and others added 7 commits November 4, 2026 05:43
#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
@metis-sprock metis-sprock added this to the v6.17.0 milestone Nov 4, 2026
…s, not the removed scripts (#2053)

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
@metis-sprock
metis-sprock merged commit 42f5945 into main Nov 4, 2026
3 checks passed
@metis-sprock
metis-sprock deleted the claude-main/2053-q15t-host-tests-cmake branch November 4, 2026 12:35
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>
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.

build(quest): the q15t host tests are CMake targets, not shell scripts

1 participant