[m-rev.] diff: test_mercury: improve failed tests summary

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Oct 20 19:30:31 AEST 2002


Estimated hours taken: 0.25
Branches: main

Improve the summaries of which test cases failed in the nightly tests.

tools/test_mercury:
	- Don't create the ".test_errs" file until there is something
	  to put in it.
	- Generate a ".failed_tests" file in the logs directory
	  containing just the "FAILED TEST <foo> in grade <bar>" lines
	  from the ".test_errs" file.
	- Put the contents of the ".failed_tests" file at the start
	  of the "mercury-failed-tests*.txt" file, as a summary.

Workspace: /home/ceres/fjh/mercury
Index: tools/test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.212
diff -u -d -r1.212 test_mercury
--- tools/test_mercury	20 Oct 2002 06:20:30 -0000	1.212
+++ tools/test_mercury	20 Oct 2002 09:25:45 -0000
@@ -142,12 +142,15 @@
 esac
 case "$C_COMPILER" in
 	gcc)	TEST_ID=$BRANCH.$HOST
-        	TEST_ERROR_FILE="$TESTDIR/logs/test-$BRANCH-$HOST.test_errs" ;;
+        	TEST_ERROR_FILE="$TESTDIR/logs/test-$BRANCH-$HOST.test_errs"
+        	FAILED_TESTS_FILE="$TESTDIR/logs/test-$BRANCH-$HOST.failed_tests"
+		;;
 	*)	TEST_ID=$BRANCH.$HOST.$C_COMPILER
-		TEST_ERROR_FILE="$TESTDIR/logs/test-$BRANCH-$HOST-$C_COMPILER.test_errs" ;;
+		TEST_ERROR_FILE="$TESTDIR/logs/test-$BRANCH-$HOST-$C_COMPILER.test_errs"
+		FAILED_TESTS_FILE="$TESTDIR/logs/test-$BRANCH-$HOST-$C_COMPILER.failed_tests"
+		;;
 esac
-rm -f $TEST_ERROR_FILE
-touch $TEST_ERROR_FILE
+rm -f $TEST_ERROR_FILE $FAILED_TESTS_FILE
 
 #-----------------------------------------------------------------------------#
 
@@ -837,6 +840,7 @@
 			$PARALLEL runtests || \
 			set_status "tests in grade $grade"
 		if [ -f runtests.errs ]; then
+			touch $TEST_ERROR_FILE
 			cat runtests.errs >> $TEST_ERROR_FILE
 		fi
 		;;
@@ -898,12 +902,16 @@
 			EXTRA_MLFLAGS="$TEST_MLFLAGS" \
 			$PARALLEL runtests
 		if [ -f runtests.errs ]; then
+			touch $TEST_ERROR_FILE
 			cat runtest.errs >> $TEST_ERROR_FILE
 		fi
 		;;
 	esac
 	;;
 esac
+if [ -s $TEST_ERROR_FILE ]; then
+	fgrep "FAILED TEST" $TEST_ERROR_FILE > $FAILED_TESTS_FILE
+fi
 echo "test_mercury finished tests at `date`" 1>&2
 
 cd ..
@@ -914,8 +922,12 @@
 
 case $HOST in $ROTD_HOST)
 	if [ -s $TEST_ERROR_FILE ]; then
-		cp $TEST_ERROR_FILE \
-			$UNSTABLE/mercury-test-failures-$version-unstable.txt
+		{ cat $FAILED_TESTS_FILE;
+		  echo "";
+		  echo "Test logs for the failed test cases:";
+		  echo "";
+		  cat $TEST_ERROR_FILE;
+		} > $UNSTABLE/mercury-test-failures-$version-unstable.txt
 	else 
 		rm -f $UNSTABLE/mercury-test-failures-$version-unstable.txt
 	fi &&
@@ -1023,8 +1035,12 @@
 	cp mercury/bindist/bindist.INSTALL \
 		$UNSTABLE/mercury-INSTALL-$version.$fullname.txt &&
 	if [ -s $TEST_ERROR_FILE ]; then
-		cp $TEST_ERROR_FILE \
-			$UNSTABLE/mercury-test-failures-$version.$fullname.txt
+		{ cat $FAILED_TESTS_FILE;
+		  echo "";
+		  echo "Test logs for the failed test cases:";
+		  echo "";
+		  cat $TEST_ERROR_FILE;
+		} > $UNSTABLE/mercury-test-failures-$version.$fullname.txt
 	else 
 		rm -f $UNSTABLE/mercury-test-failures-$version.$fullname.txt
 	fi &&

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list