test(scheduler): aggregate 28 white-box tests into one sched_unit_test

Collapse the 28 zero-#include white-box scheduler tests (whose meson
executable blocks each duplicated the full scheduler_srcs list) into a
single sched_unit_test aggregate, following the controller
controller_test.c precedent: one executable, one process, one runner.

- sched_unit_runner.c: SUITES registry (28 entries) with per-suite
  setUp/tearDown dispatch, -t <suite> filter, UnitySetTestFile per entry
- testsuite/meson.build: runner + 28 test TUs + every scheduler_srcs
  entry except src/main.c as separate TUs; foreach over scheduler_srcs
  so the aggregate can never drift from the production source list;
  all baked-path defines (XCE_SCHED_*_PATH, XCE_SIM_*) move to the
  aggregate's c_args; -Werror=incompatible-pointer-types carried
  suite-wide (verified clean across all 28 tests + 50 src TUs)
- transformed tests drop main()/setUp()/tearDown() and local stubs that
  now resolve against the aggregate's real src TUs
- test() registrations 126 -> 99 (126 - 28 + 1 aggregate); the three
  --wrap= interposition tests (decision publish retry, backpressure,
  decision redelivery) keep their standalone executables unchanged
- isolation libs (sched_core_isolation_lib, sched_sim_isolation_lib)
  stay build-only and are wired as test()-level depends; the nm(1)
  text-scan tests find them via XCE_CORE_LIB_PATH/XCE_SIM_LIB_PATH

Verified: meson test --suite scheduler 100/100 green x3 consecutive
runs (43s total, aggregate 3.3s); /tmp/xce_* sweep clean (the one
leftover is test_worker_launch_type_dispatch.c's by-design fixed-path
fake xrun launcher).

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
lei.chen 2026-10-21 10:39:55 +00:00
parent d167923632
commit a905baf013
30 changed files with 560 additions and 752 deletions

View file

@ -603,9 +603,6 @@ static int dirname_of(const char* path, char* out, size_t out_sz)
return 1;
}
void setUp(void) { return; }
void tearDown(void) { return; }
/* Sanity check: all three source paths baked in by meson.build must
* actually be readable -- without this, a stale path would make every scan
* below silently pass on zero bytes of text (the exact false-confidence
@ -1156,9 +1153,10 @@ static void test_sim_object_has_no_forbidden_undefined_symbols(void)
"vacuously)");
}
int main(void)
/* ---- suite entry for the sched_unit_test aggregate ---------------------- */
void test_sched_sim_isolation(void)
{
UNITY_BEGIN();
UnitySetTestFile(__FILE__);
RUN_TEST(test_sim_source_paths_are_readable);
RUN_TEST(test_sim_never_includes_forbidden_headers);
RUN_TEST(test_sim_never_calls_forbidden_symbols);
@ -1167,5 +1165,4 @@ int main(void)
RUN_TEST(test_trace_enable_is_repl_only);
RUN_TEST(test_sim_driver_struct_has_no_forbidden_fields);
RUN_TEST(test_sim_object_has_no_forbidden_undefined_symbols);
return UNITY_END();
}