[m-dev.] diff: fix arg_order_rearrangment test case failure
Peter Ross
petdr at cs.mu.OZ.AU
Mon Feb 14 11:19:55 AEDT 2000
On 14-Feb-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 13-Feb-2000, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> >
> > tests/warnings/Mmakefile:
> > Make the .res files depend on the .c files instead of the .err
> > files. This fixes a bug which was causing spurious failures of
> > arg_order_rearrangement test case. The bug was due to the .c file
> > not always finishing being made (and as a side-effect generating the
> > .err file) before diff was run.
>
> Hmm... one of the purposes of the test cases in this directory
> is to test the `--error-check-only' option and the `.err' mmake
> targets. Your change means that those features won't get tested
> anymore.
>
> I think it would be better to keep most of the .res files depending
> on the .err file, and do things differently only for those cases
> (currently just arg_order_rearrangement) that need the .err file that
> gets created when compiling to C rather than the one that is created
> with the --error-check-only option.
>
===================================================================
Estimated hours taken: 0.5
Ensure that the --errorcheck-only option gets tested.
tests/warnings/Mmakefile:
Divide the tested programs into two classes, those that only need
`--errorcheck-only' to generate a warning, and those which need to
be compiled to c to generate a warning.
This required generating .res_error and .res_compile files.
tests/warnings/runtests:
Handle the two different result files.
Index: Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/warnings/Mmakefile,v
retrieving revision 1.9
diff -u -r1.9 Mmakefile
--- Mmakefile 2000/02/13 08:54:14 1.9
+++ Mmakefile 2000/02/14 00:06:17
@@ -4,8 +4,10 @@
#-----------------------------------------------------------------------------#
-PROGS= \
- arg_order_rearrangment \
+COMPILE_PROGS= \
+ arg_order_rearrangment
+
+ERRORCHECK_PROGS= \
det_infer_warning \
double_underscore \
duplicate_call \
@@ -31,20 +33,27 @@
#-----------------------------------------------------------------------------#
-%.res: %.exp %.c
+%.res_error: %.exp %.err
-rm -f $@
diff -c $*.exp $*.err > $@
+%.res_compile: %.exp %.c
+ -rm -f $@
+ diff -c $*.exp $*.err > $@
+
#-----------------------------------------------------------------------------#
+PROGS=$(COMPILE_PROGS) $(ERRORCHECK_PROGS)
DEPENDS=$(PROGS:%=%.depend)
-RESS= $(PROGS:%=%.res)
+
+RES_ERRORS= $(ERRORCHECK_PROGS:%=%.res_error)
+RES_COMPILES= $(COMPILE_PROGS:%=%.res_compile)
#-----------------------------------------------------------------------------#
depend: $(DEPENDS)
-check: $(RESS)
+check: $(RES_COMPILES) $(RES_ERRORS)
all: $(PROGS)
@@ -56,6 +65,6 @@
rm -f *.err
clean_res:
- rm -f *.res
+ rm -f *.res_compile *.res_error
#-----------------------------------------------------------------------------#
Index: runtests
===================================================================
RCS file: /home/staff/zs/imp/tests/warnings/runtests,v
retrieving revision 1.8
diff -u -r1.8 runtests
--- runtests 1999/10/03 08:20:38 1.8
+++ runtests 2000/02/13 23:59:21
@@ -9,7 +9,7 @@
eval mmake -k $mmakeopts check
checkstatus=$?
-cat *.res > .allres
+cat *.res_compile *.res_error > .allres
if test ! -s .allres -a "$checkstatus" = 0
then
echo "the tests in the warnings directory succeeded"
--------------------------------------------------------------------------
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