[m-rev.] for review: fix `mmake --use-mmc-make' in tests
Peter Wang
wangp at students.cs.mu.OZ.AU
Wed Dec 21 17:18:29 AEDT 2005
This patch fixes or works around most of the problems with running the
testsuite under `mmake --use-mmc-make'.
Estimated hours taken: 4
Branches: main
tests/debugger/Mercury.options:
tests/valid/Mercury.options:
Use Mercury.options variables so that some module-specific
options work with `mmake --use-mmc-make' as well.
tests/invalid/Mmakefile:
tests/invalid/purity/Mmakefile:
Some ugly workarounds to get `mmake --use-mmc-make' to generate
.err files without aborting the entire make process and to
avoid doubled up error messages which `mmc --make' generates.
tests/warnings/Mmakefile:
`mmake --use-mmc-make' should pass the file to be made to `mmc --make'
as "unused_args_analysis.c", not "Mercury/cs/unused_args_analysis.c".
Index: tests/debugger/Mercury.options
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/Mercury.options,v
retrieving revision 1.14
diff -u -r1.14 Mercury.options
--- tests/debugger/Mercury.options 16 Sep 2005 05:42:54 -0000 1.14
+++ tests/debugger/Mercury.options 21 Dec 2005 00:32:21 -0000
@@ -1,7 +1,7 @@
# The completion test requires mdb to use readline, even though
# the input is not a terminal.
-MLFLAGS-completion = --runtime-flags --force-readline
+MCFLAGS-completion = --runtime-flags --force-readline
# The debugger can't know about type class declarations unless we generate
# the new type of RTTI for them.
Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/Mmakefile,v
retrieving revision 1.184
diff -u -r1.184 Mmakefile
--- tests/invalid/Mmakefile 7 Nov 2005 07:47:10 -0000 1.184
+++ tests/invalid/Mmakefile 21 Dec 2005 06:07:10 -0000
@@ -292,11 +292,27 @@
#-----------------------------------------------------------------------------#
+ifneq ($(MMAKE_USE_MMC_MAKE),yes)
+
%.err: %.m
if $(MC) --errorcheck-only $(ALL_GRADEFLAGS) $(ALL_MCFLAGS) $* \
> $*.err 2>&1; \
then false; else true; fi
+else
+
+% XXX: with `mmake --use-mmc-make' the ".DEFAULT:" rule seems to take
+% precedence over "%.err: %.m" rules.
+% XXX: the reason we run the $(MCM) command twice is to avoid
+% doubled up error messages, once while making interface files,
+% then the module proper. The second time the command is run
+% only one set of error messages should appear.
+$(addsuffix .err,$(PROGS)):
+ -$(MCM) $@
+ if $(MCM) -r $@ > /dev/null 2>&1 ; then false; else true; fi
+
+endif
+
# For foreign_decl_line_number, the exact output is somewhat dependent
# on the C compiler, etc. So we just grep the output for "#error" to
# make sure that it contains the lines that we expect. That way we don't
Index: tests/invalid/purity/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/purity/Mmakefile,v
retrieving revision 1.8
diff -u -r1.8 Mmakefile
--- tests/invalid/purity/Mmakefile 12 Feb 2003 22:58:20 -0000 1.8
+++ tests/invalid/purity/Mmakefile 21 Dec 2005 06:09:07 -0000
@@ -42,16 +42,16 @@
#-----------------------------------------------------------------------------#
-# With `mmc --make', errors should go only to the `.err' file,
-# not stderr.
-ifeq ($(MMAKE_USE_MMC_MAKE),yes)
-%.err: %.m
- if $(MCM) $*.err > /dev/null 2>&1 ; then false; else true; fi
-else
+# See ../Mmakefile explanation of this.
+ifneq ($(MMAKE_USE_MMC_MAKE),yes)
%.err: %.m
if $(MC) $(ALL_GRADEFLAGS) $(ALL_MCFLAGS) --errorcheck-only $* \
> $*.err 2>&1; \
then false; else true; fi
+else
+$(addsuffix .err,$(PROGS)):
+ -$(MCM) $@
+ if $(MCM) -r $@ > /dev/null 2>&1 ; then false; else true; fi
endif
clean_local:
Index: tests/valid/Mercury.options
===================================================================
RCS file: /home/mercury1/repository/tests/valid/Mercury.options,v
retrieving revision 1.24
diff -u -r1.24 Mercury.options
--- tests/valid/Mercury.options 13 Oct 2005 07:52:49 -0000 1.24
+++ tests/valid/Mercury.options 20 Dec 2005 23:48:10 -0000
@@ -103,3 +103,4 @@
MCFLAGS-vn_float = -O5
MCFLAGS-zero_arity = --infer-modes
MGNUCFLAGS-reg_bug = --no-ansi
+MCFLAGS-reg_bug = --no-ansi-c
Index: tests/warnings/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/Mmakefile,v
retrieving revision 1.39
diff -u -r1.39 Mmakefile
--- tests/warnings/Mmakefile 27 Aug 2005 09:42:10 -0000 1.39
+++ tests/warnings/Mmakefile 20 Dec 2005 23:23:36 -0000
@@ -57,8 +57,8 @@
# Build the `.analysis' file for unused_args_analysis2
# before building unused_args_analysis.c.
-$(cs_subdir)unused_args_analysis.c: $(cs_subdir)unused_args_analysis2.c
-unused_args_analysis.err: $(cs_subdir)unused_args_analysis2.c
+unused_args_analysis.c: unused_args_analysis2.c
+unused_args_analysis.err: unused_args_analysis.c
# Check that `mmc --make up_to_date.m' generates a warning.
up_to_date.runtest:
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list