TestScript ignores exit codes

Pavel Roskin pavel_roskin at geocities.com
Fri Jan 28 07:32:44 PST 2000


Hello!

"make check" doesn't detect that some tests return 1 on exit. The code in 
test/regression/TestScript doesn't work as it should (tested on LinuxPCC,
bash-2.03).

My modified version uses a much more robust way to detect non-zero exit
codes. Creating an additional file doesn't seem to slow down the tests.

It is a good idea to retest TestNative on all platforms after applying
this patch, since its errors were silently ignored.

ChangeLog:
	test/regression/TestScript.in (run): fixed exit code analyzis

Pavel Roskin

=== cut here ===
--- test/regression/TestScript.in	Fri Jan 14 04:30:45 2000
+++ test/regression/TestScript.in	Fri Jan 28 10:10:32 2000
@@ -64,14 +64,18 @@
 run()
 {
 	RESULT="$1.fail"
+	TMPRESULT="$1.tmp"
 	$VERBOSE $JAVA $*
+	$JAVA $* >$TMPRESULT 2>&1
+	error=$?
 	if test "x$SORT" = "xyes"; then
 	    # grep will take care of stripping \r from DOS-like output
-	    { $JAVA $* 2>&1; error=$?; } | sort | grep '.*' > $RESULT
+	    sort $TMPRESULT | grep '.*' > $RESULT
 	else
 	    # grep will take care of stripping \r from DOS-like output
-	    { $JAVA $* 2>&1; error=$?; } | grep '.*' > "$RESULT"
+	    grep '.*' $TMPRESULT > "$RESULT"
 	fi
+	rm -f $TMPRESULT
 	if test ! -f "$1.out"; then
 		if test "$error" = 0 || test "$error" = 77; then
 		    mv "$RESULT" "$1.out"
=== cut here ===




More information about the kaffe mailing list