[m-rev.] diff: more fixes to tests/Mmake.common

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Sep 30 15:09:44 AEST 2002


Estimated hours taken: 1
Branches: main

tests/Mmake.common:
	Various bug fixes and improvements:
	- Fix a couple of bugs in stayl's change to add support for .exp4
	  and .exp5 files: it wasn't cleaning up any existing .res4 and
	  .res5 files before doing the comparison, and it wasn't taking
	  the .res4 and .res5 files into account when choosing the smallest
	  diff.
	- Concatenate the FAILED_TEST files from sub-directories into the
	  FAILED_TEST file in the parent directory.

Workspace: /mnt/ceres/home/ceres/fjh/mercury
Index: tests/Mmake.common
===================================================================
RCS file: /home/mercury1/repository/tests/Mmake.common,v
retrieving revision 1.31
diff -u -d -r1.31 Mmake.common
--- tests/Mmake.common	2002/09/24 20:37:39	1.31
+++ tests/Mmake.common	2002/09/30 05:00:17
@@ -98,7 +98,7 @@
 %.res: %.exp %.out
 	@echo "Comparing $*.out with $*.exp*,"
 	@echo "	results in $@"
-	@-rm -f $@ $*.res[1-3]
+	@-rm -f $@ $*.res[1-5]
 	@{ diff $(DIFF_OPTS) $*.exp $*.out > $*.res1 && \
 		echo "Matched $*.exp" && \
 		cp $*.res1 $@; } || \
@@ -118,7 +118,7 @@
 		diff $(DIFF_OPTS) $*.exp5 $*.out > $*.res5 && \
 		echo "Matched $*.exp5" && \
 		cp $*.res5 $@; } || \
-	{ shortest=`wc -l $*.res[1-3] | grep -v total | sort -n | \
+	{ shortest=`wc -l $*.res[1-5] | grep -v total | sort -n | \
 		head -1 | awk '{ print $$2; }' `; \
 		echo "** $*.out did not match the expected output"; \
 		echo "** (closest match was $$shortest)"; \
@@ -204,8 +204,12 @@
 			cat $$subdir/$(ERROR_OUTPUT_FILE) \
 				>> $(ERROR_OUTPUT_FILE); \
 		    fi; \
+		    if [ -f $$subdir/FAILED_TESTS ]; then \
+			sed "s@^@$$subdir/@" $$subdir/FAILED_TESTS \
+				>> FAILED_TESTS; \
+		    fi; \
 		done; \
-		echo SOME TESTS FAILED: see $(ERROR_OUTPUT_FILE); \
+		echo SOME TESTS FAILED: see FAILED_TESTS and $(ERROR_OUTPUT_FILE); \
 		exit 1; \
 	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