From: Andrew Tridgell Date: Thu, 27 Jan 2000 04:54:02 +0000 (+0000) Subject: report exit code when failing a test X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/bd36966bed1d14461557973f91adf4f29bc92c08 report exit code when failing a test --- diff --git a/test.sh b/test.sh index 1717f4a5..792bb677 100755 --- a/test.sh +++ b/test.sh @@ -67,8 +67,11 @@ checkit() { failed= echo "Running: \"$1\"" >${log} echo "">>${log} - eval "$1 || failed=YES" >>${log} 2>&1 - + eval "$1" >>${log} 2>&1 + status=$? + if [ $status != 0 ]; then + failed="YES"; + fi echo "-------------">>${log} echo "check how the files compare with diff:">>${log} echo "">>${log} @@ -88,7 +91,7 @@ checkit() { cat ${log} rm ${log} else - echo " FAILED (test # ${testnum})." + echo " FAILED (test # ${testnum} status=$status)." fi return 1 fi