From: Per Cederqvist Date: Sun, 18 May 2014 21:59:46 GMT Subject: [GUILT v4 10/33] Run test_failed if the exit status of a test script is bad. Message-ID: <1400450409-30998-11-git-send-email-cederp@opera.com> In-Reply-To: <1400450409-30998-1-git-send-email-cederp@opera.com> There were two problems with the old code: - Since "set -e" is in effect (that is set in scaffold) the run-test script exited immediately if a t-*.sh script failed. This is not nice, as we want the error report that test_failed prints. - The code ran "cd -" between running the t-*.sh script and checking the exit status, so the exit status was lost. (Actually, the exit status was saved in $ERR, but nothing ever looked at $ERR.) Signed-off-by: Per Cederqvist Signed-off-by: Josef 'Jeff' Sipek --- regression/run-tests | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/regression/run-tests b/regression/run-tests index a10e796..8e0af9f 100755 --- a/regression/run-tests +++ b/regression/run-tests @@ -55,11 +55,15 @@ function run_test # run the test cd "$REPODIR" > /dev/null - "$REG_DIR/t-$1.sh" 2>&1 > "$LOGFILE" - ERR=$? + if "$REG_DIR/t-$1.sh" 2>&1 > "$LOGFILE"; then + ERR=false + else + ERR=true + fi + cd - > /dev/null - [ $? -ne 0 ] && test_failed + $ERR && test_failed diff -u "t-$1.out" "$LOGFILE" || test_failed echo "done." -- 1.8.3.1