From 3fe285f8f8fcff0fd32de4c971400503d72158e0 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 5 Dec 2016 21:06:38 +0100 Subject: [PATCH] Fix some shell issues that would occasionally cause hangs if no tests failed. --- first/testsummary.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/first/testsummary.sh b/first/testsummary.sh index 6301cb977..6c2d3e39a 100755 --- a/first/testsummary.sh +++ b/first/testsummary.sh @@ -3,9 +3,15 @@ echo "" succeeding="$(find "$@" -size 0)" notsucceeding="$(find "$@" ! -size 0)" -skipped="$(grep -l @@SKIPPED $notsucceeding)" -timedout="$(grep -l @@TIMEDOUT $notsucceeding)" -failed="$(grep -l @@FAIL $notsucceeding)" +if [ "$notsucceeding" != "" ]; then + skipped="$(grep -l @@SKIPPED $notsucceeding)" + timedout="$(grep -l @@TIMEDOUT $notsucceeding)" + failed="$(grep -l @@FAIL $notsucceeding)" +else + skipped= + timedout= + failed= +fi for a in $failed $timedout; do echo "**** $a" @@ -13,11 +19,11 @@ for a in $failed $timedout; do echo "" done -echo "$(echo $succeeding | wc -w) tests passed" -echo "$(echo $notsucceeding | wc -w) tests failed to pass" -echo "$(echo $skipped | wc -w) were skipped (see build log for details)" -echo "$(echo $timedout | wc -w) timed out" -echo "$(echo $failed | wc -w) failed" +echo "$(echo "$succeeding" | wc -w) tests passed" +echo "$(echo "$notsucceeding" | wc -w) tests failed to pass" +echo "$(echo "$skipped" | wc -w) were skipped (see build log for details)" +echo "$(echo "$timedout" | wc -w) timed out" +echo "$(echo "$failed" | wc -w) failed" echo "" if [ "$failed" != "" -o "$timedout" != "" ]; then