diff options
author | Adrian Thurston <thurston@colm.net> | 2019-12-18 16:26:26 +0200 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2019-12-18 16:26:26 +0200 |
commit | fdc9ccb6f104b720a1966ebfe1003f9c8f7939e8 (patch) | |
tree | 85d09bc1fde92dcaaf1e62593ba268fb2871a0ce /test | |
parent | bbc59ba03d04a133e4b0c84470568fb7c338ada5 (diff) | |
download | colm-fdc9ccb6f104b720a1966ebfe1003f9c8f7939e8.tar.gz |
testing: propagate internal and test case failures to exit status
Diffstat (limited to 'test')
-rwxr-xr-x | test/runtests | 1 | ||||
-rwxr-xr-x | test/timed | 29 |
2 files changed, 24 insertions, 6 deletions
diff --git a/test/runtests b/test/runtests index 62447636..7c075b25 100755 --- a/test/runtests +++ b/test/runtests @@ -1,4 +1,3 @@ #!/bin/bash time bash $(dirname $0)/timed "$@" - @@ -31,15 +31,34 @@ for D in $DIRS; do cd $OLDPWD done -echo ---- cases -find $WORKING -name '*.sh' -not -size 0 | wc -l +CASES=`find $WORKING -name '*.sh' -not -size 0 | wc -l` +FAILURES=`find $WORKING -name '*.diff' -not -size 0 | wc -l` +echo ---- cases +echo $CASES echo ---- failures -find $WORKING -name '*.diff' -not -size 0 | wc -l +echo $FAILURES + +INTERNAL_ERRORS="" if [ -s $GENTEST_LOG ]; then - echo ---- errors + echo ---- internal errors cat $GENTEST_LOG fi -rm $GENTEST_LOG +if test -s $GENTEST_LOG; then + INTERNAL_ERRORS="yes" +fi + +rm -f $GENTEST_LOG + +# +# Exit with 1 if runtests experienced some internal error. Exit with 2 if a +# test failed. Otherwise 0. +# + +if [ "$INTERNAL_ERRORS" = yes ]; then + exit 1; +elif [ "$FAILURES" != "0" ]; then + exit 2 +fi |