From a81f2a249c00b03a2878dd2109aeb1cdb39c537b Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Fri, 17 Jul 2026 14:49:12 +0000 Subject: [PATCH] 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. --- src/controller/testsuite/test_apply_committed_entry.c | 3 +-- src/controller/testsuite/test_apply_correctness_verification.c | 1 + src/controller/testsuite/test_apply_pump.c | 3 +-- src/controller/testsuite/test_apply_pump_integration.c | 3 +-- src/controller/testsuite/test_apply_reapply_idempotency.c | 3 +-- src/controller/testsuite/test_apply_seam.c | 3 +-- src/controller/testsuite/test_cluster_persist.c | 1 + src/controller/testsuite/test_coldstart_lsn0.c | 1 + src/controller/testsuite/test_commit_admission_pool.c | 1 + src/controller/testsuite/test_commit_barrier_reply.c | 3 +-- src/controller/testsuite/test_commit_barrier_rollout.c | 3 +-- src/controller/testsuite/test_commit_durability.c | 1 + src/controller/testsuite/test_commit_engine.c | 3 +-- src/controller/testsuite/test_commit_resolve.c | 1 + src/controller/testsuite/test_config_repl.c | 1 + src/controller/testsuite/test_convergence_verification.c | 1 + src/controller/testsuite/test_ctrl_metrics.c | 1 + src/controller/testsuite/test_ctrlstatus.c | 1 + src/controller/testsuite/test_demotion_convergence.c | 1 + src/controller/testsuite/test_drive_async_config.c | 1 + src/controller/testsuite/test_e2e_capnp.c | 1 + src/controller/testsuite/test_e2e_checkpoint.c | 1 + src/controller/testsuite/test_e2e_gc.c | 1 + src/controller/testsuite/test_e2e_hooks.c | 1 + src/controller/testsuite/test_e2e_wal.c | 1 + src/controller/testsuite/test_egress_filter.c | 1 + src/controller/testsuite/test_gc_retention.c | 1 + src/controller/testsuite/test_ha_bootstrap.c | 1 + src/controller/testsuite/test_ha_cluster.c | 1 + src/controller/testsuite/test_ha_connection_reuse.c | 1 + src/controller/testsuite/test_ha_core_safety.c | 3 +-- src/controller/testsuite/test_ha_ctrlhello.c | 3 +-- src/controller/testsuite/test_ha_dispatch_integration.c | 3 +-- src/controller/testsuite/test_ha_durability.c | 1 + src/controller/testsuite/test_ha_elect_ctx_lifecycle.c | 1 + src/controller/testsuite/test_ha_election.c | 1 + src/controller/testsuite/test_ha_failover.c | 3 +-- src/controller/testsuite/test_ha_failover_prevote.c | 1 + src/controller/testsuite/test_ha_heartbeat_committed.c | 1 + src/controller/testsuite/test_ha_liveness.c | 3 +-- src/controller/testsuite/test_ha_partition.c | 3 +-- src/controller/testsuite/test_ha_prevote.c | 3 +-- src/controller/testsuite/test_ha_rdhup_integration.c | 1 + src/controller/testsuite/test_ha_redirect.c | 1 + src/controller/testsuite/test_ha_repl_push.c | 1 + src/controller/testsuite/test_ha_role.c | 1 + src/controller/testsuite/test_ha_role_lifecycle.c | 1 + src/controller/testsuite/test_ha_start_election_async.c | 1 + src/controller/testsuite/test_ha_startup.c | 1 + src/controller/testsuite/test_ha_vep_teardown.c | 1 + src/controller/testsuite/test_ha_vote_floor_heartbeat.c | 1 + src/controller/testsuite/test_ha_vote_gate.c | 1 + src/controller/testsuite/test_ha_vote_send.c | 1 + src/controller/testsuite/test_hooks.c | 1 + src/controller/testsuite/test_job_array_apply.c | 3 +-- src/controller/testsuite/test_job_array_fence.c | 1 + src/controller/testsuite/test_job_array_replay_fence.c | 1 + src/controller/testsuite/test_join_redirect.c | 1 + src/controller/testsuite/test_p1_integration.c | 1 + src/controller/testsuite/test_p2_integration.c | 1 + src/controller/testsuite/test_p3_hardening.c | 1 + src/controller/testsuite/test_p3_manual_failover.c | 1 + src/controller/testsuite/test_persist_checkpoint.c | 1 + src/controller/testsuite/test_persist_hooks.c | 1 + src/controller/testsuite/test_persist_recovery.c | 1 + src/controller/testsuite/test_persist_repl.c | 1 + src/controller/testsuite/test_persist_schema.c | 1 + src/controller/testsuite/test_persist_snapshot_entities.c | 1 + src/controller/testsuite/test_persist_truncate.c | 3 +-- src/controller/testsuite/test_persist_types.c | 1 + src/controller/testsuite/test_persist_wal.c | 1 + src/controller/testsuite/test_repl_apply.c | 1 + src/controller/testsuite/test_repl_catchup.c | 1 + src/controller/testsuite/test_repl_majority.c | 3 +-- src/controller/testsuite/test_repl_unit.c | 3 +-- src/controller/testsuite/test_replay_apply_seam.c | 1 + src/controller/testsuite/test_slowlane.c | 1 + src/controller/testsuite/test_snapdiff.c | 1 + src/controller/testsuite/test_snapverify.c | 1 + src/controller/testsuite/test_term_safety_adapter.c | 1 + src/controller/testsuite/test_walcompare.c | 1 + src/controller/testsuite/test_waldump.c | 1 + src/controller/testsuite/test_worker_join.c | 1 + 83 files changed, 83 insertions(+), 38 deletions(-) diff --git a/src/controller/testsuite/test_apply_committed_entry.c b/src/controller/testsuite/test_apply_committed_entry.c index e22936a..ce88720 100644 --- a/src/controller/testsuite/test_apply_committed_entry.c +++ b/src/controller/testsuite/test_apply_committed_entry.c @@ -741,7 +741,7 @@ static void test_ace_null_persist_returns_error(void) void test_apply_committed_entry(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_ace_job_submit_constructs_and_notifies); RUN_TEST(test_ace_job_submit_duplicate_is_noop_no_extra_notify); RUN_TEST(test_ace_job_state_transition_applies_forward_and_notifies); @@ -755,5 +755,4 @@ void test_apply_committed_entry(void) RUN_TEST(test_ace_job_array_submit_bulk_insert_failure_fires_hook_for_prefix); #endif RUN_TEST(test_ace_null_persist_returns_error); - UNITY_END(); } diff --git a/src/controller/testsuite/test_apply_correctness_verification.c b/src/controller/testsuite/test_apply_correctness_verification.c index 769139d..6b9cdfd 100644 --- a/src/controller/testsuite/test_apply_correctness_verification.c +++ b/src/controller/testsuite/test_apply_correctness_verification.c @@ -1496,6 +1496,7 @@ static void test_apply_divergent_fence_does_not_survive_a_clean_restart(void) void test_apply_correctness_verification(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_clean_replay_produces_apply_clean_alongside_crc_verdict); RUN_TEST(test_checkpoint_tail_with_no_snapshot_is_apply_clean); RUN_TEST(test_verify_apply_correctness_detects_job_count_mismatch); diff --git a/src/controller/testsuite/test_apply_pump.c b/src/controller/testsuite/test_apply_pump.c index 11a14ae..db910b6 100644 --- a/src/controller/testsuite/test_apply_pump.c +++ b/src/controller/testsuite/test_apply_pump.c @@ -1639,7 +1639,7 @@ static void test_standby_truncate_before_commit_leaves_no_phantom_job(void) void test_apply_pump(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_apply_pump_kick_applies_committed_burst_in_ascending_lsn_order); RUN_TEST(test_apply_pump_run_applies_mixed_submit_and_fact_entries); RUN_TEST(test_apply_pump_run_halts_at_failed_lsn_without_advancing); @@ -1650,5 +1650,4 @@ void test_apply_pump(void) RUN_TEST(test_apply_pump_late_pending_apply_registration_self_heals); RUN_TEST(test_standby_apply_deferred_until_committed_then_materializes); RUN_TEST(test_standby_truncate_before_commit_leaves_no_phantom_job); - UNITY_END(); } diff --git a/src/controller/testsuite/test_apply_pump_integration.c b/src/controller/testsuite/test_apply_pump_integration.c index 26ff014..d0f791f 100644 --- a/src/controller/testsuite/test_apply_pump_integration.c +++ b/src/controller/testsuite/test_apply_pump_integration.c @@ -1353,11 +1353,10 @@ static void test_pump_burst_catchup_real_pool_no_hang_no_double_fire(void) void test_apply_pump_integration(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_pump_command_and_fact_interleave_through_same_commit); RUN_TEST( test_pump_fact_reactions_withheld_during_outage_then_fire_after_restore); RUN_TEST(test_pump_mixed_facts_and_commands_catchup_original_order); RUN_TEST(test_pump_burst_catchup_real_pool_no_hang_no_double_fire); - UNITY_END(); } diff --git a/src/controller/testsuite/test_apply_reapply_idempotency.c b/src/controller/testsuite/test_apply_reapply_idempotency.c index 823c1f9..af7a2f7 100644 --- a/src/controller/testsuite/test_apply_reapply_idempotency.c +++ b/src/controller/testsuite/test_apply_reapply_idempotency.c @@ -374,10 +374,9 @@ test_tari_finish_then_stale_start_preserves_terminal_state_via_dispatch(void) void test_apply_reapply_idempotency(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_tari_job_submit_reapplied_thrice_is_idempotent); RUN_TEST(test_tari_job_state_transition_reapplied_identical_is_idempotent); RUN_TEST( test_tari_finish_then_stale_start_preserves_terminal_state_via_dispatch); - UNITY_END(); } diff --git a/src/controller/testsuite/test_apply_seam.c b/src/controller/testsuite/test_apply_seam.c index d6ddb17..25c6aae 100644 --- a/src/controller/testsuite/test_apply_seam.c +++ b/src/controller/testsuite/test_apply_seam.c @@ -311,7 +311,7 @@ static void test_apply_fail_transition_merges_perr_on_terminal(void) void test_apply_seam(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_apply_start_transition_applies_forward); RUN_TEST(test_apply_start_transition_rejects_backward_on_terminal); RUN_TEST(test_apply_finish_transition_applies_forward); @@ -320,5 +320,4 @@ void test_apply_seam(void) RUN_TEST(test_apply_update_transition_noop_on_duplicate); RUN_TEST(test_apply_update_transition_forward_merge_on_terminal_applies); RUN_TEST(test_apply_fail_transition_merges_perr_on_terminal); - UNITY_END(); } diff --git a/src/controller/testsuite/test_cluster_persist.c b/src/controller/testsuite/test_cluster_persist.c index 95a6cb9..4416c2e 100644 --- a/src/controller/testsuite/test_cluster_persist.c +++ b/src/controller/testsuite/test_cluster_persist.c @@ -132,6 +132,7 @@ static void test_persist_set_workdir_derives_snap_path(void) void test_cluster_persist(void) { + UnitySetTestFile(__FILE__); printf("\n>> cluster persist wiring tests (P0-F)\n\n"); RUN_TEST(test_cluster_t_has_persist_field); diff --git a/src/controller/testsuite/test_coldstart_lsn0.c b/src/controller/testsuite/test_coldstart_lsn0.c index 5ee70fb..a36d05d 100644 --- a/src/controller/testsuite/test_coldstart_lsn0.c +++ b/src/controller/testsuite/test_coldstart_lsn0.c @@ -409,6 +409,7 @@ static void test_h4_control_standby_with_lsn1_gets_only_lsn2(void) void test_coldstart_lsn0(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_h1_first_noop_lsn1_commits); RUN_TEST(test_h2_real_entry_lsn2_commits); RUN_TEST(test_h3_writable_lsn1_gate_effective); diff --git a/src/controller/testsuite/test_commit_admission_pool.c b/src/controller/testsuite/test_commit_admission_pool.c index 8e46bac..83323c1 100644 --- a/src/controller/testsuite/test_commit_admission_pool.c +++ b/src/controller/testsuite/test_commit_admission_pool.c @@ -212,6 +212,7 @@ static void test_commit_local_fallback_cap_preserved(void) void test_commit_admission_pool(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_commit_fold_uses_pool_cap); RUN_TEST(test_commit_local_fallback_cap_preserved); } diff --git a/src/controller/testsuite/test_commit_barrier_reply.c b/src/controller/testsuite/test_commit_barrier_reply.c index 351e2a9..5010fde 100644 --- a/src/controller/testsuite/test_commit_barrier_reply.c +++ b/src/controller/testsuite/test_commit_barrier_reply.c @@ -3299,7 +3299,7 @@ void test_commit_barrier_reply(void) if (makeString((char *)"cbrp-probe") == NULL) xstring_table_init(139); - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); /* do_jobcontrol_op — Req 1.1, 1.2, 1.4 */ RUN_TEST(test_jobctrl_withheld_acks_replies_error); RUN_TEST(test_jobctrl_success_reply_only_after_commit); @@ -3356,5 +3356,4 @@ void test_commit_barrier_reply(void) /* Durable retention held for the outage's sustained duration under * genuine quorum loss (task 4.2, Req 6.1, 6.2) */ RUN_TEST(test_fact_state_unchanged_throughout_quorum_loss_outage); - UNITY_END(); } diff --git a/src/controller/testsuite/test_commit_barrier_rollout.c b/src/controller/testsuite/test_commit_barrier_rollout.c index 01b7aa3..a9860d3 100644 --- a/src/controller/testsuite/test_commit_barrier_rollout.c +++ b/src/controller/testsuite/test_commit_barrier_rollout.c @@ -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(); } diff --git a/src/controller/testsuite/test_commit_durability.c b/src/controller/testsuite/test_commit_durability.c index d609380..3b86fdc 100644 --- a/src/controller/testsuite/test_commit_durability.c +++ b/src/controller/testsuite/test_commit_durability.c @@ -2499,6 +2499,7 @@ static void test_promotion_fence_apply_resource_fenced_survives_structural_catch /* ------------------------------------------------------------------ */ void test_commit_durability(void) { + UnitySetTestFile(__FILE__); #ifdef XCE_TESTING RUN_TEST(test_durable_floor_empty); RUN_TEST(test_durable_floor_after_flush); diff --git a/src/controller/testsuite/test_commit_engine.c b/src/controller/testsuite/test_commit_engine.c index 8d2c005..9cbf07f 100644 --- a/src/controller/testsuite/test_commit_engine.c +++ b/src/controller/testsuite/test_commit_engine.c @@ -1585,7 +1585,7 @@ static void test_sync_append_wired_single_member_commits_locally(void) void test_commit_engine(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_ack_for_lower_lsn_does_not_commit_higher_entry); RUN_TEST(test_ack_at_entry_plus_self_commits_entry); RUN_TEST(test_out_of_order_watermarks_advance_to_majority_median); @@ -1630,5 +1630,4 @@ void test_commit_engine(void) RUN_TEST(test_sync_append_wired_commits_on_per_entry_majority); RUN_TEST(test_sync_append_wired_stale_acks_time_out); RUN_TEST(test_sync_append_wired_single_member_commits_locally); - UNITY_END(); } diff --git a/src/controller/testsuite/test_commit_resolve.c b/src/controller/testsuite/test_commit_resolve.c index b21461b..6954b7f 100644 --- a/src/controller/testsuite/test_commit_resolve.c +++ b/src/controller/testsuite/test_commit_resolve.c @@ -1163,6 +1163,7 @@ static void test_commit_resolve_genuine_two_thread_race_majority_wins_over_timeo void test_commit_resolve(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_commit_submit_async_returns_immediately_before_commit); RUN_TEST(test_commit_submit_async_rejects_invalid_args); RUN_TEST(test_commit_submit_async_respects_admission_cap); diff --git a/src/controller/testsuite/test_config_repl.c b/src/controller/testsuite/test_config_repl.c index eb13cd2..24c6889 100644 --- a/src/controller/testsuite/test_config_repl.c +++ b/src/controller/testsuite/test_config_repl.c @@ -3962,6 +3962,7 @@ extern int handle_ctrlhello(cluster_t *c, endpoint_t *ep, xce_request_t *req); void test_config_repl(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_conf_read_current_filename_missing); RUN_TEST(test_conf_read_current_filename_empty_file); RUN_TEST(test_conf_read_current_filename_path_separator); diff --git a/src/controller/testsuite/test_convergence_verification.c b/src/controller/testsuite/test_convergence_verification.c index aee39a3..ab7834c 100644 --- a/src/controller/testsuite/test_convergence_verification.c +++ b/src/controller/testsuite/test_convergence_verification.c @@ -1434,6 +1434,7 @@ static void test_promotion_refused_when_apply_resource_fenced_even_if_eligible(v void test_convergence_verification(void) { + UnitySetTestFile(__FILE__); #ifdef XCE_TESTING printf("\n>> ACK-driven catch-up continuation tests (RED, task 4.1)\n\n"); diff --git a/src/controller/testsuite/test_ctrl_metrics.c b/src/controller/testsuite/test_ctrl_metrics.c index 2c9f095..4dea833 100644 --- a/src/controller/testsuite/test_ctrl_metrics.c +++ b/src/controller/testsuite/test_ctrl_metrics.c @@ -80,6 +80,7 @@ static void test_transient_jobs_stuck_counter(void) void test_ctrl_metrics(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_metrics_init_zeros_all_counters); RUN_TEST(test_metrics_increment_repl_degraded); RUN_TEST(test_metrics_set_gauge); diff --git a/src/controller/testsuite/test_ctrlstatus.c b/src/controller/testsuite/test_ctrlstatus.c index 32dbf6b..e739e4d 100644 --- a/src/controller/testsuite/test_ctrlstatus.c +++ b/src/controller/testsuite/test_ctrlstatus.c @@ -515,6 +515,7 @@ static void test_ctrlstatus_format_time_ms(void) void test_ctrlstatus(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_ctrlstatus_format_time_ms); RUN_TEST(test_ctrlstatus_primary); RUN_TEST(test_ctrlstatus_standby_known_primary); diff --git a/src/controller/testsuite/test_demotion_convergence.c b/src/controller/testsuite/test_demotion_convergence.c index f5e4756..a821c53 100644 --- a/src/controller/testsuite/test_demotion_convergence.c +++ b/src/controller/testsuite/test_demotion_convergence.c @@ -974,6 +974,7 @@ static void test_ctrlhello_reply_intake_stores_and_reconciles(void) void test_demotion_convergence(void) { + UnitySetTestFile(__FILE__); #ifdef XCE_TESTING printf("\n>> demotion convergence + self-restart tests (RED, task 2.1)\n\n"); diff --git a/src/controller/testsuite/test_drive_async_config.c b/src/controller/testsuite/test_drive_async_config.c index 243ef8b..40d3d3f 100644 --- a/src/controller/testsuite/test_drive_async_config.c +++ b/src/controller/testsuite/test_drive_async_config.c @@ -86,6 +86,7 @@ static void test_liveness_reserved_never_exceeds_vcpus_minus_one(void) void test_drive_async_config(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_liveness_reserved_normal_three_peers); RUN_TEST(test_liveness_reserved_normal_five_peers); RUN_TEST(test_liveness_reserved_floor_single_node); diff --git a/src/controller/testsuite/test_e2e_capnp.c b/src/controller/testsuite/test_e2e_capnp.c index 3514a00..c8f56da 100644 --- a/src/controller/testsuite/test_e2e_capnp.c +++ b/src/controller/testsuite/test_e2e_capnp.c @@ -337,6 +337,7 @@ static void test_data_job_array_variant_round_trip(void) void test_e2e_capnp(void) { + UnitySetTestFile(__FILE__); printf("\n>> P0-15e: Cap'n Proto partial merge semantics\n\n"); RUN_TEST(test_persist_config_capnp_round_trip); diff --git a/src/controller/testsuite/test_e2e_checkpoint.c b/src/controller/testsuite/test_e2e_checkpoint.c index b46fc19..692efb5 100644 --- a/src/controller/testsuite/test_e2e_checkpoint.c +++ b/src/controller/testsuite/test_e2e_checkpoint.c @@ -337,6 +337,7 @@ static void test_trim_without_standbys_proceeds_normally(void) void test_e2e_checkpoint(void) { + UnitySetTestFile(__FILE__); printf("\n>> P0-15b: Checkpoint E2E — round trip\n\n"); RUN_TEST(test_checkpoint_recovery_lsn_continuity); diff --git a/src/controller/testsuite/test_e2e_gc.c b/src/controller/testsuite/test_e2e_gc.c index 311bb33..d59f4fe 100644 --- a/src/controller/testsuite/test_e2e_gc.c +++ b/src/controller/testsuite/test_e2e_gc.c @@ -165,6 +165,7 @@ static void test_checkpoint_gc_removes_expired_entity(void) void test_e2e_gc(void) { + UnitySetTestFile(__FILE__); printf("\n>> P0-15d: GC E2E — retention + transient job cleanup\n\n"); RUN_TEST(test_job_gc_retain_running_job); diff --git a/src/controller/testsuite/test_e2e_hooks.c b/src/controller/testsuite/test_e2e_hooks.c index 74520e7..b713a13 100644 --- a/src/controller/testsuite/test_e2e_hooks.c +++ b/src/controller/testsuite/test_e2e_hooks.c @@ -239,6 +239,7 @@ static void test_hook_sequence_preserves_lsn_order(void) void test_e2e_hooks(void) { + UnitySetTestFile(__FILE__); printf("\n>> P0-15c: Hook E2E — ordering and WAL write\n\n"); RUN_TEST(test_job_hook_writes_wal_before_lsn_advances); diff --git a/src/controller/testsuite/test_e2e_wal.c b/src/controller/testsuite/test_e2e_wal.c index 2d71b1f..5012931 100644 --- a/src/controller/testsuite/test_e2e_wal.c +++ b/src/controller/testsuite/test_e2e_wal.c @@ -261,6 +261,7 @@ static void test_wal_chained_crc_detects_corruption(void) void test_e2e_wal(void) { + UnitySetTestFile(__FILE__); printf("\n>> P0-15a: WAL E2E — torn write + CRC corruption recovery\n\n"); RUN_TEST(test_wal_write_and_verify_entry_count); diff --git a/src/controller/testsuite/test_egress_filter.c b/src/controller/testsuite/test_egress_filter.c index 1f96386..1009133 100644 --- a/src/controller/testsuite/test_egress_filter.c +++ b/src/controller/testsuite/test_egress_filter.c @@ -512,6 +512,7 @@ static void test_uncommitted_job_visible_to_status_path(void) void test_egress_filter(void) { + UnitySetTestFile(__FILE__); printf("\n>> commit-gated scheduler egress tests (GREEN, task 1.2)\n\n"); RUN_TEST(test_live_submit_tags_submit_lsn); diff --git a/src/controller/testsuite/test_gc_retention.c b/src/controller/testsuite/test_gc_retention.c index 5456b42..0c1e804 100644 --- a/src/controller/testsuite/test_gc_retention.c +++ b/src/controller/testsuite/test_gc_retention.c @@ -219,6 +219,7 @@ static void test_worker_unavail_zero_dead_since_always_retained(void) void test_gc_retention(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_running_job_not_terminal); RUN_TEST(test_pending_job_not_terminal); RUN_TEST(test_exit_job_is_terminal); diff --git a/src/controller/testsuite/test_ha_bootstrap.c b/src/controller/testsuite/test_ha_bootstrap.c index f4da32a..1a7924f 100644 --- a/src/controller/testsuite/test_ha_bootstrap.c +++ b/src/controller/testsuite/test_ha_bootstrap.c @@ -452,6 +452,7 @@ static void test_defer_config_fetch_is_false_after_ha_init(void) void test_ha_bootstrap(void) { + UnitySetTestFile(__FILE__); /* Req 3.1 — config_tag != 0: bootstrap returns immediately */ RUN_TEST(test_bootstrap_returns_immediately_when_config_tag_nonzero); diff --git a/src/controller/testsuite/test_ha_cluster.c b/src/controller/testsuite/test_ha_cluster.c index d64d810..74201b9 100644 --- a/src/controller/testsuite/test_ha_cluster.c +++ b/src/controller/testsuite/test_ha_cluster.c @@ -140,6 +140,7 @@ static void test_hooks_registered_guard_prevents_double_register(void) void test_ha_cluster(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_cluster_t_has_ha_field); RUN_TEST(test_ha_promote_to_primary_uses_c_ha); RUN_TEST(test_ha_demote_to_standby_uses_c_ha); diff --git a/src/controller/testsuite/test_ha_connection_reuse.c b/src/controller/testsuite/test_ha_connection_reuse.c index d3c35b2..f514d57 100644 --- a/src/controller/testsuite/test_ha_connection_reuse.c +++ b/src/controller/testsuite/test_ha_connection_reuse.c @@ -491,6 +491,7 @@ static void test_follower_passive_no_outbound_connect(void) void test_ha_connection_reuse(void) { + UnitySetTestFile(__FILE__); /* Req 1.2 — dispatcher routes by role */ RUN_TEST(test_dispatcher_electing_calls_vote_reply_hook); /* test_dispatcher_committing_handles_repl_ack deleted (ha-single-leader-role diff --git a/src/controller/testsuite/test_ha_core_safety.c b/src/controller/testsuite/test_ha_core_safety.c index 35392c1..e8514a5 100644 --- a/src/controller/testsuite/test_ha_core_safety.c +++ b/src/controller/testsuite/test_ha_core_safety.c @@ -2649,7 +2649,7 @@ static void test_6_2_real_senders_never_produce_termblind_shape(void) void test_ha_core_safety(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); /* Task 2.1 payload-aware guard set: * (a) empty-then-full — RED (the smoke-RED below): FAILs on the baseline. * (b) full-then-empty — PIN: must not degrade (baseline-passing). @@ -2740,5 +2740,4 @@ void test_ha_core_safety(void) * above and in ha.c. */ RUN_TEST(test_6_2_restart_preserves_term_identity); RUN_TEST(test_6_2_real_senders_never_produce_termblind_shape); - UNITY_END(); } diff --git a/src/controller/testsuite/test_ha_ctrlhello.c b/src/controller/testsuite/test_ha_ctrlhello.c index f8bce6b..0f7e847 100644 --- a/src/controller/testsuite/test_ha_ctrlhello.c +++ b/src/controller/testsuite/test_ha_ctrlhello.c @@ -119,7 +119,7 @@ static void test_handle_ctrlhello_rejects_null_body(void) /* ── Suite entry point ──────────────────────────────────────────────────── */ void test_ha_ctrlhello(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_ctrl_hello_request_fields_accessible); RUN_TEST(test_ctrl_hello_reply_fields_accessible); RUN_TEST(test_ctrl_hello_req_t_layout); @@ -128,5 +128,4 @@ void test_ha_ctrlhello(void) RUN_TEST(test_request_body_ctrlhellomsg_exists); RUN_TEST(test_handle_ctrlhello_rejects_malformed); RUN_TEST(test_handle_ctrlhello_rejects_null_body); - UNITY_END(); } diff --git a/src/controller/testsuite/test_ha_dispatch_integration.c b/src/controller/testsuite/test_ha_dispatch_integration.c index dbcf559..948f54e 100644 --- a/src/controller/testsuite/test_ha_dispatch_integration.c +++ b/src/controller/testsuite/test_ha_dispatch_integration.c @@ -594,7 +594,7 @@ static void test_p3_cross_endpoint_not_serialized(void) void test_ha_dispatch_integration(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); /* P1 — transfer (lane) does not block cross-endpoint peer control (pool) */ RUN_TEST(test_p1_snapshot_transfer_does_not_block_cross_endpoint); RUN_TEST(test_p1_configpush_transfer_does_not_block_cross_endpoint); @@ -602,5 +602,4 @@ void test_ha_dispatch_integration(void) RUN_TEST(test_p2_ack_runs_under_pool_saturation); /* P3 — cross-endpoint peer control is not serialized */ RUN_TEST(test_p3_cross_endpoint_not_serialized); - UNITY_END(); } diff --git a/src/controller/testsuite/test_ha_durability.c b/src/controller/testsuite/test_ha_durability.c index 2027145..8af88b4 100644 --- a/src/controller/testsuite/test_ha_durability.c +++ b/src/controller/testsuite/test_ha_durability.c @@ -385,6 +385,7 @@ static void test_persist_atomicity_tmp_cleaned_up(void) void test_ha_durability(void) { + UnitySetTestFile(__FILE__); /* Req 9.1: persist writes a correct, CRC-valid file */ RUN_TEST(test_persist_term_writes_file); diff --git a/src/controller/testsuite/test_ha_elect_ctx_lifecycle.c b/src/controller/testsuite/test_ha_elect_ctx_lifecycle.c index 25612e9..489951f 100644 --- a/src/controller/testsuite/test_ha_elect_ctx_lifecycle.c +++ b/src/controller/testsuite/test_ha_elect_ctx_lifecycle.c @@ -251,6 +251,7 @@ static void test_carrier_survives_supersession_with_outstanding_endpoint(void) void test_ha_elect_ctx_lifecycle(void) { + UnitySetTestFile(__FILE__); printf("\n>> ha_elect_ctx_t reference-counted lifecycle tests\n\n"); RUN_TEST(test_release_at_refcount_one_frees_no_crash); diff --git a/src/controller/testsuite/test_ha_election.c b/src/controller/testsuite/test_ha_election.c index 65e5117..d9d1b92 100644 --- a/src/controller/testsuite/test_ha_election.c +++ b/src/controller/testsuite/test_ha_election.c @@ -1220,6 +1220,7 @@ static void test_promotion_never_truncates_own_committed_entries(void) void test_ha_election(void) { + UnitySetTestFile(__FILE__); /* Req 2.1 — quorum victory and defeat */ RUN_TEST(test_quorum_2_of_3_wins_election); RUN_TEST(test_quorum_exactly_majority_wins); diff --git a/src/controller/testsuite/test_ha_failover.c b/src/controller/testsuite/test_ha_failover.c index 8008fa6..065409f 100644 --- a/src/controller/testsuite/test_ha_failover.c +++ b/src/controller/testsuite/test_ha_failover.c @@ -399,7 +399,7 @@ static void test_ha_failover_symbols_exist(void) void test_ha_failover(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_rdhup_closes_and_nulls_fd); RUN_TEST(test_rdhup_transitions_to_ctrl_electing); RUN_TEST(test_heartbeat_received_resets_timeout); @@ -408,5 +408,4 @@ void test_ha_failover(void) RUN_TEST(test_ha_failover_symbols_exist); RUN_TEST(test_rdhup_calls_start_election_async); RUN_TEST(test_rdhup_phase2_done_preserved); - UNITY_END(); } diff --git a/src/controller/testsuite/test_ha_failover_prevote.c b/src/controller/testsuite/test_ha_failover_prevote.c index 4a66ff7..0ca6119 100644 --- a/src/controller/testsuite/test_ha_failover_prevote.c +++ b/src/controller/testsuite/test_ha_failover_prevote.c @@ -356,6 +356,7 @@ static void test_config_less_node_does_not_start_prevote(void) void test_ha_failover_prevote(void) { + UnitySetTestFile(__FILE__); /* Ensure the round LOST/timeout branch never touches a live delaymgr. */ g_rearm_calls = 0; ha_prevote_rearm_liveness_hook = stub_rearm; diff --git a/src/controller/testsuite/test_ha_heartbeat_committed.c b/src/controller/testsuite/test_ha_heartbeat_committed.c index d3db2e2..64dc26a 100644 --- a/src/controller/testsuite/test_ha_heartbeat_committed.c +++ b/src/controller/testsuite/test_ha_heartbeat_committed.c @@ -336,6 +336,7 @@ static void test_consume_null_or_zero_noop(void) void test_ha_heartbeat_committed(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_observe_advances_on_higher); RUN_TEST(test_observe_noop_on_equal_or_lower); RUN_TEST(test_observe_noop_on_zero); diff --git a/src/controller/testsuite/test_ha_liveness.c b/src/controller/testsuite/test_ha_liveness.c index c07baf2..68d051d 100644 --- a/src/controller/testsuite/test_ha_liveness.c +++ b/src/controller/testsuite/test_ha_liveness.c @@ -2309,7 +2309,7 @@ static void test_configpush_offload_dedups(void) void test_ha_liveness(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_liveness_poll_fires_failover_when_timeout); RUN_TEST(test_liveness_poll_rearms_when_fresh); RUN_TEST(test_liveness_poll_cancelled_is_noop); @@ -2353,5 +2353,4 @@ void test_ha_liveness(void) RUN_TEST(test_configpush_offload_runs_on_lane); RUN_TEST(test_configpush_inline_when_flag_off); RUN_TEST(test_configpush_offload_dedups); - UNITY_END(); } diff --git a/src/controller/testsuite/test_ha_partition.c b/src/controller/testsuite/test_ha_partition.c index 3b3cff4..ee6ef71 100644 --- a/src/controller/testsuite/test_ha_partition.c +++ b/src/controller/testsuite/test_ha_partition.c @@ -526,8 +526,7 @@ static void test_partition_soak_offload_RED(void) void test_ha_partition(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_partition_soak_offload_RED); RUN_TEST(test_partition_soak_offload_GREEN); - UNITY_END(); } diff --git a/src/controller/testsuite/test_ha_prevote.c b/src/controller/testsuite/test_ha_prevote.c index 9e633d7..65814e1 100644 --- a/src/controller/testsuite/test_ha_prevote.c +++ b/src/controller/testsuite/test_ha_prevote.c @@ -871,7 +871,7 @@ static void test_lost_round_rearms_then_later_failure_elects(void) void test_ha_prevote(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_prevote_start_no_mutation); RUN_TEST(test_prevote_majority_grant_starts_real_election); RUN_TEST(test_prevote_no_majority_stays_standby_and_rearms); @@ -886,5 +886,4 @@ void test_ha_prevote(void) RUN_TEST(test_genuine_failover_stale_peer_grants_and_elects); RUN_TEST(test_heartbeat_mid_round_clean_reattach); RUN_TEST(test_lost_round_rearms_then_later_failure_elects); - UNITY_END(); } diff --git a/src/controller/testsuite/test_ha_rdhup_integration.c b/src/controller/testsuite/test_ha_rdhup_integration.c index ccf4c76..e199993 100644 --- a/src/controller/testsuite/test_ha_rdhup_integration.c +++ b/src/controller/testsuite/test_ha_rdhup_integration.c @@ -644,6 +644,7 @@ static void test_rdhup_within_cooldown_is_debounced(void) void test_ha_rdhup_integration(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_rdhup_candidate_advertises_freshness_floor_not_stale_committed); RUN_TEST(test_rdhup_within_cooldown_is_debounced); RUN_TEST(test_rdhup_full_path_reaches_primary); diff --git a/src/controller/testsuite/test_ha_redirect.c b/src/controller/testsuite/test_ha_redirect.c index aea2000..f066cce 100644 --- a/src/controller/testsuite/test_ha_redirect.c +++ b/src/controller/testsuite/test_ha_redirect.c @@ -102,6 +102,7 @@ static void test_standby_no_primary_known_when_port_zero(void) void test_ha_redirect(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_primary_does_not_redirect); RUN_TEST(test_standby_redirects_when_primary_known); RUN_TEST(test_standby_no_redirect_when_no_primary_known); diff --git a/src/controller/testsuite/test_ha_repl_push.c b/src/controller/testsuite/test_ha_repl_push.c index 9f3ad40..ce830f9 100644 --- a/src/controller/testsuite/test_ha_repl_push.c +++ b/src/controller/testsuite/test_ha_repl_push.c @@ -303,6 +303,7 @@ static void test_done_posted_prevents_double_push(void) void test_ha_repl_push(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_promotion_calls_ctrlhello_push); RUN_TEST(test_promotion_calls_push_config); RUN_TEST(test_standby_result_does_not_push); diff --git a/src/controller/testsuite/test_ha_role.c b/src/controller/testsuite/test_ha_role.c index 4d77c10..8bd1472 100644 --- a/src/controller/testsuite/test_ha_role.c +++ b/src/controller/testsuite/test_ha_role.c @@ -864,6 +864,7 @@ static void test_dispatch_gate_allows_ctrlstatus_in_every_role(void) void test_ha_role(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_ha_init_default_role_is_standby); RUN_TEST(test_ha_init_rejects_fast_heartbeat); RUN_TEST(test_ha_init_rejects_short_election_timeout); diff --git a/src/controller/testsuite/test_ha_role_lifecycle.c b/src/controller/testsuite/test_ha_role_lifecycle.c index 8640b61..24be531 100644 --- a/src/controller/testsuite/test_ha_role_lifecycle.c +++ b/src/controller/testsuite/test_ha_role_lifecycle.c @@ -1165,6 +1165,7 @@ static void test_legacy_and_raft_promotion_are_symmetric(void) void test_ha_role_lifecycle(void) { + UnitySetTestFile(__FILE__); /* Task 1.1 — WAL_NOOP no-op entry (Req 2.1) */ RUN_TEST(test_noop_append_is_header_only_and_broadcast); RUN_TEST(test_noop_apply_advances_lsn_no_entity_effect); diff --git a/src/controller/testsuite/test_ha_start_election_async.c b/src/controller/testsuite/test_ha_start_election_async.c index a085cc6..6ee8170 100644 --- a/src/controller/testsuite/test_ha_start_election_async.c +++ b/src/controller/testsuite/test_ha_start_election_async.c @@ -197,6 +197,7 @@ static void test_single_node_increments_term(void) void test_ha_start_election_async(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_single_node_returns_quickly); RUN_TEST(test_single_node_stores_n_peers); RUN_TEST(test_single_node_shortcircuit_evaluates_immediately); diff --git a/src/controller/testsuite/test_ha_startup.c b/src/controller/testsuite/test_ha_startup.c index e33b878..1d534aa 100644 --- a/src/controller/testsuite/test_ha_startup.c +++ b/src/controller/testsuite/test_ha_startup.c @@ -775,6 +775,7 @@ static void test_heartbeat_config_invalid_less_than_double(void) void test_ha_startup(void) { + UnitySetTestFile(__FILE__); /* Req 4.1 — even-N peer count */ RUN_TEST(test_peer_count_2_is_invalid); RUN_TEST(test_peer_count_4_is_invalid); diff --git a/src/controller/testsuite/test_ha_vep_teardown.c b/src/controller/testsuite/test_ha_vep_teardown.c index a27f868..f78d83f 100644 --- a/src/controller/testsuite/test_ha_vep_teardown.c +++ b/src/controller/testsuite/test_ha_vep_teardown.c @@ -627,6 +627,7 @@ static void test_vep_self_teardown_does_not_deadlock(void) void test_ha_vep_teardown(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_vep_teardown_runs_after_inflight); RUN_TEST(test_vep_late_event_dropped); RUN_TEST(test_vep_teardown_vtask_disarms_unblock); diff --git a/src/controller/testsuite/test_ha_vote_floor_heartbeat.c b/src/controller/testsuite/test_ha_vote_floor_heartbeat.c index 89d9802..f402ebb 100644 --- a/src/controller/testsuite/test_ha_vote_floor_heartbeat.c +++ b/src/controller/testsuite/test_ha_vote_floor_heartbeat.c @@ -265,6 +265,7 @@ static void test_lower_heartbeat_never_lowers_floor(void) void test_ha_vote_floor_heartbeat(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_heartbeat_raises_vote_floor_to_max); RUN_TEST(test_candidate_below_raised_floor_rejected); RUN_TEST(test_candidate_at_or_above_raised_floor_accepted); diff --git a/src/controller/testsuite/test_ha_vote_gate.c b/src/controller/testsuite/test_ha_vote_gate.c index 0bd55e6..8e5aae2 100644 --- a/src/controller/testsuite/test_ha_vote_gate.c +++ b/src/controller/testsuite/test_ha_vote_gate.c @@ -1117,6 +1117,7 @@ static void test_live_durable_tip_advertised_over_lagging_learned(void) void test_ha_vote_gate(void) { + UnitySetTestFile(__FILE__); /* Req 6.1 — PRIMARY denies */ RUN_TEST(test_primary_role_denies_vote_request); diff --git a/src/controller/testsuite/test_ha_vote_send.c b/src/controller/testsuite/test_ha_vote_send.c index 1155dbc..7de59f9 100644 --- a/src/controller/testsuite/test_ha_vote_send.c +++ b/src/controller/testsuite/test_ha_vote_send.c @@ -658,6 +658,7 @@ static void test_bug1417_middle_index_real_vote_from_peer2_not_dropped(void) void test_ha_vote_send(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_on_vote_connected_calls_hook_with_correct_opcode); RUN_TEST(test_on_vote_connected_encodes_correct_fields); RUN_TEST(test_on_vote_connected_sets_msg_handler); diff --git a/src/controller/testsuite/test_hooks.c b/src/controller/testsuite/test_hooks.c index c8e9fb8..b163748 100644 --- a/src/controller/testsuite/test_hooks.c +++ b/src/controller/testsuite/test_hooks.c @@ -32,6 +32,7 @@ static void test_hook_detail_job_stop_and_resume_are_distinct(void) void test_hooks(void) { + UnitySetTestFile(__FILE__); printf("\n>> hook detail enum tests\n\n"); RUN_TEST(test_hook_detail_job_stop_exists); diff --git a/src/controller/testsuite/test_job_array_apply.c b/src/controller/testsuite/test_job_array_apply.c index fa9edf4..26a4366 100644 --- a/src/controller/testsuite/test_job_array_apply.c +++ b/src/controller/testsuite/test_job_array_apply.c @@ -999,7 +999,7 @@ test_tajd_apply_committed_entry_vs_apply_wal_entry_byte_identical(void) void test_job_array_apply(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_rja_expands_contiguous_set_and_tags_lsn); RUN_TEST(test_rja_expands_contiguous_set_across_sizes); RUN_TEST(test_rja_idempotent_whole_record_replay_is_noop); @@ -1015,5 +1015,4 @@ void test_job_array_apply(void) RUN_TEST(test_tajd_job_ctrl_cancels_array_expanded_element_by_identity); RUN_TEST(test_tajd_apply_wal_entry_constructs_all_and_fires_no_hook); RUN_TEST(test_tajd_apply_committed_entry_vs_apply_wal_entry_byte_identical); - UNITY_END(); } diff --git a/src/controller/testsuite/test_job_array_fence.c b/src/controller/testsuite/test_job_array_fence.c index 59ae7c1..d0a5b6b 100644 --- a/src/controller/testsuite/test_job_array_fence.c +++ b/src/controller/testsuite/test_job_array_fence.c @@ -513,6 +513,7 @@ static void test_job_array_fence_engage_refuse_clear_recover_end_to_end(void) void test_job_array_fence(void) { + UnitySetTestFile(__FILE__); #ifdef XCE_TESTING RUN_TEST(test_job_array_fence_engage_refuse_clear_recover_end_to_end); #else diff --git a/src/controller/testsuite/test_job_array_replay_fence.c b/src/controller/testsuite/test_job_array_replay_fence.c index 979c0de..b4ca11d 100644 --- a/src/controller/testsuite/test_job_array_replay_fence.c +++ b/src/controller/testsuite/test_job_array_replay_fence.c @@ -661,6 +661,7 @@ test_first_boot_promotion_evaluates_own_first_replay_fence(void) void test_job_array_replay_fence(void) { + UnitySetTestFile(__FILE__); #ifdef XCE_TESTING RUN_TEST(test_replay_wal_engages_fence_on_resource_exhaustion_failure); RUN_TEST(test_first_boot_promotion_evaluates_own_first_replay_fence); diff --git a/src/controller/testsuite/test_join_redirect.c b/src/controller/testsuite/test_join_redirect.c index 7cd278b..3175b22 100644 --- a/src/controller/testsuite/test_join_redirect.c +++ b/src/controller/testsuite/test_join_redirect.c @@ -98,6 +98,7 @@ static void test_no_primary_known_yields_nomaster_not_redirect(void) void test_join_redirect(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_redirect_reply_carries_primary_address); RUN_TEST(test_no_primary_known_yields_nomaster_not_redirect); } diff --git a/src/controller/testsuite/test_p1_integration.c b/src/controller/testsuite/test_p1_integration.c index aafd5ce..671bdde 100644 --- a/src/controller/testsuite/test_p1_integration.c +++ b/src/controller/testsuite/test_p1_integration.c @@ -122,6 +122,7 @@ static void test_hooks_registered_guard_integration(void) void test_p1_integration(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_single_node_starts_as_primary); RUN_TEST(test_term_fencing_monotonic); RUN_TEST(test_redirect_guard_integration); diff --git a/src/controller/testsuite/test_p2_integration.c b/src/controller/testsuite/test_p2_integration.c index e869ab9..03a7107 100644 --- a/src/controller/testsuite/test_p2_integration.c +++ b/src/controller/testsuite/test_p2_integration.c @@ -460,6 +460,7 @@ static void test_committed_lsn_advances_after_majority_ack(void) void test_p2_integration(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_repl_broadcast_rejects_checkpoint); RUN_TEST(test_trim_lsn_with_active_standby_at_lsn_5); RUN_TEST(test_checkpoint_does_not_update_replicated_crc); diff --git a/src/controller/testsuite/test_p3_hardening.c b/src/controller/testsuite/test_p3_hardening.c index 22eb61d..25ae23f 100644 --- a/src/controller/testsuite/test_p3_hardening.c +++ b/src/controller/testsuite/test_p3_hardening.c @@ -451,6 +451,7 @@ static void test_p3_gc_recent_done_job_retained(void) void test_p3_hardening(void) { + UnitySetTestFile(__FILE__); printf("\n>> P3-1..P3-5: Integration & Hardening\n\n"); /* P3-1: Failover state machine */ diff --git a/src/controller/testsuite/test_p3_manual_failover.c b/src/controller/testsuite/test_p3_manual_failover.c index 920c72c..e63e5b9 100644 --- a/src/controller/testsuite/test_p3_manual_failover.c +++ b/src/controller/testsuite/test_p3_manual_failover.c @@ -99,6 +99,7 @@ static void test_manual_failover_monotonic_term_across_multiple_cycles(void) void test_p3_manual_failover(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_manual_failover_transitions_role_and_increments_term); RUN_TEST(test_manual_failover_resets_hooks_registered); RUN_TEST(test_manual_failover_monotonic_term_across_multiple_cycles); diff --git a/src/controller/testsuite/test_persist_checkpoint.c b/src/controller/testsuite/test_persist_checkpoint.c index 28305f2..4f1722c 100644 --- a/src/controller/testsuite/test_persist_checkpoint.c +++ b/src/controller/testsuite/test_persist_checkpoint.c @@ -243,6 +243,7 @@ static void test_checkpoint_rotation_keeps_snap_keep_n(void) void test_persist_checkpoint(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_checkpoint_creates_snapshot_file); RUN_TEST(test_checkpoint_sets_checkpoint_lsn); RUN_TEST(test_checkpoint_lsn_tracks_last_applied_not_current_lsn); diff --git a/src/controller/testsuite/test_persist_hooks.c b/src/controller/testsuite/test_persist_hooks.c index 4dc826f..dad9bf5 100644 --- a/src/controller/testsuite/test_persist_hooks.c +++ b/src/controller/testsuite/test_persist_hooks.c @@ -455,6 +455,7 @@ static void test_job_hook_new_writes_multiple_entries_sequentially(void) void test_persist_hooks(void) { + UnitySetTestFile(__FILE__); printf("\n>> persist hook function tests\n\n"); RUN_TEST(test_job_hook_new_writes_wal_entry); diff --git a/src/controller/testsuite/test_persist_recovery.c b/src/controller/testsuite/test_persist_recovery.c index 076ed14..e25c70f 100644 --- a/src/controller/testsuite/test_persist_recovery.c +++ b/src/controller/testsuite/test_persist_recovery.c @@ -388,6 +388,7 @@ static void test_recovered_member_syncs_raft_log_len(void) void test_persist_recovery(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_recover_from_empty_state); RUN_TEST(test_recover_loads_checkpoint_lsn); RUN_TEST(test_recover_replays_wal_after_checkpoint); diff --git a/src/controller/testsuite/test_persist_repl.c b/src/controller/testsuite/test_persist_repl.c index d872ffa..dfed1b7 100644 --- a/src/controller/testsuite/test_persist_repl.c +++ b/src/controller/testsuite/test_persist_repl.c @@ -138,6 +138,7 @@ static void test_last_replicated_crc_not_updated_for_checkpoint(void) void test_persist_repl(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_persist_has_repl_field); RUN_TEST(test_wal_async_no_standbys_succeeds); RUN_TEST(test_wal_sync_no_standbys_returns_enodev_in_sync_rc); diff --git a/src/controller/testsuite/test_persist_schema.c b/src/controller/testsuite/test_persist_schema.c index b04f7d4..e3053f2 100644 --- a/src/controller/testsuite/test_persist_schema.c +++ b/src/controller/testsuite/test_persist_schema.c @@ -99,6 +99,7 @@ static void test_worker_dead_since_field(void) void test_persist_schema(void) { + UnitySetTestFile(__FILE__); printf("\n>> persist Cap'n Proto schema test\n\n"); RUN_TEST(test_persist_config_schema_fields); diff --git a/src/controller/testsuite/test_persist_snapshot_entities.c b/src/controller/testsuite/test_persist_snapshot_entities.c index 5513172..3d04254 100644 --- a/src/controller/testsuite/test_persist_snapshot_entities.c +++ b/src/controller/testsuite/test_persist_snapshot_entities.c @@ -1286,6 +1286,7 @@ static void test_snapent_load_snapshot_legacy_file_reports_position_only(void) void test_persist_snapshot_entities(void) { + UnitySetTestFile(__FILE__); printf("\n>> entity-bearing snapshot fixture tests\n\n"); /* makeJob's deep-copy path (job_init -> makeJobsub -> makeString) needs diff --git a/src/controller/testsuite/test_persist_truncate.c b/src/controller/testsuite/test_persist_truncate.c index ab08b7d..56750a1 100644 --- a/src/controller/testsuite/test_persist_truncate.c +++ b/src/controller/testsuite/test_persist_truncate.c @@ -492,7 +492,7 @@ static void test_truncate_concurrent_burst_resolves_above_cutoff_exactly_once(vo void test_persist_truncate(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_truncate_at_segment_boundary_deletes_segment); RUN_TEST(test_truncate_mid_segment_at_correct_offset); RUN_TEST(test_truncate_idempotent); @@ -501,5 +501,4 @@ void test_persist_truncate(void) RUN_TEST(test_truncate_above_resolves_pending_continuations_as_failed); RUN_TEST(test_truncate_noop_does_not_resolve_pending_continuations); RUN_TEST(test_truncate_concurrent_burst_resolves_above_cutoff_exactly_once); - UNITY_END(); } diff --git a/src/controller/testsuite/test_persist_types.c b/src/controller/testsuite/test_persist_types.c index 8a32772..148e1b9 100644 --- a/src/controller/testsuite/test_persist_types.c +++ b/src/controller/testsuite/test_persist_types.c @@ -59,6 +59,7 @@ static void test_slot_key_t_fields(void) void test_persist_types(void) { + UnitySetTestFile(__FILE__); printf("\n>> persist types test\n\n"); RUN_TEST(test_wal_header_size); diff --git a/src/controller/testsuite/test_persist_wal.c b/src/controller/testsuite/test_persist_wal.c index e07fc4e..ae2cf2c 100644 --- a/src/controller/testsuite/test_persist_wal.c +++ b/src/controller/testsuite/test_persist_wal.c @@ -174,6 +174,7 @@ static void test_persist_config_defaults_max_wal_records(void) void test_persist_wal(void) { + UnitySetTestFile(__FILE__); printf("\n>> persist WAL writer test\n\n"); RUN_TEST(test_persist_init_creates_directories); diff --git a/src/controller/testsuite/test_repl_apply.c b/src/controller/testsuite/test_repl_apply.c index 03668d8..db7792b 100644 --- a/src/controller/testsuite/test_repl_apply.c +++ b/src/controller/testsuite/test_repl_apply.c @@ -535,6 +535,7 @@ static void test_repl_catchup_durable_floor_survives_failover(void) void test_repl_apply(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_apply_wal_entry_advances_lsn); RUN_TEST(test_apply_wal_entry_skips_checkpoint); RUN_TEST(test_apply_wal_entry_rejects_oversized); diff --git a/src/controller/testsuite/test_repl_catchup.c b/src/controller/testsuite/test_repl_catchup.c index 86a2517..2ba6d86 100644 --- a/src/controller/testsuite/test_repl_catchup.c +++ b/src/controller/testsuite/test_repl_catchup.c @@ -124,6 +124,7 @@ static void test_repl_needs_snapshot_standby_within_wal(void) void test_repl_catchup(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_start_catchup_sets_in_catch_up); RUN_TEST(test_complete_catchup_clears_in_catch_up); RUN_TEST(test_wait_ack_excludes_catching_up_standby); diff --git a/src/controller/testsuite/test_repl_majority.c b/src/controller/testsuite/test_repl_majority.c index 6d6d449..f7b8b8b 100644 --- a/src/controller/testsuite/test_repl_majority.c +++ b/src/controller/testsuite/test_repl_majority.c @@ -306,12 +306,11 @@ static void test_broadcast_over_limit_removes_standby(void) void test_repl_majority(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_wait_majority_ack_two_of_three_returns_zero); RUN_TEST(test_wait_majority_ack_stale_acks_time_out); RUN_TEST(test_wait_majority_ack_no_standbys_returns_zero); RUN_TEST(test_wait_majority_ack_catchup_excluded_from_quorum); RUN_TEST(test_wait_majority_ack_ack_op_discriminates); RUN_TEST(test_broadcast_over_limit_removes_standby); - UNITY_END(); } diff --git a/src/controller/testsuite/test_repl_unit.c b/src/controller/testsuite/test_repl_unit.c index ab604c5..0daff18 100644 --- a/src/controller/testsuite/test_repl_unit.c +++ b/src/controller/testsuite/test_repl_unit.c @@ -584,7 +584,7 @@ static void test_repl_registration_lifecycle(void) { } void test_repl_unit(void) { - UNITY_BEGIN(); + UnitySetTestFile(__FILE__); RUN_TEST(test_repl_init_zeroes_nstandbys); RUN_TEST(test_repl_add_remove_standby); RUN_TEST(test_repl_add_standby_max); @@ -608,5 +608,4 @@ void test_repl_unit(void) { RUN_TEST(test_wal_nack_does_not_update_acked_lsn); /* Task 5.3: registration lifecycle — Req 1.1, 1.2, 1.3 */ RUN_TEST(test_repl_registration_lifecycle); - UNITY_END(); } diff --git a/src/controller/testsuite/test_replay_apply_seam.c b/src/controller/testsuite/test_replay_apply_seam.c index 332a832..130eb10 100644 --- a/src/controller/testsuite/test_replay_apply_seam.c +++ b/src/controller/testsuite/test_replay_apply_seam.c @@ -397,5 +397,6 @@ static void test_replay_applies_every_classified_type_via_apply_seam(void) void test_replay_apply_seam(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_replay_applies_every_classified_type_via_apply_seam); } diff --git a/src/controller/testsuite/test_slowlane.c b/src/controller/testsuite/test_slowlane.c index 003184b..3cd20e8 100644 --- a/src/controller/testsuite/test_slowlane.c +++ b/src/controller/testsuite/test_slowlane.c @@ -308,6 +308,7 @@ static void test_fini_on_idle_lane(void) void test_slowlane(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_submit_is_non_blocking); RUN_TEST(test_admission_cap_bounds_concurrency); RUN_TEST(test_submit_returns_eagain_when_cap_full); diff --git a/src/controller/testsuite/test_snapdiff.c b/src/controller/testsuite/test_snapdiff.c index bcb9c19..163eeb6 100644 --- a/src/controller/testsuite/test_snapdiff.c +++ b/src/controller/testsuite/test_snapdiff.c @@ -124,6 +124,7 @@ static void test_missing_path_errors(void) void test_snapdiff(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_identical_files); RUN_TEST(test_size_mismatch); RUN_TEST(test_diff_at_chunk_boundary_is_flagged); diff --git a/src/controller/testsuite/test_snapverify.c b/src/controller/testsuite/test_snapverify.c index 1b54a8a..73b66ad 100644 --- a/src/controller/testsuite/test_snapverify.c +++ b/src/controller/testsuite/test_snapverify.c @@ -219,6 +219,7 @@ static void test_missing_path_errors(void) void test_snapverify(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_legacy_position_only_file_is_ok); RUN_TEST(test_entity_bearing_well_formed_file_is_ok); RUN_TEST(test_bad_magic_is_einval); diff --git a/src/controller/testsuite/test_term_safety_adapter.c b/src/controller/testsuite/test_term_safety_adapter.c index 4529868..2826458 100644 --- a/src/controller/testsuite/test_term_safety_adapter.c +++ b/src/controller/testsuite/test_term_safety_adapter.c @@ -2171,6 +2171,7 @@ static void test_every_callback_and_marker_path_end_to_end(void) void test_term_safety_adapter(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_wal_entry_hdr_size_is_40); RUN_TEST(test_set_term_stamps_append); RUN_TEST(test_recover_mixed_real_and_legacy_terms); diff --git a/src/controller/testsuite/test_walcompare.c b/src/controller/testsuite/test_walcompare.c index 6f81afd..12fb2c7 100644 --- a/src/controller/testsuite/test_walcompare.c +++ b/src/controller/testsuite/test_walcompare.c @@ -629,6 +629,7 @@ static void test_report_uncommitted_tail_classified(void) void test_walcompare(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_identical_members_ok); RUN_TEST(test_same_lsn_diff_term_divergent); RUN_TEST(test_same_lsn_diff_payload_divergent); diff --git a/src/controller/testsuite/test_waldump.c b/src/controller/testsuite/test_waldump.c index 0524f98..cdbc51a 100644 --- a/src/controller/testsuite/test_waldump.c +++ b/src/controller/testsuite/test_waldump.c @@ -285,6 +285,7 @@ static void test_non_wal_file_errors(void) void test_waldump(void) { + UnitySetTestFile(__FILE__); RUN_TEST(test_contiguous_log_has_no_gaps); RUN_TEST(test_missing_prefix_flagged_as_gap); RUN_TEST(test_duplicate_submit_detection); diff --git a/src/controller/testsuite/test_worker_join.c b/src/controller/testsuite/test_worker_join.c index 71b0d7c..08367d1 100644 --- a/src/controller/testsuite/test_worker_join.c +++ b/src/controller/testsuite/test_worker_join.c @@ -514,6 +514,7 @@ static void test_rejoin_worker_preserves_admin_bits(void) void test_worker_join(void) { + UnitySetTestFile(__FILE__); printf("\n>> worker join refactor tests\n\n"); /* xstring_table_init must be called once before any makeString usage */