diff --git a/Tests/break.sh b/Tests/break.sh index 8a4e58c..fd7ec1f 100755 --- a/Tests/break.sh +++ b/Tests/break.sh @@ -104,12 +104,24 @@ for suite in "$@"; do die "no such suite: $suite" fi printf -- '---- %s ----\n' "$name" - if "$run" 2>&1 | tee "$KEEP.out" | grep -E '^\s*\[FAIL\]' | sed 's/^ *//'; then - : - fi - if grep -qE '^[0-9]+ passed, [0-9]+ failed' "$KEEP.out"; then + "$run" > "$KEEP.out" 2>&1 + status=$? + grep -E '^\s*\[FAIL\]' "$KEEP.out" | sed 's/^ *//' + + # THE SUITE'S EXIT STATUS IS THE SIGNAL, not the shape of its last line. This used to + # look for a "N passed, M failed" summary, which is right for the suites that print one + # - they print it only when something failed - and impossible for the three that never + # do. docs, terminal and voyager report in their own words and say so with their exit + # status, so a break they caught loudly was answered with "NOTHING CAUGHT THE BREAK": + # the one wrong answer this tool exists never to give, turning up in a third place. + if [ "$status" -ne 0 ]; then NOTICED=1 - grep -E '^[0-9]+ passed, [0-9]+ failed' "$KEEP.out" | tail -1 + # The count where a suite keeps one, and its own last word where it does not. + if grep -qE '^[0-9]+ passed, [0-9]+ failed' "$KEEP.out"; then + grep -E '^[0-9]+ passed, [0-9]+ failed' "$KEEP.out" | tail -1 + else + tail -1 "$KEEP.out" + fi else printf '%s%s did not notice%s\n' "$RED" "$name" "$RESET" fi