[m-rev.] diff: test framework: handle .exe extensions

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 16 14:35:20 AEST 2002


I noticed that on Cygwin, it was not gzipping the executables for
failed test cases; the gzip command failed because it was invoked
with the .exe extension.  Hence the following patch.

(In Cygwin, .exe extensions are mostly transparent, because the
stat() and exec() system calls add the .exe extension automatically
if needed.  However, gzip is one case where it is not transparent.)

Estimated hours taken: 0.25
Branches: main

tests/Mmake.common:
	Handle ".exe" extensions when gzipping executables for failed
	test cases.

Workspace: /home/ceres/fjh/ws-ceres2/mercury
Index: tests/Mmake.common
===================================================================
RCS file: /home/mercury1/repository/tests/Mmake.common,v
retrieving revision 1.32
diff -u -d -r1.32 Mmake.common
--- tests/Mmake.common	30 Sep 2002 05:09:53 -0000	1.32
+++ tests/Mmake.common	16 Oct 2002 04:29:21 -0000
@@ -169,7 +169,8 @@
 else
 clean_zip:
 	for test in $(TESTS); do \
-		rm -f `basename $$test -nodepend`.gz; \
+		prog=`basename $$test -nodepend`; \
+		rm -f $$prog.gz $$prog.exe.gz; \
 	done
 endif
 
@@ -286,7 +287,8 @@
 		if [ -f $*.failed ]; then \
 			rm -f $*.failed; \
 		    	if [ -f $$test ]; then \
-				rm -f $$test.gz; gzip $$test; \
+				rm -f $$test.gz $$test.exe.gz; \
+				gzip $$test || gzip $$test.exe; \
 			fi; \
 			echo FAILED TEST $(THIS_DIR)/$* $(PARAMS_MSG) \
 				| tee -a $@; \

-- 
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