[m-dev.] diff: support setting MLFLAGS in runtests
Fergus Henderson
fjh at cs.mu.OZ.AU
Sun Oct 3 18:19:18 AEST 1999
Estimated hours taken: 1
Add support for setting MLFLAGS to tests/runtests.
This is needed if you want to run the tests with
static linking when the default is shared linking,
or vice versa.
tests/handle_options:
Add a new option for setting MLFLAGS.
Define variables `mmakeopts' and `runtestopts' containing all the
options needed for running mmake and runtests (respectively).
tests/subdir_runtests:
Use $runtestopts rather than $jfactor $cflag $gflag $fflag.
tests/runtests:
tests/*/runtests:
tests/*/*/runtests:
Use $mmakeopts rather than $jfactor $gradeopt $flagsopt $cflagsopt.
tests/hard_coded/exceptions/runtests:
New file. This directory was missing a `runtests' script.
Workspace: /home/quicksilver/public/test_mercury/test_dirs/quicksilver
Index: tests/debugger/declarative/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/declarative/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests 1999/09/22 05:17:19 1.2
+++ runtests 1999/10/03 07:58:52
@@ -6,21 +6,21 @@
. ../../handle_options
. ../../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the debugger/declarative directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../../shutdown
exit 0
else
echo "the tests in the debugger/declarative directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
# The test results are temporarily ignored because the
Index: tests/general/accumulator/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/general/accumulator/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests 1999/09/29 02:49:11 1.2
+++ runtests 1999/10/03 07:59:02
@@ -15,8 +15,8 @@
. ../../handle_options
. ../../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.res > .allres
@@ -34,21 +34,21 @@
if [ -s INTRODUCED.diff ]; then
echo "the tests in the general/accumulator directory failed"
echo "as some predicates didn't have accumulators introduced"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the predicates are:"
cat INTRODUCED.diff
exit 1
fi
echo "the tests in the general/accumulator directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres INTRODUCED.diff
. ../../shutdown
exit 0
else
echo "the tests in the general/accumulator directory failed"
echo "as some test cases didn't produce the correct output"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
cvs diff: tests/hard_coded/exceptions/runtests is a new entry, no comparison available
Index: tests/hard_coded/sub-modules/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/hard_coded/sub-modules/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests 1999/07/28 09:27:48 1.2
+++ runtests 1999/10/03 07:59:10
@@ -8,23 +8,23 @@
# XXX we need to disable parallel make, because parallel make is currently
# not supported when using nested modules.
-jfactor=
+jfactor=-j1
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts $jfactor depend || exit 1
+eval mmake -k $mmakeopts $jfactor check
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the hard_coded/sub-modules directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../../shutdown
exit 0
else
echo "the tests in the hard_coded/sub-modules directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/hard_coded/typeclasses/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/hard_coded/typeclasses/runtests,v
retrieving revision 1.1
diff -u -r1.1 runtests
--- runtests 1999/07/12 06:26:05 1.1
+++ runtests 1999/10/03 07:59:13
@@ -6,21 +6,21 @@
. ../../handle_options
. ../../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the hard_coded/typeclasses directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../../shutdown
exit 0
else
echo "the tests in the hard_coded/typeclasses directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/benchmarks/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/benchmarks/runtests,v
retrieving revision 1.6
diff -u -r1.6 runtests
--- runtests 1998/05/13 04:05:38 1.6
+++ runtests 1999/10/03 07:58:34
@@ -15,21 +15,21 @@
. ../handle_options
. ../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the benchmark directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit 0
else
echo "the tests in the benchmark directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/debugger/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/runtests,v
retrieving revision 1.7
diff -u -r1.7 runtests
--- runtests 1999/07/12 06:25:17 1.7
+++ runtests 1999/10/03 07:58:49
@@ -21,21 +21,21 @@
# Now run all the tests in this directory.
. ../startup
-mmake $jfactor depend_local || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check_local
+eval mmake $mmakeopts depend_local || exit 1
+eval mmake -k $mmakeopts check_local
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the debugger directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit $subdir_status
else
echo "the tests in the debugger directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/general/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/general/runtests,v
retrieving revision 1.7
diff -u -r1.7 runtests
--- runtests 1999/07/12 06:25:35 1.7
+++ runtests 1999/10/03 07:58:57
@@ -30,21 +30,21 @@
# Now run all the tests in this directory.
. ../startup
-mmake $jfactor depend_local || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check_local
+eval mmake $mmakeopts depend_local || exit 1
+eval mmake -k $mmakeopts check_local
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the general directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit $subdir_status
else
echo "the tests in the general directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/hard_coded/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/hard_coded/runtests,v
retrieving revision 1.7
diff -u -r1.7 runtests
--- runtests 1999/07/12 06:25:49 1.7
+++ runtests 1999/10/03 07:59:06
@@ -21,21 +21,21 @@
# Now run all the tests in this directory.
. ../startup
-mmake $jfactor depend_local || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check_local
+eval mmake $mmakeopts depend_local || exit 1
+eval mmake -k $mmakeopts check_local
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the hard_coded directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit $subdir_status
else
echo "the tests in the hard_coded directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/invalid/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/invalid/runtests,v
retrieving revision 1.6
diff -u -r1.6 runtests
--- runtests 1998/05/13 04:06:13 1.6
+++ runtests 1999/10/03 07:59:22
@@ -5,21 +5,21 @@
. ../handle_options
. ../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.err_res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the invalid directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit 0
else
echo "the tests in the invalid directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/misc_tests/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/misc_tests/runtests,v
retrieving revision 1.5
diff -u -r1.5 runtests
--- runtests 1998/05/13 04:06:18 1.5
+++ runtests 1999/10/03 07:59:27
@@ -6,21 +6,21 @@
. ../handle_options
. ../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the misc_tests directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit 0
else
echo "the tests in the misc_tests directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/tabling/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/tabling/runtests,v
retrieving revision 1.2
diff -u -r1.2 runtests
--- runtests 1999/03/11 06:54:00 1.2
+++ runtests 1999/10/03 07:59:31
@@ -6,21 +6,21 @@
. ../handle_options
. ../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the tabling directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit 0
else
echo "the tests in the tabling directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/term/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/term/runtests,v
retrieving revision 1.5
diff -u -r1.5 runtests
--- runtests 1998/05/13 04:06:26 1.5
+++ runtests 1999/10/03 07:59:35
@@ -6,21 +6,21 @@
. ../handle_options
. ../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.trans_opt_res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the term directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit 0
else
echo "the tests in the term directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/valid/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/valid/runtests,v
retrieving revision 1.7
diff -u -r1.7 runtests
--- runtests 1998/05/13 04:06:33 1.7
+++ runtests 1999/10/03 07:59:39
@@ -5,11 +5,11 @@
. ../handle_options
. ../startup
-mmake $gradeopt $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
-objs=`mmake $gradeopt printobjs`
+objs=`mmake $mmakeopts printobjs`
failed=""
for obj in $objs
do
@@ -22,11 +22,11 @@
if test "$failed" = "" -a "$checkstatus" = 0
then
echo "the tests in the valid directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
. ../shutdown
exit 0
else
echo "some tests in the valid directory failed: $failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
exit 1
fi
Index: tests/warnings/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/warnings/runtests,v
retrieving revision 1.7
diff -u -r1.7 runtests
--- runtests 1998/05/13 04:06:38 1.7
+++ runtests 1999/10/03 07:59:44
@@ -5,21 +5,21 @@
. ../handle_options
. ../startup
-mmake $jfactor depend || exit 1
-eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+eval mmake $mmakeopts depend || exit 1
+eval mmake -k $mmakeopts check
checkstatus=$?
cat *.res > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the warnings directory succeeded"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
rm -f .allres
. ../shutdown
exit 0
else
echo "the tests in the warnings directory failed"
- echo "gradeopt=$gradeopt, flagsopt=$flagsopt, cflagsopt=$cflagsopt"
+ echo "mmakeopts=$mmakeopts"
echo "the differences are:"
cat .allres
exit 1
Index: tests/handle_options
===================================================================
RCS file: /home/staff/zs/imp/tests/handle_options,v
retrieving revision 1.4
diff -u -r1.4 handle_options
--- handle_options 1997/03/18 06:01:12 1.4
+++ handle_options 1999/10/03 07:23:21
@@ -5,6 +5,8 @@
Pass EXTRA_MCFLAGS=<mcflags> as an option to \`mmake check'.
-c <cflags>, --cflags <cflags>
Pass EXTRA_CFLAGS=<cflags> as an option to \`mmake check'.
+ -l <mlflags>, --mlflags <mlflags>
+ Pass EXTRA_MLFLAGS=<mlflags> as an option to \`mmake check'.
-g <grade>, --grade <grade>
Pass GRADE=<grade> as an option to \`mmake check'.
-j <num-jobs>, --jobs <num-jobs>
@@ -14,6 +16,7 @@
jfactor=""
flagsopt=""
cflagsopt=""
+mlflagsopt=""
gradeopt=""
fflag=""
cflag=""
@@ -27,6 +30,11 @@
cflagsopt="EXTRA_CFLAGS='$2'"
shift ;;
+ -l|--mlflags)
+ lflag="-l '$2'"
+ mlflagsopt="EXTRA_MLFLAGS='$2'"
+ shift ;;
+
-f|--flags)
fflag="-f '$2'"
flagsopt="EXTRA_MCFLAGS='$2'"
@@ -61,3 +69,6 @@
echo "$usage" 1>&2
exit 1
fi
+
+mmakeopts="$jfactor $flagsopt $cflagsopt $mlflagsopt $gradeopt"
+runtestopts="$jfactor $cflag $lflag $fflag $gflag"
Index: tests/runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/runtests,v
retrieving revision 1.5
diff -u -r1.5 runtests
--- runtests 1999/07/12 06:24:58 1.5
+++ runtests 1999/10/03 07:29:47
@@ -9,10 +9,10 @@
if test "$subdir_failures" = ""
then
echo "all tests have succeeded"
- echo "gradeopt=$gflag, flagsopt=$fflag, cflagsopt=$cflag"
+ echo "mmakeopts=$mmakeopts"
exit 0
else
echo "some tests have failed in: $subdir_failures"
- echo "gradeopt=$gflag, flagsopt=$fflag, cflagsopt=$cflag"
+ echo "mmakeopts=$mmakeopts"
exit 1
fi
Index: tests/subdir_runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/subdir_runtests,v
retrieving revision 1.1
diff -u -r1.1 subdir_runtests
--- subdir_runtests 1999/07/12 06:24:59 1.1
+++ subdir_runtests 1999/10/03 07:29:02
@@ -7,8 +7,8 @@
then
cd $dir
# we need to use `eval' here to get the quoting right in
- # the case when $fflag or $cflag contains embedded spaces
- if eval ./runtests $jfactor $gflag $fflag $cflag
+ # the case when $runtestopts contains embedded spaces
+ if eval ./runtests $runtestopts
then
true
else
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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