[m-dev.] diff: clean up duplicated code in test_mercury

Tyson Dowd trd at cs.mu.OZ.AU
Tue Nov 16 18:45:51 AEDT 1999


Hi,

I was considering adding some new tests to the extras when I found this.

===================================================================


Estimated hours taken: 0.2

This is a minor fixup.

tools/test_mercury:
	Turn some duplicated code for running tests in the extras/
	into a loop.


Index: tools/test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.102
diff -u -r1.102 test_mercury
--- test_mercury	1999/11/01 05:47:09	1.102
+++ test_mercury	1999/11/01 12:55:20
@@ -364,46 +364,31 @@
 esac
 for grade in $GRADES kludge_for_broken_shells
 do
+    for extrasdir in clpr trailed_update ; do
 	if [ "$grade" != kludge_for_broken_shells ]; then
-		echo "test clpr stuff for grade $grade" 1>&2
+	    echo "test $extrasdir stuff for grade $grade" 1>&2
 		(cd mercury/extras/clpr &&
-			 mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL &&
-			 mmake depend	 $PARALLEL MMAKEFLAGS=$PARALLEL \
-				GRADE=$grade \
-				EXTRA_MCFLAGS="$TEST_MCFLAGS" \
-				EXTRA_CFLAGS="$TEST_CFLAGS" &&
-			 mmake 		 $PARALLEL MMAKEFLAGS=$PARALLEL \
-				GRADE=$grade \
-				EXTRA_MCFLAGS="$TEST_MCFLAGS" \
-				EXTRA_CFLAGS="$TEST_CFLAGS" &&
-			 mmake check	 $PARALLEL MMAKEFLAGS=$PARALLEL \
-				GRADE=$grade \
-				EXTRA_MCFLAGS="$TEST_MCFLAGS" \
-				EXTRA_CFLAGS="$TEST_CFLAGS" &&
-			 mmake install	 $PARALLEL MMAKEFLAGS=$PARALLEL \
-				GRADE=$grade \
-				EXTRA_MCFLAGS="$TEST_MCFLAGS" \
-				EXTRA_CFLAGS="$TEST_CFLAGS" &&
-			 mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL) ||
-				status=1
-		echo "test trailed_update stuff for grade $grade" 1>&2
-		(cd mercury/extras/trailed_update &&
-			 mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL &&
-			 mmake depend	 $PARALLEL MMAKEFLAGS=$PARALLEL \
-				GRADE=$grade \
-				EXTRA_MCFLAGS="$TEST_MCFLAGS" \
-				EXTRA_CFLAGS="$TEST_CFLAGS" &&
-			 mmake 		 $PARALLEL MMAKEFLAGS=$PARALLEL \
-				GRADE=$grade \
-				EXTRA_MCFLAGS="$TEST_MCFLAGS" \
-				EXTRA_CFLAGS="$TEST_CFLAGS" &&
-			 mmake check	 $PARALLEL MMAKEFLAGS=$PARALLEL \
-				GRADE=$grade \
-				EXTRA_MCFLAGS="$TEST_MCFLAGS" \
-				EXTRA_CFLAGS="$TEST_CFLAGS" &&
-			 mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL) ||
-				status=1
+		mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL &&
+		mmake depend	 $PARALLEL MMAKEFLAGS=$PARALLEL \
+			GRADE=$grade \
+			EXTRA_MCFLAGS="$TEST_MCFLAGS" \
+			EXTRA_CFLAGS="$TEST_CFLAGS" &&
+		mmake 		 $PARALLEL MMAKEFLAGS=$PARALLEL \
+			GRADE=$grade \
+			EXTRA_MCFLAGS="$TEST_MCFLAGS" \
+			EXTRA_CFLAGS="$TEST_CFLAGS" &&
+		mmake check	 $PARALLEL MMAKEFLAGS=$PARALLEL \
+			GRADE=$grade \
+			EXTRA_MCFLAGS="$TEST_MCFLAGS" \
+			EXTRA_CFLAGS="$TEST_CFLAGS" &&
+		mmake install	 $PARALLEL MMAKEFLAGS=$PARALLEL \
+			GRADE=$grade \
+			EXTRA_MCFLAGS="$TEST_MCFLAGS" \
+			EXTRA_CFLAGS="$TEST_CFLAGS" &&
+		mmake realclean $PARALLEL MMAKEFLAGS=$PARALLEL) ||
+			status=1
 	fi
+    done
 done
 
 #-----------------------------------------------------------------------------#


-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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