feat(xce-harness-component): relocate the four standalone test binaries
Move test_resval_typeresolve.c, test_joblist_display.c, test_join_worker_args.c, and test_listrow_json.c into src/harness/testsuite/, and re-create their executable()/test() blocks verbatim in src/harness/meson.build under suite 'harness' (task 1.1 had already fully deleted them from src/controller/meson.build, not just moved them, so these had been orphaned on disk since that commit). Fix test_joblist_display.c's ctrlstatus_fmt.h include path to the xce/ location promoted in task 1.2. Verified against the pre-task-1.1 baseline (git show cf55d691^): all four blocks' source lists, c_args, and env are faithfully reproduced, only paths and the suite tag changed. harness suite: 5 binaries, all green (resval_typeresolve 4, joblist_display 20, join_worker_args 5, listrow_json 12, harness_unit_test 132 -- 173 total, 0 failures). controller suite unchanged: 1199 Tests 0 Failures 0 Ignored. This completes Major Task 2 (Core) -- the harness component now owns all 5 of its test binaries independently of the controller build. Task 2.2 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:
parent
b5873a67aa
commit
49cf25aa23
6 changed files with 114 additions and 2 deletions
|
|
@ -125,3 +125,114 @@ test('harness unit test', harness_unit_test,
|
|||
timeout: 300,
|
||||
depends: [xce_test],
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
||||
# xce-harness-component task 2.2: the four already-standalone harness test
|
||||
# binaries, relocated verbatim from src/controller/meson.build (see git
|
||||
# history prior to xce-harness-component task 1.1 for their original
|
||||
# definitions) -- only their include_directories/dependencies source
|
||||
# (controller_unit_test_deps -> harness_unit_test_deps, both declared above)
|
||||
# and suite tag ('controller' -> 'harness') change. Each remains its own
|
||||
# self-contained 2-3 file executable()/test() pair with no shared runner,
|
||||
# per design.md's Harness Unit-Test Suite section.
|
||||
|
||||
# resource-value-verification task 1.1: resval_typeresolve.c is a small,
|
||||
# dependency-light module (no networking/REPL/global state) extracted from
|
||||
# test.c's set_resval() specifically so its name -> Value_u_which resolution
|
||||
# logic can be unit-tested in isolation -- test.c itself (4298 lines, its own
|
||||
# main(), heavy libedit/network dependencies) cannot be white-box included
|
||||
# into a Unity test. Standalone binary since it has zero dependency on
|
||||
# controller-internal state.
|
||||
resval_typeresolve_unit_test_src = [
|
||||
'testsuite/test_resval_typeresolve.c',
|
||||
'resval_typeresolve.c',
|
||||
]
|
||||
|
||||
resval_typeresolve_unit_test = executable('resval_typeresolve_unit_test',
|
||||
resval_typeresolve_unit_test_src,
|
||||
include_directories: [incdir],
|
||||
dependencies: harness_unit_test_deps,
|
||||
c_args: ['-DXCE_TESTING'],
|
||||
install: false)
|
||||
|
||||
test('resval typeresolve test', resval_typeresolve_unit_test,
|
||||
suite: 'harness',
|
||||
timeout: 60,
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
||||
# xce-test-cli-ux task 2.5 remediation: joblist_display.c is a small,
|
||||
# dependency-light module (no networking/REPL/global state) extracted from
|
||||
# test.c's worker_status_str()/job_state_str()/format_job_time() specifically
|
||||
# so their bug-1711 display-formatting fixes can be unit-tested in isolation
|
||||
# -- test.c itself cannot be white-box included into a Unity test, same
|
||||
# rationale as resval_typeresolve_unit_test above. Standalone binary since it
|
||||
# has zero dependency on controller-internal state.
|
||||
joblist_display_unit_test_src = [
|
||||
'testsuite/test_joblist_display.c',
|
||||
'joblist_display.c',
|
||||
]
|
||||
|
||||
joblist_display_unit_test = executable('joblist_display_unit_test',
|
||||
joblist_display_unit_test_src,
|
||||
include_directories: [incdir],
|
||||
dependencies: harness_unit_test_deps,
|
||||
c_args: ['-DXCE_TESTING'],
|
||||
install: false)
|
||||
|
||||
test('joblist display test', joblist_display_unit_test,
|
||||
suite: 'harness',
|
||||
timeout: 60,
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
||||
# xce-test-cli-ux task 2.6 remediation: join_worker_args.c is a small,
|
||||
# dependency-light module (no networking/REPL/global state) extracted from
|
||||
# test.c's cmd_join_worker() specifically so the bug-1557 maxmem-default fix
|
||||
# can be unit-tested in isolation -- test.c itself cannot be white-box
|
||||
# included into a Unity test, same rationale as joblist_display_unit_test/
|
||||
# resval_typeresolve_unit_test above. Standalone binary since it has zero
|
||||
# dependency on controller-internal state.
|
||||
join_worker_args_unit_test_src = [
|
||||
'testsuite/test_join_worker_args.c',
|
||||
'join_worker_args.c',
|
||||
'flagspec.c', # xce-test-cli-ux task 3.1: join_worker_parse_attrs
|
||||
# migrated onto flagspec_build_opts/flagspec_reject
|
||||
]
|
||||
|
||||
join_worker_args_unit_test = executable('join_worker_args_unit_test',
|
||||
join_worker_args_unit_test_src,
|
||||
include_directories: [incdir],
|
||||
dependencies: harness_unit_test_deps,
|
||||
c_args: ['-DXCE_TESTING'],
|
||||
install: false)
|
||||
|
||||
test('join worker args test', join_worker_args_unit_test,
|
||||
suite: 'harness',
|
||||
timeout: 60,
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
||||
# xce-test-cli-ux task 3.4: listrow_json.c is a small, dependency-light
|
||||
# module (no networking/REPL/global state) extracted from cmd_reslist/
|
||||
# cmd_workerlist/joblist_query specifically so their new --json output
|
||||
# mode's per-command field-mapping logic can be unit-tested in isolation
|
||||
# -- test.c itself cannot be white-box included into a Unity test, same
|
||||
# rationale as joblist_display_unit_test/resval_typeresolve_unit_test
|
||||
# above. Standalone binary mirroring those tests' own standalone-binary
|
||||
# rationale. Links listfmt_json.c directly (not struct2json_dep alone)
|
||||
# since listrow_json.c calls its add_string()/add_number()/new_row()
|
||||
# helpers.
|
||||
listrow_json_unit_test_src = [
|
||||
'testsuite/test_listrow_json.c',
|
||||
'listrow_json.c',
|
||||
'listfmt_json.c',
|
||||
]
|
||||
|
||||
listrow_json_unit_test = executable('listrow_json_unit_test',
|
||||
listrow_json_unit_test_src,
|
||||
include_directories: [incdir],
|
||||
dependencies: harness_unit_test_deps,
|
||||
c_args: ['-DXCE_TESTING'],
|
||||
install: false)
|
||||
|
||||
test('listrow json test', listrow_json_unit_test,
|
||||
suite: 'harness',
|
||||
timeout: 60,
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <unity/unity.h>
|
||||
|
||||
#include "ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms -- used directly
|
||||
#include "xce/ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms -- used directly
|
||||
* below to prove format_job_time() genuinely
|
||||
* delegates to it (byte-identical output),
|
||||
* rather than a parallel reimplementation that
|
||||
Loading…
Add table
Add a link
Reference in a new issue