[beast: 26/28] BUILD: taptool.sh: prevent excessive printouts during pipeline failures



commit 51201d62bb2d07826d896b53732d81c8b3e4b95e
Author: Tim Janik <timj gnu org>
Date:   Sat Dec 12 14:03:50 2015 +0100

    BUILD: taptool.sh: prevent excessive printouts during pipeline failures
    
    Signed-off-by: Tim Janik <timj gnu org>

 taptool.sh |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/taptool.sh b/taptool.sh
index 859ca7f..6325df8 100755
--- a/taptool.sh
+++ b/taptool.sh
@@ -108,12 +108,8 @@ check_reference_output() {
 }
 export RAPICORN_OUTPUT_TEST_LOG
 
-# == test invocation ==
-test ! -z "$TEST_NAME" || TEST_NAME="${1#./}"
-printf "%s  START%s    $TEST_NAME: testing...\n" "$color_pass" "$color_reset"
-rm -f "$RAPICORN_OUTPUT_TEST_LOG"
-set +e -o pipefail # catch pipeline errors
-"$@" | {
+# == process and check the test ouput ==
+check_test_output() {
   set -e # catch errors other than the pipeline errors
 
   # == output processing ==
@@ -198,6 +194,13 @@ set +e -o pipefail # catch pipeline errors
   exit 0 # don't clutter "$1" exit status
 }
 
+# == test invocation ==
+test ! -z "$TEST_NAME" || TEST_NAME="${1#./}"
+printf "%s  START%s    $TEST_NAME: testing...\n" "$color_pass" "$color_reset"
+rm -f "$RAPICORN_OUTPUT_TEST_LOG"
+set +e -o pipefail # catch pipeline errors
+"$@" | check_test_output
+
 # check exit status from $1, possible b/c the output-processing exit status is in $TMPFILE,
 # and pipefail then retains the "$1" exit status.
 TEST_EXIT=$?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]