From 448a03db7b44f30519f2cd8048ea491b40a0e810 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Sat, 10 Apr 1999 00:48:03 +0000 Subject: [PATCH] * yacc2.test, yacc3.test: New files. * Makefile.am (TESTS): Added yacc2.test and yacc3.test. --- tests/ChangeLog | 5 +++++ tests/Makefile.am | 2 +- tests/Makefile.in | 5 +++-- tests/yacc2.test | 51 +++++++++++++++++++++++++++++++++++++++++++++++ tests/yacc3.test | 32 +++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+), 3 deletions(-) create mode 100755 tests/yacc2.test create mode 100755 tests/yacc3.test diff --git a/tests/ChangeLog b/tests/ChangeLog index 698fd08e..8e2fa4e7 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +1999-04-10 Alexandre Oliva + + * yacc2.test, yacc3.test: New files. + * Makefile.am (TESTS): Added yacc2.test and yacc3.test. + 1999-04-09 Tom Tromey * nodist.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 80d34e06..851e74b9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -43,7 +43,7 @@ subst.test symlink.test syntax.test tags.test tagsub.test target.test \ texinfo.test texinfo2.test texinfo3.test texinfo4.test texinfo5.test \ texinfo6.test texinfo7.test texinfo8.test unused.test version.test \ version2.test version3.test vpath.test vtexi.test vtexi2.test \ -whoami.test xsource.test yacc.test yaccpp.test +whoami.test xsource.test yacc.test yacc2.test yacc3.test yaccpp.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index 2b8ed9d0..f78e9200 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -108,16 +108,17 @@ subst.test symlink.test syntax.test tags.test tagsub.test target.test \ texinfo.test texinfo2.test texinfo3.test texinfo4.test texinfo5.test \ texinfo6.test texinfo7.test texinfo8.test unused.test version.test \ version2.test version3.test vpath.test vtexi.test vtexi2.test \ -whoami.test xsource.test yacc.test yaccpp.test +whoami.test xsource.test yacc.test yacc2.test yacc3.test yaccpp.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = +DIST_SOURCES = DIST_COMMON = ChangeLog Makefile.am Makefile.in -DISTFILES = $(DIST_COMMON) $(SOURCES) $(TEXINFOS) $(EXTRA_DIST) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) GZIP_ENV = --best all: all-redirect diff --git a/tests/yacc2.test b/tests/yacc2.test new file mode 100755 index 00000000..e6f319ed --- /dev/null +++ b/tests/yacc2.test @@ -0,0 +1,51 @@ +#! /bin/sh + +# Test to make sure intermediate .h file is not generated nor removed +# if (AM_)?YFLAGS do not contain -d. Requested by Jim Meyering. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_YACC +END + +cat > Makefile.am <<'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.y +END + +$AUTOMAKE || exit 1 + +# If zardoz.h IS mentioned, fail +grep 'zardoz.h' Makefile.in > /dev/null && exit 1 + +echo 'AM_YFLAGS = -d' >> Makefile.am + +$AUTOMAKE || exit 1 + +# If zardoz.h is NOT mentioned, fail +grep 'zardoz.h' Makefile.in > /dev/null || exit 1 + +echo 'AM_YFLAGS = ' >> Makefile.am + +$AUTOMAKE || exit 1 + +# If zardoz.h IS mentioned, fail +grep 'zardoz.h' Makefile.in > /dev/null && exit 1 + +echo 'YFLAGS = -d' >> Makefile.am + +$AUTOMAKE || exit 1 + +# If zardoz.h is NOT mentioned, fail +grep 'zardoz.h' Makefile.in > /dev/null || exit 1 + +echo 'YFLAGS = ' >> Makefile.am + +$AUTOMAKE || exit 1 + +# If zardoz.h IS mentioned, fail +grep 'zardoz.h' Makefile.in > /dev/null && exit 1 + +exit 0 diff --git a/tests/yacc3.test b/tests/yacc3.test new file mode 100755 index 00000000..cbfe66b3 --- /dev/null +++ b/tests/yacc3.test @@ -0,0 +1,32 @@ +#! /bin/sh + +# Ensure that generated .h file is distributed iff we have -d in +# (AM_)?YFLAGS. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_YACC +END + +cat > Makefile.am <<'END' +bin_PROGRAMS = zardoz +zardoz_SOURCES = zardoz.y +magic: + @echo $(DIST_COMMON) +END + +$AUTOMAKE || exit 1 + +# It should not be disted here +$MAKE -f Makefile.in SHELL=/bin/sh magic | +grep 'zardoz.h' Makefile.in > /dev/null && exit 1 + +echo 'YFLAGS = -d' >> Makefile.am + +$AUTOMAKE || exit 1 + +# But it should here +$MAKE -f Makefile.in SHELL=/bin/sh magic | +grep 'zardoz.h' Makefile.in > /dev/null -- 2.43.5