From 28c655bd03f2098c66fd6bafd4d0d1cb8c171f3e Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 18 Nov 2003 20:06:44 +0000 Subject: * lib/ylwrap: Do not overwrite headers if they haven't changed. Fix the include guard substitution. * tests/yacc6.test: Augment to run ylwrap, and make sure it does not needlessly update headers. * tests/yacc8.test: Make sure headers are not needlessly updated with ylwrap is not used. Move `test -f foo.o' into the Makefile as `test -f foo.$(OBJEXT)' for portability. --- tests/yacc8.test | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'tests/yacc8.test') diff --git a/tests/yacc8.test b/tests/yacc8.test index 3d93ccce0..40009b863 100755 --- a/tests/yacc8.test +++ b/tests/yacc8.test @@ -39,6 +39,16 @@ AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = foo/foo foo_foo_SOURCES = foo/parse.y AM_YFLAGS = -d + +obj: foo/parse.$(OBJEXT) + +test1: obj + test -f foo/parse.c + test -f foo/parse.$(OBJEXT) + +test2: obj + test -f foo/parse.c + test -f foo/parse.$(OBJEXT) END mkdir foo @@ -60,9 +70,7 @@ mkdir sub cd sub ../configure -$MAKE foo/parse.o -test -f foo/parse.c -test -f foo/parse.o +$MAKE test1 # Aside of the rest of this test, let's see if we can recover from # parse.h removal @@ -71,6 +79,18 @@ rm -f foo/parse.h $MAKE foo/parse.h test -f foo/parse.h +# Make sure foo/parse.h is not updated, unless when needed. +$sleep +: > z +$sleep +touch ../foo/parse.y +$MAKE obj +test `ls -1t foo/parse.h z | sed 1q` = z +$sleep +$PERL -pi -e 's/%%/%token TOKEN\n%%/g' ../foo/parse.y +$MAKE obj +test `ls -1t foo/parse.h z | sed 1q` = foo/parse.h + # Now, adds another parser to test ylwrap. cd .. @@ -89,8 +109,4 @@ test -f ./ylwrap || exit 1 cd sub # Regenerate Makefile (automatic in GNU Make, but not in other Makes) ./config.status -$MAKE foo/parse2.o -test -f foo/parse2.c -test -f foo/parse2.o - -exit 0 +$MAKE test2 -- cgit v1.2.1