From cee024ac71800bb1eb2a072997f20316bbe9163c Mon Sep 17 00:00:00 2001 From: Aidan Garske Date: Fri, 11 Sep 2026 15:09:06 -0700 Subject: [PATCH 001/440] Factor the target scenario assertions into a shared expect library --- .github/workflows/core-port-split.yml | 3 +- tests/target/lib/expect.sh | 95 +++++++++++++++++++++++++++ tests/target/run_h5_hardware.sh | 18 ++--- tests/target/run_m33mu_scenario.sh | 22 ++----- 4 files changed, 106 insertions(+), 32 deletions(-) create mode 100755 tests/target/lib/expect.sh diff --git a/.github/workflows/core-port-split.yml b/.github/workflows/core-port-split.yml index 9ff7e4e6..f94a297a 100644 --- a/.github/workflows/core-port-split.yml +++ b/.github/workflows/core-port-split.yml @@ -25,11 +25,12 @@ jobs: git config --global --add safe.directory "$GITHUB_WORKSPACE" git config --global url."https://github.com/".insteadOf git@github.com: - - name: Self-test the split and port-only-diff guards + - name: Self-test the guards and the scenario assertion library run: | tools/check-core-port-split.sh --selftest tools/check-port-only-diff.sh --selftest tools/check-docs-no-internal-links.sh --selftest + tests/target/lib/expect.sh --selftest - name: Enforce the core/port split (strict) run: WT_SPLIT_STRICT=1 tools/check-core-port-split.sh diff --git a/tests/target/lib/expect.sh b/tests/target/lib/expect.sh new file mode 100755 index 00000000..ecaed5e3 --- /dev/null +++ b/tests/target/lib/expect.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash +# Assertion helpers shared by the target scenario runners (M33MU, STM32H5, +# QEMU). Source it, then point WT_EXPECT_LOG at the capture file; every helper +# reads it at call time. The Makefile and the suite drivers grep the +# " [check] " lines, so that format is fixed. +# +# WT_EXPECT_LOG= capture file the helpers assert on +# WT_EXPECT_GAP=1 `expect` also accepts the marker with bounded +# interleaved fragments between its words (boards +# where two guests raw-write one UART) +# +# tests/target/lib/expect.sh --selftest + +check_pass() { printf ' [check] PASS %s\n' "$1"; } +check_fail() { printf ' [check] FAIL %s (%s)\n' "$1" "$2"; exit 1; } + +# expect