summaryrefslogtreecommitdiff
path: root/tests/yacc8.test
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2003-11-18 20:06:44 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2003-11-18 20:06:44 +0000
commit28c655bd03f2098c66fd6bafd4d0d1cb8c171f3e (patch)
treecbb9a60a1b855bd66320a5d72ce5abaa370404e5 /tests/yacc8.test
parent9b5e57d52c8465ea7df1af852cedeaeb0f43f748 (diff)
downloadautomake-28c655bd03f2098c66fd6bafd4d0d1cb8c171f3e.tar.gz
* 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.
Diffstat (limited to 'tests/yacc8.test')
-rwxr-xr-xtests/yacc8.test32
1 files changed, 24 insertions, 8 deletions
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