for review: avoiding some "mmake realclean"s during bootchecks

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue May 12 18:48:54 AEST 1998


Avoid about half of the slow "mmake realclean"s required by a bootcheck.

tests/*/runtests:
	Concentrate all the actions performed before the test and after
	a successful tests (both of which involve an "mmake realclean")
	into two scripts, tests/{startup,shutdown}.

tests/shutdown:
	Clean up the directory, and touch the file CLEAN.

tests/startup:
	If the file CLEAN exists and is the most recent file in the directory,
	consider the directory clean to beging with. Otherwise, run mmake
	realclean.

Zoltan.

Index: benchmarks/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/benchmarks/runtests,v
retrieving revision 1.5
diff -u -r1.5 runtests
--- runtests	1998/04/23 09:27:20	1.5
+++ runtests	1998/05/07 04:42:05
@@ -13,8 +13,8 @@
 # on a machine that has NU-Prolog installed.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -24,8 +24,8 @@
 then
 	echo "the tests in the benchmark directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor clean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the benchmark directory failed"
Index: debugger/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/Mmakefile,v
retrieving revision 1.2
diff -u -r1.2 Mmakefile
--- Mmakefile	1998/04/23 09:22:03	1.2
+++ Mmakefile	1998/05/08 01:17:01
@@ -4,6 +4,8 @@
 
 include ../Mmake.common
 
+RM_C=:
+
 #-----------------------------------------------------------------------------#
 
 DEBUGGER_PROGS=	\
Index: debugger/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests	1998/04/23 09:27:26	1.2
+++ runtests	1998/05/07 04:43:01
@@ -4,8 +4,8 @@
 # Return a status of 0 (true) if everything is all right, and 1 otherwise.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -15,8 +15,8 @@
 then
 	echo "the tests in the debugger directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor clean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the debugger directory failed"
Index: general/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/general/runtests,v
retrieving revision 1.5
diff -u -r1.5 runtests
--- runtests	1998/04/23 09:27:34	1.5
+++ runtests	1998/05/07 04:44:24
@@ -13,8 +13,8 @@
 # on a machine that has NU-Prolog installed.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -24,8 +24,8 @@
 then
 	echo "the tests in the general directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor clean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the general directory failed"
Index: hard_coded/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/runtests,v
retrieving revision 1.5
diff -u -r1.5 runtests
--- runtests	1998/04/23 09:27:47	1.5
+++ runtests	1998/05/07 04:48:01
@@ -4,8 +4,8 @@
 # Return a status of 0 (true) if everything is all right, and 1 otherwise.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -15,8 +15,8 @@
 then
 	echo "the tests in the hard_coded directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor clean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the hard_coded directory failed"
Index: invalid/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/runtests,v
retrieving revision 1.5
diff -u -r1.5 runtests
--- runtests	1998/04/23 09:27:59	1.5
+++ runtests	1998/05/07 04:48:56
@@ -3,8 +3,8 @@
 # Return a status of 0 (true) if everything is all right, and 1 otherwise.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor realclean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -14,8 +14,8 @@
 then
 	echo "the tests in the invalid directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor realclean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the invalid directory failed"
Index: misc_tests/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/misc_tests/runtests,v
retrieving revision 1.4
diff -u -r1.4 runtests
--- runtests	1998/04/23 09:28:08	1.4
+++ runtests	1998/05/07 04:49:19
@@ -4,8 +4,8 @@
 # Return a status of 0 (true) if everything is all right, and 1 otherwise.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -15,8 +15,8 @@
 then
 	echo "the tests in the misc_tests directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor clean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the misc_tests directory failed"
Index: term/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/term/runtests,v
retrieving revision 1.4
diff -u -r1.4 runtests
--- runtests	1998/04/23 09:28:21	1.4
+++ runtests	1998/05/07 04:49:44
@@ -4,8 +4,8 @@
 # Return a status of 0 (true) if everything is all right, and 1 otherwise.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -15,8 +15,8 @@
 then
 	echo "the tests in the term directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor clean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the term directory failed"
Index: valid/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/valid/runtests,v
retrieving revision 1.6
diff -u -r1.6 runtests
--- runtests	1998/04/23 09:28:31	1.6
+++ runtests	1998/05/07 04:50:52
@@ -3,8 +3,8 @@
 # Return a status of 0 (true) if everything is all right, and 1 otherwise.
 
 . ../handle_options
+. ../startup
 
-mmake $gradeopt $jfactor realclean > /dev/null 2>&1
 mmake $gradeopt $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -23,7 +23,7 @@
 then
 	echo "the tests in the valid directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $gradeopt $jfactor realclean > /dev/null 2>&1
+	. ../shutdown
 	exit 0
 else
 	echo "some tests in the valid directory failed: $failed"
Index: warnings/runtests
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/runtests,v
retrieving revision 1.6
diff -u -r1.6 runtests
--- runtests	1998/04/23 09:28:39	1.6
+++ runtests	1998/05/07 04:52:06
@@ -3,8 +3,8 @@
 # Return a status of 0 (true) if everything is all right, and 1 otherwise.
 
 . ../handle_options
+. ../startup
 
-mmake $jfactor clean > /dev/null 2>&1
 mmake $jfactor depend || exit 1
 eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
 checkstatus=$?
@@ -14,8 +14,8 @@
 then
 	echo "the tests in the warnings directory succeeded"
 	echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
-	mmake $jfactor clean > /dev/null 2>&1
 	rm -f .allres
+	. ../shutdown
 	exit 0
 else
 	echo "the tests in the warnings directory failed"

New File: shutdown
===================================================================
echo cleaning up the directory after the tests
mmake $gradeopt $jfactor realclean > /dev/null 2>&1
rm core > /dev/null 2>&1
touch CLEAN

New File: startup
===================================================================
echo cleaning up the directory before the tests
if ls -lt | head -2 | egrep CLEAN > /dev/null 2>&1
then
	rm CLEAN > /dev/null 2>&1
else
	rm CLEAN > /dev/null 2>&1
	mmake $gradeopt $jfactor realclean > /dev/null 2>&1
fi




More information about the developers mailing list