aboutsummaryrefslogtreecommitdiff
path: root/runtests
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-01-30 13:51:11 -0800
committerMichael Forney <mforney@mforney.org>2020-01-30 13:51:11 -0800
commit3849dd77204177fce2568b5bbace6e400c6a6064 (patch)
tree505703277411562ecb793202c47e089e61092963 /runtests
parent9f5092884474c5a171c422f9131e74765964d62f (diff)
runtests: Count number of failing tests
Diffstat (limited to 'runtests')
-rwxr-xr-xruntests9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtests b/runtests
index 5a8ea89..4b92de6 100755
--- a/runtests
+++ b/runtests
@@ -4,7 +4,7 @@ if [ $# = 0 ] ; then
set -- test/*.c
fi
-exitstatus=0
+numfail=0
out=$(mktemp)
trap 'rm "$out"' EXIT
for test ; do
@@ -12,9 +12,12 @@ for test ; do
result="PASS"
else
result="FAIL"
- exitstatus=1
+ numfail=$((numfail + 1))
fi
echo "[$result] $test" >&2
done
-exit $exitstatus
+if [ "$numfail" -gt 0 ] ; then
+ printf "%d test(s) failed\n" "$numfail"
+ exit 1
+fi