fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide

Only 21 of 86 test_*.c group functions called their own nested
UNITY_BEGIN()/UNITY_END(). Each nested call reset Unity's global
NumberOfTests/TestFailures counters, so controller_test.c's final
`return UNITY_END();` -- the value meson test actually gates on --
only ever reflected whichever small window of tests ran since the
LAST nested reset, silently discarding pass/fail evidence for
everything before it (measured: 16 of 972 total tests in one run).
The same nested-BEGIN calls also caused PASS/FAIL banners to show
the wrong source file for tests in files that don't reset it
themselves (Unity.TestFile just carries over from whichever group
last called UNITY_BEGIN()).

Fix: replace every nested UNITY_BEGIN() with UnitySetTestFile(__FILE__)
(sets file attribution only, no counter reset) and drop the matching
UNITY_END(); add the same UnitySetTestFile(__FILE__) as the first
statement to the other group functions that had neither. The 2
genuinely standalone binaries (test_job_array_sched_push.c,
test_job_array_apiserver_push.c -- each has its own int main(), not
registered via controller_test.c's TEST() macro) are untouched.

Verified: single consolidated summary now reads
"972 Tests 0 Failures 0 Ignored OK", exactly matching the
ground-truth RUN_TEST call-site count across all 83 registered
group files (976 total minus 4 belonging to the 2 standalone
binaries). Every PASS/FAIL banner now names its own true source
file. Full xce-build.sh all regression pass clean (Ok: 9, Fail: 0).

No production code touched -- test-harness plumbing only.
This commit is contained in:
Rongsong Shen 2026-07-17 14:49:12 +00:00
parent e6956ecf46
commit a81f2a249c
83 changed files with 83 additions and 38 deletions

View file

@ -2317,7 +2317,7 @@ static void test_job_submit_single_payload_wal_type_matches_pre_feature_baseline
void test_commit_barrier_rollout(void)
{
UNITY_BEGIN();
UnitySetTestFile(__FILE__);
/* Task 1.1 — classification totality + RETAIN routing (Req 2.1, 2.2, 3.1) */
RUN_TEST(test_classify_job_submit_is_wait);
RUN_TEST(test_classify_job_array_submit_is_wait);
@ -2366,5 +2366,4 @@ void test_commit_barrier_rollout(void)
RUN_TEST(test_job_array_submit_one_entry_one_continuation_across_sizes);
RUN_TEST(test_job_array_submit_payload_size_bounded_at_max_array_idx);
RUN_TEST(test_job_submit_single_payload_wal_type_matches_pre_feature_baseline);
UNITY_END();
}