[m-rev.] for post-commit review: avoid infinite loop in hl.gc bootchecks

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Aug 31 09:11:34 AEST 2009


tests/tabling/Mmakefile:
	Avoid infinite loops in grades (such as hl.gc) that do not support
	tabling, in which two of the test cases of this directory loop forever
	if executed.

Zoltan.

cvs diff: Diffing .
Index: Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/tabling/Mmakefile,v
retrieving revision 1.56
diff -u -b -r1.56 Mmakefile
--- Mmakefile	20 Jul 2009 03:49:14 -0000	1.56
+++ Mmakefile	28 Aug 2009 19:36:35 -0000
@@ -211,7 +211,11 @@
 	fi
 
 loopcheck.out: loopcheck
-	if ./$< > $@.tmp 2>&1; then \
+	grep -v "Warning" loopcheck.err > loopcheck.err_no_warn; \
+	if test -s loopcheck.err_no_warn; then \
+		cat loopcheck.err > loopcheck.out; \
+		exit 1; \
+	elif ./$< > $@.tmp 2>&1; then \
 		grep . $@.tmp; \
 		exit 1; \
 	else \
@@ -219,10 +223,14 @@
 			-e 's/require.m:[0-9]*/require.m:NNNN/g' \
 			< $@.tmp > $@; \
 		rm -f $@.tmp; \
-	fi
+	fi; \
+	/bin/rm loopcheck.err_no_warn;
 
 loopcheck_nondet.out: loopcheck_nondet
-	if ./$< > $@.tmp 2>&1; then \
+	if test -s loopcheck_nondet.err; then \
+		cat loopcheck_nondet.err > loopcheck.out; \
+		exit 1; \
+	elif ./$< > $@.tmp 2>&1; then \
 		grep . $@.tmp; \
 		exit 1; \
 	else \
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list