[m-dev.] diff: Re-enable DD test cases

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Tue Jan 25 00:51:58 AEDT 2000


Fergus Henderson writes:
> 
> That code won't return the appropriate exit status if the second diff fails.
> 

Here's a revised diff.  I'll commit this after the tests finish.

Estimated hours taken: 1

tests/Mmake.common:
	Return the appropriate exit status when making the *.res file.

Index: tests/Mmake.common
===================================================================
RCS file: /home/mercury1/repository/tests/Mmake.common,v
retrieving revision 1.17
diff -u -r1.17 Mmake.common
--- tests/Mmake.common	2000/01/20 06:36:31	1.17
+++ tests/Mmake.common	2000/01/24 12:32:27
@@ -42,11 +42,14 @@
 	-rm -f $@
 	-rm -f $*.res2
 	diff $(DIFF_OPTS) $*.exp $*.out > $@ || \
-		if test -f $*.exp2; then	\
-			diff $(DIFF_OPTS) $*.exp2 $*.out > $*.res2; \
-			test `wc -l < $@` -lt `wc -l < $*.res2` || \
+		{ test -f $*.exp2 && \
+			if diff $(DIFF_OPTS) $*.exp2 $*.out > $*.res2; then \
 				cp $*.res2 $@; \
-		fi
+			else \
+				{ test `wc -l < $@` -le `wc -l < $*.res2` || \
+					cp $*.res2 $@; } && false; \
+			fi \
+		}
 
 #-----------------------------------------------------------------------------#
 

-- 
Mark Brown, PhD student            )O+  |  "Another of Fortran's breakthroughs
(m.brown at cs.mu.oz.au)                   |  was the GOTO statement, which was...
Dept. of Computer Science and Software  |  uniquely simple and understandable"
Engineering, University of Melbourne    |              -- IEEE, 1994
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list