[m-dev.] for review: bootchecking the extras
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue Nov 21 14:01:33 AEDT 2000
Optionally test the extras directory during bootchecks.
tools/bootcheck
Add an option, -e, for testing the extras directory. Rename the
-T/--test-only option as -n/--no-bootcheck, since it does not prevent
the testing of the extras.
Bootcheck only test the subdirectories in extras which have an
Mmakefile and which can be tested in all grades and in all setups.
extras/*/Mmakefile:
Updates to include extras/Mmake.params if it exists (to get the
parameters, including grades, of the bootcheck) and to add a check
target, which in most cases does not do anything yet (which means
that the only testing we do is checking that the program compiles
all right). Making "mmake check" do something meaningful will be
up to the authors of the various subdirectories involved.
In many cases, add .PHONY annotations on the relevant targets.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of the aditi subdirectory from
bootcheck, since this can be done only on a machine with Aditi
installed.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of the aditi subdirectory from
bootcheck, since this can be done only on a machine with Aditi
installed.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with Aditi installed.
extras/dynamic_linking/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with the dl library already
installed.
extras/logged_out/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only in grades with the right kind of stream
support.
extras/odbc/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with ODBC installed.
extras/references/NOBOOTTEST:
extras/trailed_update/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only in trailing grades.
Zoltan.
cvs diff: Diffing tools
Index: tools/bootcheck
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.104
diff -u -b -r1.104 bootcheck
--- tools/bootcheck 2000/11/14 11:16:52 1.104
+++ tools/bootcheck 2000/11/21 02:50:42
@@ -14,6 +14,8 @@
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).
+ -e, --extras
+ Test the programs in the extras directory.
-h, --help
Display this usage message.
-j <num-jobs>, --jobs <num-jobs>
@@ -47,13 +49,13 @@
Copy the profiler directory instead of linking it.
This is sometimes necessary for bootstrapping
changes.
+ -n, --no-bootcheck
+ Do not run the bootstrap check; execute the test suite and/or
+ the extras only. This option requires a previous bootstrap
+ check to have left a working stage 2 directory.
-t, --no-test-suite
By default, bootcheck will also run the test quite.
This option prevents that.
- -T, --test-suite-only
- Do not run the bootstrap check; execute the test suite only.
- This option requires a previous bootstrap check to have left
- a working stage 2 directory.
-2, --keep-stage-2
Don't rebuild the stage 2 directory from scratch after
building stage 1. Instead use the existing stage 2 directory.
@@ -88,6 +90,7 @@
"
testdirs=""
+extras=false
jfactor=""
keep_objs=false
mmake_opts="-k"
@@ -129,6 +132,9 @@
-d*)
testdirs="$testdirs ` expr $1 : '-d\(.*\)' `"; ;;
+ -e|--extras)
+ extras=true ;;
+
-h|--help)
echo "$usage"
exit 0 ;;
@@ -168,12 +174,12 @@
-p|--copy-profiler)
copy_profiler=true ;;
+ -n|--no-bootcheck)
+ do_bootcheck=false ;;
+
-t|--no-test-suite)
runtests=false ;;
- -T|--test-suite-only)
- do_bootcheck=false ;;
-
-2|--keep-stage-2)
keep_stage_2=true ;;
@@ -729,9 +735,9 @@
echo "building of stages 1 and 2 skipped"
fi
-if $runtests
+if test "$runtests" = "true" -o "$extras" = "true"
then
- # Use everything from stage 2, the options say that the tests
+ # Use everything from stage 2, unless the options say that the tests
# should be done in grade different from the grade of stage 2,
# in which case use everything from stage 1, trusting the user
# that the grade of the tests and the grade of stage 1 are compatible.
@@ -769,7 +775,8 @@
-I$root/${stage2_insert}boehm_gc
-I$root/${stage2_insert}boehm_gc/include"
export MERCURY_ALL_C_INCL_DIRS
- MERCURY_ALL_MC_C_INCL_DIRS="--c-include-directory $root/${stage2_insert}trace
+ MERCURY_ALL_MC_C_INCL_DIRS="
+ --c-include-directory $root/${stage2_insert}trace
--c-include-directory $root/${stage2_insert}library
--c-include-directory $root/${stage2_insert}runtime
--c-include-directory $root/${stage2_insert}boehm_gc
@@ -790,7 +797,11 @@
# for mkinit, mmc, mgnuc, ml etc
PATH=$root/${stage2_insert}util:$root/${stage2_insert}scripts:$PATH
export PATH
+fi
+test_status=0
+if $runtests
+then
# We need to give tests/debugger access to the mdbrc and mdb_doc
# files in the doc and scripts directories, without hardcoding their
# pathnames. We must also compensate for scripts/mdbrc having hardcoded
@@ -852,8 +863,57 @@
cd $root
fi
-else
- test_status=0
+fi
+
+extras_status=0
+if $extras
+then
+ cd $root/extras
+ if test -f Mmake.params
+ then
+ mv Mmake.params Mmake.params.$$
+ fi
+
+ if test -f $root/Mmake.stage.params
+ then
+ cp $root/Mmake.stage.params Mmake.params
+ elif test -f $root/Mmake.params
+ then
+ cp $root/Mmake.params Mmake.params
+ else
+ cp /dev/null Mmake.params
+ fi
+
+ if test "$test_grade" != ""
+ then
+ echo "GRADE = $test_grade" >> Mmake.params
+ elif test "$grade" != ""
+ then
+ echo "GRADE = $grade" >> Mmake.params
+ fi
+
+ for testdir in *
+ do
+ if test -f $testdir/Mmakefile -a ! -f $testdir/NOBOOTTEST
+ then
+ (cd $testdir;
+ mmake realclean $jfactor;
+ mmake depend $jfactor &&
+ mmake $jfactor &&
+ mmake check $jfactor &&
+ mmake realclean $jfactor ) ||
+ extras_status=1
+ fi
+ done
+
+ if test -f Mmake.params.$$
+ then
+ mv Mmake.params.$$ Mmake.params
+ else
+ /bin/rm Mmake.params
+ fi
+
+ cd $root
fi
if test "$type_stats" != ""
@@ -863,7 +923,7 @@
echo "finishing at `date`"
-if test "$diff_status" = 0 -a "$test_status" = 0
+if test "$diff_status" = 0 -a "$test_status" = 0 -a "$extras_status" = 0
then
exit 0
else
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
Index: extras/aditi/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/aditi/Mmakefile,v
retrieving revision 1.5
diff -u -b -r1.5 Mmakefile
--- extras/aditi/Mmakefile 2000/05/26 14:39:49 1.5
+++ extras/aditi/Mmakefile 2000/11/21 00:49:36
@@ -56,6 +56,9 @@
realclean:
cd tests && $(MMAKE) realclean
+.PHONY: check
+check: tests
+
.PHONY: tests
tests:
cd tests && $(MMAKE)
Index: extras/aditi/NOBOOTTEST
===================================================================
RCS file: NOBOOTTEST
diff -N NOBOOTTEST
cvs diff: Diffing extras/cgi
Index: extras/cgi/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/cgi/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/cgi/Mmakefile 2000/04/26 05:24:36 1.1
+++ extras/cgi/Mmakefile 2000/11/21 00:52:09
@@ -1,3 +1,4 @@
+-include ../Mmake.params
LIBRARY = libmercury_www
@@ -12,4 +13,6 @@
install: libmercury_www.install
-
+.PHONY: check
+check:
+ true
cvs diff: Diffing extras/complex_numbers
Index: extras/complex_numbers/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/Mmakefile,v
retrieving revision 1.2
diff -u -b -r1.2 Mmakefile
--- extras/complex_numbers/Mmakefile 1998/05/29 09:08:20 1.2
+++ extras/complex_numbers/Mmakefile 2000/11/21 00:52:01
@@ -1,3 +1,11 @@
+-include ../Mmake.params
+
MAIN_TARGET = all
-depend: complex_numbers.depend
+
all: libcomplex_numbers
+
+depend: complex_numbers.depend
+
+.PHONY: check
+check:
+ true
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
Index: extras/concurrency/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/concurrency/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/concurrency/Mmakefile 2000/02/29 22:37:12 1.1
+++ extras/concurrency/Mmakefile 2000/11/21 00:52:26
@@ -1,5 +1,9 @@
+-include ../Mmake.params
-depend : philo.depend
+default_target: philo
-default_target : philo
+depend: philo.depend
+.PHONY: check
+check:
+ true
cvs diff: Diffing extras/curses
Index: extras/curses/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curses/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/curses/Mmakefile 2000/01/14 07:21:29 1.1
+++ extras/curses/Mmakefile 2000/11/21 00:52:36
@@ -1,2 +1,9 @@
-depend: mcurses.depend
+-include ../Mmake.params
+
default_target: libmcurses
+
+depend: mcurses.depend
+
+.PHONY: check
+check:
+ true
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
Index: extras/dynamic_linking/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/dynamic_linking/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/dynamic_linking/Mmakefile 1998/12/06 06:15:14 1.1
+++ extras/dynamic_linking/Mmakefile 2000/11/21 00:52:55
@@ -1,3 +1,5 @@
+-include ../Mmake.params
+
# enable C-level debugging
CFLAGS = -g
MLFLAGS = --no-strip
@@ -5,6 +7,7 @@
main_target: libdl
depend: dl.depend dl_test.depend hello.depend
+.PHONY: check
check: dl_test libhello.so
./dl_test > dl_test.out
diff -c dl_test.out dl_test.exp
Index: extras/dynamic_linking/NOBOOTTEST
===================================================================
RCS file: NOBOOTTEST
diff -N NOBOOTTEST
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/logged_output
Index: extras/logged_output/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/logged_output/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/logged_output/Mmakefile 2000/08/11 16:50:12 1.1
+++ extras/logged_output/Mmakefile 2000/11/21 00:53:21
@@ -1,11 +1,23 @@
-#------------------------------------------------------------------------------#
+#----------------------------------------------------------------------------#
# Copyright (C) 2000 The University of Melbourne.
# This file may only be copied under the terms of the GNU Library General
# Public License - see the file COPYING.LIB in the Mercury distribution.
-#------------------------------------------------------------------------------#
+#----------------------------------------------------------------------------#
+-include ../Mmake.params
+
MAIN_TARGET=main
+
+.PHONY: clean
depend: main.depend
+
+.PHONY: check
+check:
+ true
+
+.PHONY: clean
clean: main.clean
+
+.PHONY: realclean
realclean: main.realclean
-rm -f OUTPUT
Index: extras/logged_output/NOBOOTTEST
===================================================================
RCS file: NOBOOTTEST
diff -N NOBOOTTEST
cvs diff: Diffing extras/moose
Index: extras/moose/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/moose/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/moose/Mmakefile 2000/05/22 05:22:01 1.1
+++ extras/moose/Mmakefile 2000/11/21 00:53:36
@@ -1,10 +1,17 @@
+-include ../Mmake.params
+
# GRADE = asm_fast.gc.debug
# GRADE = asm_fast.gc.prof
# MCFLAGS = -O6
# MCFLAGS = --intermodule-optimization -O6
-default_target : moose
+.PHONY: default_target
+default_target: moose
-depend : moose.depend
+.PHONY: depend
+depend: moose.depend
+.PHONY: check
+check:
+ true
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
Index: extras/odbc/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/odbc/Mmakefile,v
retrieving revision 1.3
diff -u -b -r1.3 Mmakefile
--- extras/odbc/Mmakefile 2000/03/21 05:39:28 1.3
+++ extras/odbc/Mmakefile 2000/11/21 00:53:58
@@ -4,6 +4,8 @@
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
+-include ../Mmake.params
+
# extras/odbc/Mmakefile - Mmake file for building the ODBC interface.
#-----------------------------------------------------------------------------#
@@ -41,7 +43,12 @@
MAIN_TARGET=odbc_test
+.PHONY: depend
depend: odbc_test.depend
+
+.PHONY: check
+check:
+ true
#-----------------------------------------------------------------------------#
Index: extras/odbc/NOBOOTTEST
===================================================================
RCS file: NOBOOTTEST
diff -N NOBOOTTEST
cvs diff: Diffing extras/posix
Index: extras/posix/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/posix/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/posix/Mmakefile 1999/10/18 00:50:25 1.1
+++ extras/posix/Mmakefile 2000/11/21 00:54:27
@@ -1,13 +1,24 @@
+-include ../Mmake.params
+
MLOBJS = posix_workarounds.o
MLPICOBJS = posix_workarounds.o
+
+.PHONY: default_target
+default_target: hello
-depend : hello.depend
+.PHONY: depend
+depend: hello.depend
-default_target : hello
+hello: posix_workarounds.o
-hello : posix_workarounds.o
+.PHONY: check
+check:
+ true
-clean :
+.PHONY: clean
+clean:
-/bin/rm -f posix_workarounds.o
+.PHONY: realclean
+realclean: clean
cvs diff: Diffing extras/references
Index: extras/references/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/references/Mmakefile,v
retrieving revision 1.3
diff -u -b -r1.3 Mmakefile
--- extras/references/Mmakefile 2000/01/28 03:32:32 1.3
+++ extras/references/Mmakefile 2000/11/21 00:55:07
@@ -4,6 +4,8 @@
# Public License - see the file COPYING.LIB in the Mercury distribution.
#-----------------------------------------------------------------------------#
+-include ../Mmake.params
+
GRADEFLAGS += --use-trail
# Install in an "extras" subdirectory of the main installation tree
@@ -16,19 +18,24 @@
MCFLAGS += --intermodule-optimisation
MCFLAGS += --transitive-intermodule-optimisation
+.PHONY: depend
depend: global.depend
cd samples && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" depend
cd tests && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" depend
+.PHONY: check
check: libglobal
cd tests && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" check
+.PHONY: install
install: libglobal.install
+.PHONY: install_check
install_check:
cd samples && mmake $(MMAKEFLAGS) GRADEFLAGS="$(GRADEFLAGS)" \
EXTRA_LIB_DIRS="$(INSTALL_PREFIX)/lib/mercury" check
+.PHONY: clean
clean: clean_subdirs
.PHONY: clean_subdirs
@@ -36,6 +43,7 @@
cd samples && mmake $(MMAKEFLAGS) clean
cd tests && mmake $(MMAKEFLAGS) clean
+.PHONY: realclean
realclean: realclean_subdirs
.PHONY: realclean_subdirs
Index: extras/references/NOBOOTTEST
===================================================================
RCS file: NOBOOTTEST
diff -N NOBOOTTEST
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
Index: extras/trailed_update/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/trailed_update/Mmakefile,v
retrieving revision 1.10
diff -u -b -r1.10 Mmakefile
--- extras/trailed_update/Mmakefile 2000/04/19 05:46:48 1.10
+++ extras/trailed_update/Mmakefile 2000/11/21 00:56:21
@@ -14,27 +14,29 @@
# We need this to use shared libraries on Linux
ML = ml --mercury-libs shared
+# The Mmake.params file can be used to override definitions in this file
+-include ../Mmake.params
+
MAIN_TARGET = libtrailed_update
-depend : trailed_update.depend
+.PHONY: depend
+depend: trailed_update.depend
cd samples && mmake $(MMAKEFLAGS) depend
cd tests && mmake $(MMAKEFLAGS) depend
-check : libtrailed_update
+.PHONY: check
+check: libtrailed_update
cd samples && mmake $(MMAKEFLAGS) check
cd tests && mmake $(MMAKEFLAGS) check
-clean :
+.PHONY: clean
+clean:
cd samples && mmake $(MMAKEFLAGS) clean
cd tests && mmake $(MMAKEFLAGS) clean
-realclean :
+.PHONY: realclean
+realclean:
cd samples && mmake $(MMAKEFLAGS) realclean
cd tests && mmake $(MMAKEFLAGS) realclean
-
-#-----------------------------------------------------------------------------#
-
-# The Mmake.params file can be used to override definitions in this file
--include ../Mmake.params
#-----------------------------------------------------------------------------#
Index: extras/trailed_update/NOBOOTTEST
===================================================================
RCS file: NOBOOTTEST
diff -N NOBOOTTEST
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
Index: extras/xml/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/xml/Mmakefile,v
retrieving revision 1.1
diff -u -b -r1.1 Mmakefile
--- extras/xml/Mmakefile 2000/09/05 22:33:56 1.1
+++ extras/xml/Mmakefile 2000/11/21 00:56:52
@@ -1,4 +1,11 @@
+-include ../Mmake.params
-default_target : tryit
+.PHONY: default_target
+default_target: tryit
-depend : tryit.depend
+.PHONY: depend
+depend: tryit.depend
+
+.PHONY: check
+check:
+ true
--------------------------------------------------------------------------
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