[GUILT v4 10/33] Run test_failed if the exit status of a test script is bad.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <cederp@xxxxxxxxx>
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@xxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]