[m-dev.] for review: bootcheck -d -d

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Apr 29 12:52:42 AEST 1999


I forgot to say that I am asking Mark to review my --call-trace-struct change.

This one is for review by anyone.

tools/bootcheck:
	Allow multiple -d options. Factor out some common code to make the
	change easier.

Zoltan.

cvs diff: Diffing .
Index: bootcheck
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.78
diff -u -b -u -r1.78 bootcheck
--- bootcheck	1999/04/29 00:59:31	1.78
+++ bootcheck	1999/04/29 01:06:57
@@ -9,7 +9,11 @@
 Usage: $0 [options]
 Options:
 	-d <dirname>, --test-dir <dirname>
-		Run the tests only in <dirname>.
+		Run the tests in directory <dirname>. Multiple such options
+		may be given, in which case the tests in all the named
+		directories will be run. In the absence of any such options,
+		all tests in all directories will be run (unless testing
+		as a whole is disabled).
 	-h, --help
 		Display this usage message.
 	-j <num-jobs>, --jobs <num-jobs>
@@ -61,7 +65,7 @@
 		(Same as the \`--use-subdirs' option to mmake and mmc.)
 "
 
-testdir=""
+testdirs=""
 jfactor=""
 keep_objs=false
 mmake_opts="-k"
@@ -93,9 +97,9 @@
 	case "$1" in
 
 	-d|--test-dir)
-		testdir="$2"; shift ;;
+		testdirs="$testdirs $2"; shift ;;
 	-d*)
-		testdir="` expr $1 : '-d\(.*\)' `"; ;;
+		testdirs="$testdirs ` expr $1 : '-d\(.*\)' `"; ;;
 
 	-h|--help)
 		echo "$usage"
@@ -670,35 +674,34 @@
 		test_grade_opt=""
 	fi
 
+	test_status=0
 	if test -d ../tests
 	then
-		cp $root/doc/mdb_command_test.inp ../tests/debugger
-		if test "$testdir" = ""
+		tests_prefix="../"
+	elif test -d tests
 		then
-			cd ../tests
-			./runtests $jfactor $test_grade_opt
+		tests_prefix=""
 		else
-			cd ../tests/$testdir
-			./runtests $jfactor $test_grade_opt
+		echo "cannot find test directory"
+		test_status=1
 		fi
-		test_status=$?
-		cd $root
-	elif test -d tests
+
+	if test "$test_status" = 0
 	then
-		cp $root/doc/mdb_command_test.inp tests/debugger
-		if test "$testdir" = ""
+		cp $root/doc/mdb_command_test.inp ${tests_prefix}tests/debugger
+		if test "$testdirs" = ""
 		then
-			cd tests
+			cd ${tests_prefix}tests
 			./runtests $jfactor $test_grade_opt
 		else
-			cd tests/$testdir
+			for testdir in $testdirs
+			do
+				cd $root/${tests_prefix}tests/$testdir
 			./runtests $jfactor $test_grade_opt
+			done
 		fi
 		test_status=$?
 		cd $root
-	else
-		echo "cannot find test directory"
-		test_status=1
 	fi
 else
 	test_status=0
--------------------------------------------------------------------------
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