From af45366b5ec1aaaf3f2e5c6ec772131c8721dcea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20=E9=87=91=E5=8F=AF=E6=98=8E?= Date: Mon, 1 May 2023 13:41:10 +0200 Subject: [PATCH] test: remove always echo; echo errors as well --- scripts/run-vader-tests.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/run-vader-tests.sh b/scripts/run-vader-tests.sh index 973cb013..fe8c9d71 100755 --- a/scripts/run-vader-tests.sh +++ b/scripts/run-vader-tests.sh @@ -19,9 +19,9 @@ run_file="$(mktemp)" function filter-vader-output() { local hit_first_vader_line=0 + local force_echo=0 while read -r; do - echo "$REPLY" # Search for the first Vader output line. if ((!hit_first_vader_line)); then if [[ "$REPLY" = *'Starting Vader:'* ]]; then @@ -31,10 +31,18 @@ function filter-vader-output() { fi fi + # If an error occured, make sure to print it. + if [[ "$REPLY" = *'Expected:'* ]]; then + force_echo=1 + elif [[ "$REPLY" =~ \[[A-Z\ ]+\] ]]; then + force_echo=0 + fi + if [[ "$REPLY" =~ \[[A-Z\ ]+\] ]] \ || [[ "$REPLY" = *'Starting Vader:'* ]] \ || [[ "$REPLY" = *'Success/Total'* ]] \ - || [[ "$REPLY" = *'Elapsed time:'* ]] + || [[ "$REPLY" = *'Elapsed time:'* ]] \ + || [[ $force_echo = 1 ]] then echo "$REPLY" fi