[m-rev.] for review: warn for up-to-date `mmc --make' targets

Simon Taylor stayl at cs.mu.OZ.AU
Thu Oct 31 00:24:37 AEDT 2002


On 30-Oct-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 30-Oct-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > With `--make', warn if a target specified on the command line
> > is already up to date.
> 
> A test case would be good.

Index: tests/warnings/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/warnings/Mmakefile,v
retrieving revision 1.24
diff -u -u -r1.24 Mmakefile
--- tests/warnings/Mmakefile	20 Sep 2002 10:06:24 -0000	1.24
+++ tests/warnings/Mmakefile	30 Oct 2002 13:22:45 -0000
@@ -23,7 +23,7 @@
 	unused_args_test \
 	unused_import
 
-PROGS=$(COMPILE_PROGS) $(ERRORCHECK_PROGS)
+PROGS=$(COMPILE_PROGS) $(ERRORCHECK_PROGS) up_to_date
 
 TESTS = $(PROGS)
 SUBDIRS=
@@ -42,6 +42,12 @@
 
 $(ERRORCHECK_PROGS:%=%.runtest): %.runtest: %.res_error ;
 
+# Check that `mmc --make up_to_date.m' generates a warning.
+up_to_date.runtest:
+	$(MCM) up_to_date.m >& up_to_date.err
+	diff $(DIFF_OPTS) up_to_date.exp up_to_date.err > up_to_date.res_make \
+		|| { cat up_to_date.err; cat up_to_date.res_make; exit 1; }
+
 #-----------------------------------------------------------------------------#
 
 %.res_error:	%.exp %.err
@@ -76,6 +82,6 @@
 clean_local:	clean_err clean_res
 
 clean_err:
-	rm -f *.err
+	rm -f *.err up_to_date.res_make
 
 #-----------------------------------------------------------------------------#
Index: tests/warnings/up_to_date.exp
===================================================================
RCS file: tests/warnings/up_to_date.exp
diff -N tests/warnings/up_to_date.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/warnings/up_to_date.exp	30 Oct 2002 12:59:52 -0000
@@ -0,0 +1 @@
+** Nothing to be done for `up_to_date.m'.
Index: tests/warnings/up_to_date.m
===================================================================
RCS file: tests/warnings/up_to_date.m
diff -N tests/warnings/up_to_date.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/warnings/up_to_date.m	30 Oct 2002 12:59:01 -0000
@@ -0,0 +1,9 @@
+:- module up_to_date.
+:- interface.
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+main --> io__write_string("Hello, world\n").
--------------------------------------------------------------------------
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