Skip to content

build(quest): the Quest host tests are CMake targets run through presets (#2049) - #2074

Merged
metis-sprock merged 11 commits into
mainfrom
claude-main/2049-quest-host-tests-cmake
Nov 4, 2026
Merged

metis-sprock merged 11 commits into
mainfrom
claude-main/2049-quest-host-tests-cmake

Conversation

@metis-sprock

@metis-sprock metis-sprock commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2049

The 18 test-quest-* recipes that compiled their test programs with g++ lines now configure, build and run them through presets (ADR 0041). git grep -cE 'g\+\+ -std=' -- justfile is 51 on origin/main and 0 here.

What it is

  • src/quest/host_tests/ is the host test project: one target per test program, object libraries where programs share objects, the fixture shared objects, the generated sources of the variant build, ctest tests for what a program can run alone.
  • Presets quest-host-<group> (configure, build, and test where ctest runs it) in src/quest/CMakePresets.json, where the Quest build's presets already are. Each recipe has its own build tree (build/quest-host-<group>), because just verify runs these recipes in parallel and two ninja runs in one tree would corrupt each other. The presets turn on NEVR_QUEST_HOST_TOOLS, the gate the quest-patcher preset added (build(quest): quest_patch_libr15 is a CMake target, not a g++ line in a recipe #2050), plus NEVR_QUEST_HOST_TESTS; src/quest/host/CMakeLists.txt enters host_tests. One host entry, not two.
  • Flags per target are the old lines' (-std=c++17, -Wall -Wextra -Werror, -fno-exceptions, -pthread, sanitizers, -D_GLIBCXX_*, -isystem for the host tree, -Wl,-z,..., build IDs). The preset pins g++ because the compile-fail patterns are GCC's wording.
  • Recipe names, arguments, environment variables and the closing echo lines are kept. The harness steps stay in the recipes and run the built programs by name: certificates and servers (data-net, tls), the store files the -pinned recipes extract, the generator-refusal and extra-rows configure checks of test-quest-hooks, the NDK jni.h step.
  • justfile:1751 from the review (cmake -S ... -B ... in test-quest-hooks) is now cmake --preset quest-host-extra-rows-configure (src/quest/tests/extra_rows_configure/CMakePresets.json).
  • src/quest/cmake/libr15_extra_rows.cmake ran a host g++ through execute_process at configure time. libr15_extra_rows_check is now a target of the host tools (nevr_quest_libr15_extra_rows_check) and the function builds it with cmake --preset quest-patcher and --build --preset quest-patcher --target .... CMake can express it, so no ADR 0041 rule 6 reason is needed.
  • test-quest-patcher runs the nevr_quest_patch_libr15 target of its own tree and no longer needs the quest-patcher recipe first; test-quest-patcher-pinned still runs the tool that recipe built.

Differences a caller can see

  • nlohmann-json comes from the quest-host install (tools/quest-host-deps) in every recipe; the recipes that took it from the PC mingw build no longer need just build first. Every recipe depends on _vcpkg-quest-host.
  • Output dirs are build/quest-host-<group>/<group>/. ctest prints Test command: and timing lines around each program's own output.
  • test-quest-hooks' toast and permission tests are defined when ANDROID_NDK_HOME holds jni.h; the recipe still stops, naming the NDK, when it does not.
  • The issue suggested cache variables for the -pinned recipes' APK paths. They extract the files at run time and run the built program by name, so the target needs no path; the recipes' arguments are unchanged.

Search statement

Siblings

Shape: a compiler or cmake -S/-B line in a recipe or a CMake script.

  • the 18 recipes: fixed here;
  • justfile:1751 cmake -S/-B of the extra-rows configure and libr15_extra_rows.cmake's execute_process compile: fixed here;
  • quest-patcher, test-scripting, test-quest-q15t, build-quest-combat-libs: fixed by their own PRs, merged before this one.

Symbols

Edited: src/quest/CMakeLists.txt (NEVR_QUEST_HOST_TESTS, enable_testing), src/quest/host/CMakeLists.txt, src/quest/CMakePresets.json, src/quest/cmake/libr15_extra_rows.cmake (nevr_libr15_check_extra_rows, nevr_libr15_extra_rows lose their work-dir argument), src/quest/sentinel/CMakeLists.txt and src/quest/tests/extra_rows_configure/CMakeLists.txt (their callers), the 18 recipes and comments in justfile, the six wiring tests that read the hooks and plugins recipes (test_quest_{vk_free_guard,crash_first,menu_version,plugin_default,quit_path,hand_pose_log}_wiring.py). New: src/quest/host_tests/**, tools/tests/test_quest_host_tests_cmake.py.
Read, not edited: every test source and the code they link (no source changed), tools/check_quest_social_frames.sh, test_quest_patcher_cmake.py, test_verify_parallel.py, test_workflows_ndk.py.

Parity, before (origin/main 8f138299 recipes, run in this worktree) and after

Before: all 18 recipes exit 0, logs kept in <scratch>. After: the same 18 exit 0 at the tip. Pinned recipes ran on the store APK r15_goldmaster_store.apk; the apk argument (the signed sentinel APK) was the one in the main checkout's build tree.

recipe programs run before tests after (ctest, +by name) note
test-quest-data 4 4
test-quest-data-net 1 + harness program 0 (2 by name) curl_transport_test, data_wiring_test
test-quest-invite 1 1
test-quest-shared 18 19 + the fixture that clears the sentinel files directory
test-quest-router 6 6
test-quest-invite-transport 1 1
test-quest-tls 1 0 (1 by name) curl_ws_tls_test
test-quest-hooks 43 47 + 4 compile-fail gates (before: an inline loop); unparsable_identity_traps and extra_rows_embedding_is_byte_exact are the old inline checks, renamed (an independent review counted 43 programs at the merge-base, hand_flip_test included)
test-quest-redirect 2 3 + the zPLR frames check (before: inline)
test-quest-hooks-pinned 1 0 (1 by name)
test-quest-patcher 3 5 + scratch fixture setup and cleanup
test-quest-patcher-pinned 1 0 (1 by name)
test-quest-social 4 6 + the frame checker and its negative control (before: inline)
test-quest-social-pinned 2 runs of 1 program 0 (2 by name)
test-quest-integration 3 4 + the dlopen frames check (before: inline)
test-quest-plugins 4 4
test-quest-autopilot 6 7 + scratch directory fixture
test-quest-integration-pinned 1 0 (1 by name)

Built programs: every executable and fixture library the old recipes wrote with -o exists in the new trees (compared per recipe: 0 missing; the extra ones are the fixture libraries the old recipes built in loops and functions). Program output: a line-multiset diff of each old log against its new log, with ctest's framing lines, process ids, timestamps and paths removed, leaves only timing and pid lines (the tls stall and trickle timings, one ui_post tid, the shell's "Illegal instruction" notice).

Mutants

  • M1 one old g++ -std=c++17 ... line put back into test-quest-invite -> FAIL test_quest_host_tests_cmake.py::test_no_recipe_holds_a_compiler_or_linker_command ("test-quest-invite has a compiler command: ' g++ '"). The whole old justfile against the new test: 38 failed (18 recipes x compiler, preset, ctest).
  • M2 cmake --preset quest-host-extra-rows-configure put back as cmake -S . -B ... -> FAIL test_no_recipe_configures_cmake_without_a_preset and test_the_extra_rows_configure_step_has_a_preset_of_its_own.
  • M3 nevr_ht_test(remote_ws_test ...) deleted from groups/router.cmake -> FAIL test_every_program_the_recipes_built_is_a_target_of_the_project (router lists remote_ws_test missing).
  • M4 ws_wire.cpp dropped from loopback_game_server_test -> just test-quest-router exit 1, undefined reference to quest_net::HexEncode....
  • M5 an unused variable appended to ws_wire_test.cpp -> just test-quest-router exit 1, error: unused variable 'unused_mutant' [-Werror=unused-variable] (the warnings are as strict as before).
  • M6 the direct_record compile-fail pattern changed to one the diagnostic does not match -> ctest cf_direct_record_must_not_compile Failed, exit 8.
  • M7 a find_program(NEVR_HOST_CXX ...) and execute_process(COMMAND "${NEVR_HOST_CXX}" ...) appended to libr15_extra_rows.cmake -> FAIL test_the_extra_rows_check_is_a_host_target_built_through_the_preset.
  • Restored tree: test_quest_host_tests_cmake.py 11 passed; all 18 recipes exit 0 (below).
    Lines with no behaviour (comments, the recipes' unchanged echo text) have no mutant.

Evidence on the tip

Run in nevr-builds.slice with DISPLAY and WAYLAND_DISPLAY unset, ANDROID_NDK_HOME and NEVR_STORE_APK set, at b3edbb06 (the tip before the last origin/main merge, which brought in only #2071, the q15t host tests):

Platform parity: not applicable (host test build only). No headline.

Branch lifecycle: deleted when this PR merges or closes.

Merge with main and ADR 0041 (claude-main, before merge)

main was merged in (it brought #2054 and #2071; no conflict). ADR 0041's last open row (#2049) is removed, and the empty table is replaced by a line naming #2065, which tracks the invocations the inventory did not list. On the merged tip: python3 tools/verify_doc_paths.py OK, tools/check_known_wrong.py OK, and the structure, ADR and naming tests (test_quest_host_tests_cmake, test_adr_numbers, test_combat_libs_cmake, test_q15t_host_tests_cmake, test_quest_patcher_cmake, test_naming) 74 passed. The 18 recipes were not re-run after this merge; the independent review ran six of them, and both pinned ones, at f1879ca.

Read AGENTS.md at c1cdb8c

metis-sprock and others added 9 commits November 4, 2026 05:41
…t-host-tests-cmake

* origin/main:
  docs(adr): ADR 0041, native code is built by CMake, not scripts (#2058)
…t for each recipe

src/quest/host_tests builds the host test programs of the test-quest-* recipes as CMake targets (ADR 0041, #2049): one target for
each program, an object library where several programs link the same objects, the fixture shared objects, the generated sources of
the variant build, and ctest tests for what a program can run alone. The quest-host-<group> presets in src/quest/CMakePresets.json
configure it with the host g++ (no NDK) into build/quest-host-<group>, so recipes that run in parallel never share a ninja
directory; their build presets build host-tests-<group> and their test presets run the tests of that label. The extra-rows
configure check gets a preset of its own.

Refs #2049

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
…ost tests through presets

The 18 recipes that compiled test programs with g++ lines (data, data-net, invite, shared, router, invite-transport, tls, hooks,
redirect, hooks-pinned, patcher, patcher-pinned, social, social-pinned, integration, plugins, autopilot, integration-pinned) now run
cmake --preset, cmake --build --preset and ctest --preset of their quest-host-<group> preset. Their names, arguments, environment
variables and printed lines stay. The harness steps (certificates and servers, the store files the -pinned recipes extract, the
extra-rows configure checks, the NDK's jni.h) stay in the recipes and run the built programs by name. nlohmann-json now comes from
the quest-host install in every recipe, and every recipe depends on _vcpkg-quest-host.

tools/tests/test_quest_host_tests_cmake.py pins that those recipes hold no compiler command and no configure without a preset, that
each has its presets, and that every program they built is still a target.

Closes #2049

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
…ython regex

The check carried the ADR's POSIX class and never matched; a g++ line put back into a recipe now fails it.

Refs #2049

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
main added hand_flip_test to the test-quest-hooks recipe while it was moving to presets (#1986).

Refs #2049

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
…ost tests ride the host tools project

The quest-host-* presets turn on NEVR_QUEST_HOST_TOOLS, the gate #2050 added for the quest-patcher preset, and
src/quest/host/CMakeLists.txt enters src/quest/host_tests when NEVR_QUEST_HOST_TESTS is also on; there is one entry into the host
build and not two. The patcher tests run the nevr_quest_patch_libr15 target of their own tree.

The extra-rows check (libr15_extra_rows_check) is a target of the host tools, and cmake/libr15_extra_rows.cmake builds it through
the quest-patcher preset instead of running a host g++ at configure time.

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
…e host-tools reuse

The six wiring tests that looked for a test's compiler line in the test-quest-hooks and test-quest-plugins recipes read
src/quest/host_tests/groups instead. test_quest_host_tests_cmake.py also pins that the host tests ride the host tools project and
that the extra-rows check is a target built through the preset.

Refs #2049

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
…t-host-tests-cmake

* origin/main:
  build(quest): the q15t host tests are CMake targets, not shell scripts (#2071)
metis-sprock and others added 2 commits November 4, 2026 07:00
…t-host-tests-cmake

* origin/main:
  build(quest): pin the game's NDK (r21b) and build the combat script libraries with CMake on it (#2054)
…tory missed (#2049)

Co-Authored-By: claude-main <agents@sprock.io>
Co-Authored-By: Andrew Bates <a@sprock.io>
@metis-sprock
metis-sprock merged commit 00956be into main Nov 4, 2026
4 of 6 checks passed
@metis-sprock
metis-sprock deleted the claude-main/2049-quest-host-tests-cmake branch November 4, 2026 13:01
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 Quest host tests are CMake targets, not g++ lines in recipes

1 participant