From 65f1e0276664c769326e2a84f1f146e9fe6abea7 Mon Sep 17 00:00:00 2001 From: Jason <83615043+JJassonn69@users.noreply.github.com> Date: Fri, 1 May 2026 10:45:15 +0545 Subject: [PATCH] fix(regression): allow leading whitespace in [PASS]/[FAIL] anchors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three regex sites (run_test, run_mf_cosim, run_doppler_cosim) anchored at column 0 with `^\[PASS|^\[FAIL`, but most TBs emit ` [PASS]` / ` [FAIL]` from `task check;` formatting. Anchors silently matched zero markers, the fallback "did anything reach $finish" path reported PASS, and 48 real failures across tb_system_e2e (×2 modes), tb_fft_engine, and tb_fullchain_realdata went unnoticed across PR-D..G. Switch all three anchors to `^[[:space:]]*\[PASS|^[[:space:]]*\[FAIL`. No RTL change. Surfaces the truth — does not fix the underlying test failures (tracked separately as T-2..T-10 in PR-Tests-1 / PR-I). --- 9_Firmware/9_2_FPGA/run_regression.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/9_Firmware/9_2_FPGA/run_regression.sh b/9_Firmware/9_2_FPGA/run_regression.sh index b449e67..ce1fd9f 100755 --- a/9_Firmware/9_2_FPGA/run_regression.sh +++ b/9_Firmware/9_2_FPGA/run_regression.sh @@ -299,9 +299,9 @@ run_mf_cosim() { output=$(timeout 120 vvp "$vvp" 2>&1) || true rm -f "$vvp" - # Check TB internal pass/fail + # Check TB internal pass/fail (allow leading whitespace; see run_test note) local tb_fail - tb_fail=$(echo "$output" | grep -Ec '^\[FAIL' || true) + tb_fail=$(echo "$output" | grep -Ec '^[[:space:]]*\[FAIL' || true) if [[ "$tb_fail" -gt 0 ]]; then echo -e "${RED}FAIL${NC} (TB internal failure)" ERRORS="$ERRORS\n MF Co-Sim ($name): TB internal failure" @@ -360,9 +360,9 @@ run_doppler_cosim() { output=$(timeout 120 vvp "$vvp" 2>&1) || true rm -f "$vvp" - # Check TB internal pass/fail + # Check TB internal pass/fail (allow leading whitespace; see run_test note) local tb_fail - tb_fail=$(echo "$output" | grep -Ec '^\[FAIL' || true) + tb_fail=$(echo "$output" | grep -Ec '^[[:space:]]*\[FAIL' || true) if [[ "$tb_fail" -gt 0 ]]; then echo -e "${RED}FAIL${NC} (TB internal failure)" ERRORS="$ERRORS\n Doppler Co-Sim ($name): TB internal failure" @@ -427,9 +427,12 @@ run_test() { # informational tags like `[FAIL-INFO]` (used for known unrelated bugs, # e.g. RX-NEW-1 fft_engine bin-shift in tb_matched_filter_processing_chain.v) # which would otherwise false-fire as real failures. + # Allow leading whitespace — many TBs emit " [PASS]" with indentation + # (the historical anchor `^[PASS]` silently missed those, hiding 22+ + # failures across tb_system_e2e / tb_fft_engine / tb_fullchain_realdata). local test_pass test_fail - test_pass=$(echo "$output" | grep -Ec '^\[PASS( [0-9]+)?\]' || true) - test_fail=$(echo "$output" | grep -Ec '^\[FAIL( [0-9]+)?\]' || true) + test_pass=$(echo "$output" | grep -Ec '^[[:space:]]*\[PASS( [0-9]+)?\]' || true) + test_fail=$(echo "$output" | grep -Ec '^[[:space:]]*\[FAIL( [0-9]+)?\]' || true) if [[ "$test_fail" -gt 0 ]]; then echo -e "${RED}FAIL${NC} (pass=$test_pass, fail=$test_fail)"