Skip to content

Commit 39b4cc5

Browse files
committed
tools/hil: fail serial expect when the UART pattern is missing
- Previously the script always exited 0 after timeout; require a match so board HIL scripts do not false-PASS on incomplete console output
1 parent 55eee32 commit 39b4cc5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tools/hil/hil_serial_expect.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ if [[ -n "${ULMK_HIL_OCD:-}" && -n "${ULMK_HIL_OCD_CFG:-}" ]]; then
6161
>/dev/null 2>&1 || true
6262
fi
6363

64-
wait "$CAP"
64+
wait "$CAP" || true
6565
echo "===== uart ====="
6666
cat "$OUT"
67+
if ! grep -aE "$PATTERN" "$OUT" >/dev/null 2>&1; then
68+
rm -f "$OUT"
69+
echo "FAIL: pattern /$PATTERN/ not found in UART capture" >&2
70+
exit 1
71+
fi
6772
rm -f "$OUT"
73+
echo "PASS: UART matched /$PATTERN/"

0 commit comments

Comments
 (0)