cvs diff: bug fixes for runtests

Tyson Richard DOWD trd at hydra.cs.mu.oz.au
Fri Mar 14 17:07:08 AEDT 1997


Sorry to slow your thesis down (again), but Fergus, can you check this?

I'm not 100% happy with this solution, but it's a tricky problem.
Unfortunately, sh doesn't have as good list construction primitives
as say, tcl, has.

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

Estimated hours taken: 4

Fix two bugs in the scripts for running tests.

tests/handle_options:
	Pass MCFLAGS and MGNUCFLAGS, not EXTRA_CFLAGS and EXTRA_MCFLAGS
	to mmake. It appears previously these options were just not
	used, which means this change may show some compiler bugs that
	we thought we were already testing for.

tests/*/runtests:
	Don't pass empty strings as arguments to mmake, as this can
	tickle bugs in make.

	Try 
		make -f foo.123 ""
	on a CASE machine or hydra (not kryten, it has a different
	version of gnu-make). It will chop the `23' from that string.
	So when using `make -f mmake.$$', only the single digit pids 
	work, which is fairly limiting.

Index: handle_options
===================================================================
RCS file: /home/staff/zs/imp/tests/handle_options,v
retrieving revision 1.3
diff -u -r1.3 handle_options
--- handle_options	1996/12/14 16:56:05	1.3
+++ handle_options	1997/03/14 05:09:51
@@ -24,12 +24,12 @@
 
 	-c|--cflags)
 		cflag="-c '$2'"
-		cflagsopt="EXTRA_CFLAGS=$2"
+		cflagsopt="MGNUCFLAGS=$2"
 		shift ;;
 
 	-f|--flags)
 		fflag="-f '$2'"
-		flagsopt="EXTRA_MCFLAGS=$2"
+		flagsopt="MCFLAGS=$2"
 		shift ;;
 
 	-g|--grade)
Index: benchmarks/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/benchmarks/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests	1996/12/14 16:56:12	1.2
+++ runtests	1997/03/14 05:45:11
@@ -16,7 +16,21 @@
 
 mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
-mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" check
+
+if [ -n "$flagsopt" ] ; then
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt "$flagsopt"
+	fi
+else
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt 
+	fi
+fi
+
 checkstatus=$?
 
 cat *.res > .allres
Index: general/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/general/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests	1996/12/14 16:56:15	1.2
+++ runtests	1997/03/14 05:44:52
@@ -16,7 +16,21 @@
 
 mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
-mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" check
+
+if [ -n "$flagsopt" ] ; then
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt "$flagsopt"
+	fi
+else
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt 
+	fi
+fi
+
 checkstatus=$?
 
 cat *.res > .allres
Index: hard_coded/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/hard_coded/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests	1996/12/14 16:56:17	1.2
+++ runtests	1997/03/14 05:45:14
@@ -7,7 +7,21 @@
 
 mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
-mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" check
+
+if [ -n "$flagsopt" ] ; then
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt "$flagsopt"
+	fi
+else
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt 
+	fi
+fi
+
 checkstatus=$?
 
 cat *.res > .allres
Index: misc_tests/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/misc_tests/runtests,v
retrieving revision 1.1
diff -u -r1.1 runtests
--- runtests	1997/01/29 01:17:07	1.1
+++ runtests	1997/03/14 05:46:01
@@ -7,7 +7,21 @@
 
 mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
-mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" check
+
+if [ -n "$flagsopt" ] ; then
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt "$flagsopt"
+	fi
+else
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt 
+	fi
+fi
+
 checkstatus=$?
 
 cat *.res > .allres
Index: valid/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/valid/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests	1996/12/14 16:56:19	1.2
+++ runtests	1997/03/14 05:46:21
@@ -6,7 +6,21 @@
 
 mmake $jfactor realclean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
-mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" check
+
+if [ -n "$flagsopt" ] ; then
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt "$flagsopt"
+	fi
+else
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt 
+	fi
+fi
+
 checkstatus=$?
 
 files=`mmake printtests`
Index: warnings/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/warnings/runtests,v
retrieving revision 1.3
diff -u -r1.3 runtests
--- runtests	1996/12/14 16:56:22	1.3
+++ runtests	1997/03/14 05:46:42
@@ -6,7 +6,21 @@
 
 mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
-mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" check
+
+if [ -n "$flagsopt" ] ; then
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$flagsopt" "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt "$flagsopt"
+	fi
+else
+	if [ -n "$cflagsopt" ] ; then
+		mmake -k $jfactor $gradeopt "$cflagsopt" 
+	else
+		mmake -k $jfactor $gradeopt 
+	fi
+fi
+
 checkstatus=$?
 
 cat *.res > .allres

-- 
       Tyson Dowd           # "Well, let's just say, 'if your VCR is
                            #  still blinking 12:00, you don't
     trd at cs.mu.oz.au        #  want Linux'". 
http://www.cs.mu.oz.au/~trd #  --Bruce Perens, Debian's Fearless Leader



More information about the developers mailing list