feat(xce-harness-component): consolidate harness_unit_test binary

Relocate the 13 test files that lived inside controller_unit_test into
src/harness/testsuite/, add a new Unity runner (harness_test.c, modeled
on controller_test.c) carrying their extern/RUN_TEST entries, and
register the new harness_unit_test executable + suite in
src/harness/meson.build with an explicit build-order dependency on
xce_test (two of its tests spawn that binary over a pty).

Finish clearing the controller side: remove test_test_cli.c/
test_xcetest_process_entry.c from controller_unit_test_src and their
extern/RUN_TEST entries from controller_test.c, and remove the
temporary xce_test_controller_link symlink bridge task 1.1 added (no
longer needed now that both binaries build as siblings under harness/).

Verified: harness suite 132 Tests 0 Failures 0 Ignored; controller suite
1199 Tests 0 Failures 0 Ignored. 1199+132=1331 matches the pre-move
controller_unit_test baseline exactly (cross-checked against buglog
bug-1798/bug-1805).

Task 2.1 of xce-harness-component.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
Rongsong Shen 2026-09-14 05:49:31 +00:00
parent 79628f7b2b
commit b5873a67aa
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
18 changed files with 192 additions and 29 deletions

View file

@ -146,8 +146,6 @@ controller_unit_test_src = [
'../harness/walcompare.c',
'../harness/snapverify.c',
'../harness/snapdiff.c',
'testsuite/test_xcetest_process_entry.c',
'testsuite/test_test_cli.c',
'testsuite/test_persist_snapshot_entities.c',
'testsuite/test_apply_seam.c',
'testsuite/test_apply_committed_entry.c',
@ -221,31 +219,9 @@ controller_unit_test = executable('controller_unit_test',
c_args: ['-DXCE_TESTING'],
install: false)
# TEMPORARY (xce-harness-component task 1.1): test_test_cli.c and
# test_xcetest_process_entry.c stay registered in controller_unit_test_src
# above until task 2.1 relocates them into src/harness/testsuite/. Both
# spawn the built xce_test binary as a subprocess via resolve_xce_test_path()
# (test_xcetest_process_entry.c), which finds it by looking in the SAME
# build directory as the running test binary (dirname(/proc/self/exe) +
# "/xce_test") -- an assumption that held when xce_test built into this
# same controller/ build subdir, and breaks now that xce_test builds into
# harness/ instead (task 1.1's whole point). This symlink keeps that
# assumption satisfied without touching either test file, both of which
# are out of this task's boundary -- remove this custom_target and the
# test()'s `depends:` below once task 2.1 physically relocates both files,
# at which point they become genuine build-dir siblings of xce_test again
# (mirroring harness_unit_test's own explicit dependency on the xce_test
# target, per the design's System Flows).
xce_test_controller_link = custom_target('xce_test_controller_link',
output: 'xce_test',
input: xce_test,
command: ['ln', '-sf', '../harness/xce_test', '@OUTPUT0@'],
)
test('controller test', controller_unit_test,
suite: 'controller',
timeout: 300,
depends: [xce_test_controller_link],
env: ['ASAN_OPTIONS=detect_leaks=0'])
# job-array-single-wal-record task 5.1: sched.c's push logic (sched_job_new_fun /