diff: tests/term: fix up Mmakefile & runtests
Fergus Henderson
fjh at cs.mu.oz.au
Tue Dec 30 13:59:28 AEDT 1997
tests/term/runtests:
tests/term/Mmakefile:
Rewrite the code for running the termination tests in the `term'
directory so that it is done in a similar way to the way that
the tests in the other test directories are run. This fixes
a bug where the test harness had `lmc3' instead of `$(MC)'.
It also makes things more consistent, ensures that the tests
will take notice of the usual runtests options and mmake variable
settings, and allows the tests to be run in parallel (e.g. -j8).
Index: runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/term/runtests,v
retrieving revision 1.1
diff -u -u -r1.1 runtests
--- runtests 1997/12/22 10:00:08 1.1
+++ runtests 1997/12/30 02:58:46
@@ -5,35 +5,21 @@
set -x
-stdoptions="--make-trans-opt --enable-termination"
-options="$stdoptions --term-single-arg 5 --term-norm simple"
+. ../handle_options
-modules=`mmake modules`
+mmake $jfactor clean > /dev/null 2>&1
+mmake $jfactor depend || exit 1
+eval mmake -k $jfactor $gradeopt $flagsopt $cflagsopt check
+checkstatus=$?
-cat /dev/null > .allres
-failure=""
-for module in $modules
-do
- /bin/rm $module.trans_opt > /dev/null 2>&1
- lmc3 -C $options $module > $module.out 2>&1
- if test "$?" = 0
- then
- diff -u $module.trans_opt $module.trans_opt_exp > $module.res
- cat $module.res >> .allres
- else
- failure="$failure $module"
- fi
-done
-
-if test ! -s .allres -a "$failure" = ""
+cat *.trans_opt_res > .allres
+if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the term directory succeeded"
rm -f .allres
exit 0
else
echo "the tests in the term directory failed"
- echo "the following modules had the compiler fail:"
- echo $failure
echo "the differences are:"
cat .allres
exit 1
Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/term/Mmakefile,v
retrieving revision 1.1
diff -u -u -r1.1 Mmakefile
--- Mmakefile 1997/12/22 09:57:42 1.1
+++ Mmakefile 1997/12/30 02:46:40
@@ -62,5 +62,27 @@
sum \
vangelder
-modules:
- @echo $(PROGS)
+DEPENDS = $(PROGS:=.depend)
+TRANS_OPTS = $(PROGS:=.trans_opt)
+TRANS_OPT_RESS = $(PROGS:=.trans_opt_res)
+
+#-----------------------------------------------------------------------------#
+
+MCTRANSOPTFLAGS = --enable-termination --term-single-arg 5 --term-norm simple
+
+%.trans_opt: %.m
+ $(MC) $(MCFLAGS) --make-trans-opt $(MCTRANSOPTFLAGS) $< \
+ > $*.trans_opt_err 2>&1
+
+%.trans_opt_res: %.trans_opt_exp %.trans_opt
+ diff -c $*.trans_opt_exp $*.trans_opt > $@
+
+#-----------------------------------------------------------------------------#
+
+depend:
+
+trans_opts: $(TRANS_OPTS)
+
+check: $(TRANS_OPT_RESS)
+
+#-----------------------------------------------------------------------------#
--
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.
More information about the developers
mailing list