From 5bbef42111b4577d857d556dc00700211f5cc65a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 23 Jul 2022 11:32:16 -0500 Subject: [PATCH] Second attempt to show the diff after the FAIL line instead of before. --- scripts/runtest.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/runtest.sh b/scripts/runtest.sh index 1ca5c579..8b7df985 100644 --- a/scripts/runtest.sh +++ b/scripts/runtest.sh @@ -111,7 +111,7 @@ wrong_args() # Announce success do_pass() { - ! verbose_has nopass && printf "%s\n" "$SHOWPASS: $NAME" + verbose_has nopass || printf "%s\n" "$SHOWPASS: $NAME" } # Announce failure and handle fallout for txpect @@ -154,10 +154,7 @@ testing() [ $RETVAL -gt 128 ] && echo "exited with signal (or returned $RETVAL)" >> actual DIFF="$(diff -au${NOSPACE:+w} expected actual)" - if [ -n "$DIFF" ] - then do_fail - else do_pass - fi + [ -z "$DIFF" ] && do_pass || VERBOSE=all do_fail if ! verbose_has quiet && { [ -n "$DIFF" ] || verbose_has spam; } then [ ! -z "$4" ] && printf "%s\n" "echo -ne \"$4\" > input" -- 2.39.2