]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Extend, fix and improve tests on Lex and Yacc support.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 7 May 2010 13:07:37 +0000 (15:07 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 18 Dec 2010 10:46:44 +0000 (11:46 +0100)
* tests/lexcpp.test: New test script, on support for Lex + C++.
* tests/lexvpath.test: New test script, test build and rebuild
rules for lexers in VPATH setup.
* tests/yacc-basic.test: New test script, run simple "semantic"
checks on basic Yacc support (similarly to what lex3.test does
for Lex support).
* tests/lex.test: Don't create useless dummy source file joe.l.
Remove extra blank lines.
* tests/lex4.test: Add trailing `:' command.  Do not create dummy
useless lex source file.
* tests/lex2.test: Likewise.  Call automake with the `-a' option,
so that it doesn't fail for the absence of `ylwrap' script.  Make
grepping of automake stderr stricter.
* tests/yacc7.test: Add trailing `:' command.  Enable `errexit'
shell flag earlier (just after having sourced ./defs).
* tests/yacc4.test: Likewise.  Also ...
(configure.in): Use pre-populated skeleton set up by ./defs,
instead of writing one from scratch.
Other minor cosmetic changes.
* tests/yacc5.test: Likewise.
* tests/yaccvpath.test: Likewise. Also ...
($distdir): New variable.
Use it throughout.
* tests/lex5.test: Likewise.
* tests/lex3.test: Likewise.  Check the distdir, rather than
grepping the distribution tarball.  Extend the test on the
created binary, and be sure to avoid hangs.  Add some comments.
* tests/yacc.test: Use stricter grepping.  Add trailing `:'.
* tests/yacc6.test: Likewise.
* tests/yacc3.test: Likewise.  Do not create the unused file
`Makefile.sed'.  Remove useless rules from Makefile.am.  Other
minor cosmetic changes.
* tests/yacc2.test: Make grepping of generated `Makefile.in' and
of automake error messages stricter.  Do not redirect output of
grep to /dev/null.  Move call to aclocal earlier.  Reduce the
number of empty blank lines.  Fix a typo in comments.
* tests/yacc8.test: Fixed bugs that reduced the completeness of
the tests.  Added trailing `:' command.
(configure.in): Use pre-populated skeleton set up by ./defs,
instead of writing one from scratch.
* tests/yaccpp.test: Test also extensions `.y++', `.ypp', and
`.yxx', rather than only `.yy'.
* tests/Makefile.am (TESTS): Update.

21 files changed:
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/lex.test
tests/lex2.test
tests/lex3.test
tests/lex4.test
tests/lex5.test
tests/lexcpp.test [new file with mode: 0755]
tests/lexvpath.test [new file with mode: 0755]
tests/yacc-basic.test [new file with mode: 0755]
tests/yacc.test
tests/yacc2.test
tests/yacc3.test
tests/yacc4.test
tests/yacc5.test
tests/yacc6.test
tests/yacc7.test
tests/yacc8.test
tests/yaccpp.test
tests/yaccvpath.test

index 5afdc53e64ad6c2d572ee187fc019a0f2db38854..be6bf5a3dfd75f1cb08bac0f847e92821aa46799 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,50 @@
+2010-12-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Extend, fix and improve tests on Lex and Yacc support.
+       * tests/lexcpp.test: New test script, on support for Lex + C++.
+       * tests/lexvpath.test: New test script, test build and rebuild
+       rules for lexers in VPATH setup.
+       * tests/yacc-basic.test: New test script, run simple "semantic"
+       checks on basic Yacc support (similarly to what lex3.test does
+       for Lex support).
+       * tests/lex.test: Don't create useless dummy source file joe.l.
+       Remove extra blank lines.
+       * tests/lex4.test: Add trailing `:' command.  Do not create dummy
+       useless lex source file.
+       * tests/lex2.test: Likewise.  Call automake with the `-a' option,
+       so that it doesn't fail for the absence of `ylwrap' script.  Make
+       grepping of automake stderr stricter.
+       * tests/yacc7.test: Add trailing `:' command.  Enable `errexit'
+       shell flag earlier (just after having sourced ./defs).
+       * tests/yacc4.test: Likewise.  Also ...
+       (configure.in): Use pre-populated skeleton set up by ./defs,
+       instead of writing one from scratch.
+       Other minor cosmetic changes.
+       * tests/yacc5.test: Likewise.
+       * tests/yaccvpath.test: Likewise. Also ...
+       ($distdir): New variable.
+       Use it throughout.
+       * tests/lex5.test: Likewise.
+       * tests/lex3.test: Likewise.  Check the distdir, rather than
+       grepping the distribution tarball.  Extend the test on the
+       created binary, and be sure to avoid hangs.  Add some comments.
+       * tests/yacc.test: Use stricter grepping.  Add trailing `:'.
+       * tests/yacc6.test: Likewise.
+       * tests/yacc3.test: Likewise.  Do not create the unused file
+       `Makefile.sed'.  Remove useless rules from Makefile.am.  Other
+       minor cosmetic changes.
+       * tests/yacc2.test: Make grepping of generated `Makefile.in' and
+       of automake error messages stricter.  Do not redirect output of
+       grep to /dev/null.  Move call to aclocal earlier.  Reduce the
+       number of empty blank lines.  Fix a typo in comments.
+       * tests/yacc8.test: Fixed bugs that reduced the completeness of
+       the tests.  Added trailing `:' command.
+       (configure.in): Use pre-populated skeleton set up by ./defs,
+       instead of writing one from scratch.
+       * tests/yaccpp.test: Test also extensions `.y++', `.ypp', and
+       `.yxx', rather than only `.yy'.
+       * tests/Makefile.am (TESTS): Update.
+
 2010-12-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Avoid running installed automake from 'libtool --help'.
index dab04e39336af6e94f6758b401366ee90e341e4b..52d3a58d3e5a7e4b3dbfce391d518427c24fbbf8 100644 (file)
@@ -413,6 +413,8 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lexcpp.test \
+lexvpath.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -788,6 +790,7 @@ werror3.test \
 whoami.test \
 xsource.test \
 xz.test \
+yacc-basic.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
index de21f4334e83da8adf72837774285defe8cbafe1..b4a896ce42e758cc9112d67f8c7a6dac4c10adab 100644 (file)
@@ -680,6 +680,8 @@ lex2.test \
 lex3.test \
 lex4.test \
 lex5.test \
+lexcpp.test \
+lexvpath.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -1055,6 +1057,7 @@ werror3.test \
 whoami.test \
 xsource.test \
 xz.test \
+yacc-basic.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
index c59c4e3bbb29e66320d04a5e3bb2c9488940696c..c671bde639c36f80d55bebd6e8a34d72838842e6 100755 (executable)
@@ -29,19 +29,14 @@ zot_SOURCES = joe.l
 LDADD = @LEXLIB@
 END
 
-: > joe.l
-
 $ACLOCAL
 $AUTOMAKE -a
 
-
 # Test to make sure that lex source generates correct target.
-
 $FGREP '$(LEX)' Makefile.in
 
 # Test to make sure that lex source generates correct clean rule.
 # From Ralf Corsepius.
-
 $FGREP joel Makefile.in && Exit 1
 
 :
index d588edf160f988eb3dbd7086c0cc7241ea9dd5d9..d7499e1cc519098b3e673a154cea02e2ea6f5e76 100755 (executable)
@@ -29,8 +29,9 @@ bin_PROGRAMS = zot
 zot_SOURCES = joe.l
 END
 
-: > joe.l
-
 $ACLOCAL
-AUTOMAKE_fails
-grep AM_PROG_LEX stderr
+AUTOMAKE_fails -a
+grep 'LEX.* undefined' stderr
+grep 'add .*AM_PROG_LEX' stderr
+
+:
index c4120cfc6ac6778240fbc3b1b8e6a4d713573457..e2b01d882128004d4ee6d443289a3df8b0e70e3e 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Basic semantic checks on Lex support.
 # Test associated with PR 19.
 # From Matthew D. Langston.
 
 required='gcc flex GNUmake'
 . ./defs || Exit 1
 
+set -e
+
 # Ignore user CFLAGS.
 CFLAGS=
 export CFLAGS
 
-cat > configure.in << 'END'
-AC_INIT
-dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1)
+distdir=$me-1.0
 
-dnl Checks for programs.
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_LEX
-AC_PROG_YACC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -46,38 +44,46 @@ END
 
 cat > foo.l << 'END'
 %%
-"END"   return EOF;
+"GOOD"   return EOF;
 .
 %%
 int
 main ()
 {
-  while (yylex () != EOF)
-    ;
-
-  return 0;
+  /* We don't use a 'while' loop here (like a real lexer would do)
+     to avoid possible hangs. */
+  if (yylex () == EOF)
+    return 0;
+  else
+    return 1;
 }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
+
 ./configure
+
+# Program should build and run.
 $MAKE
-echo 'This is the END' | ./foo
-$MAKE distcheck
+echo GOOD | ./foo
+echo BAD | ./foo && Exit 1
+
+# The generated file `foo.c' must be shipped.
+$MAKE distdir
+test -f $distdir/foo.c
 
-# foo.c must be shipped.
-gunzip am_lex_bug-0.1.1.tar.gz
-tar tf am_lex_bug-0.1.1.tar | $FGREP foo.c
+# Sanity check on distribution.
+$MAKE distcheck
 
 # While we are at it, make sure that foo.c is erased by
 # maintainer-clean, and not by distclean.
 test -f foo.c
 $MAKE distclean
 test -f foo.c
-./configure
+./configure # we must re-create `Makefile'
 $MAKE maintainer-clean
 test ! -f foo.c
+
+:
index fee140d6bc6c102c72e103ddc8347a92c3d2b23e..b171160dc006dbf3be8d8079f50749cb1960c5cb 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2006, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -32,9 +33,9 @@ bin_PROGRAMS = zoo
 zoo_SOURCES = joe.ll
 END
 
-: > joe.ll
-
 $ACLOCAL
 $AUTOMAKE -a
 
 $FGREP joe.Po Makefile.in
+
+:
index 88924b2149ce4dc144654d642431bca10b806d55..5c688d78241e578c0b81b8aac8d8721df69e7646 100755 (executable)
@@ -21,11 +21,7 @@ required='gcc GNUmake flex'
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([lex5], [1.0])
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AM_PROG_LEX
@@ -57,8 +53,6 @@ main ()
 }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -96,4 +90,4 @@ $MAKE foo/foo2.o
 test -f foo/foo2.c
 test -f foo/foo2.o
 
-Exit 0
+:
diff --git a/tests/lexcpp.test b/tests/lexcpp.test
new file mode 100755 (executable)
index 0000000..b95b5f1
--- /dev/null
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test to make sure Lex + C++ is supported.
+# Please keep this is sync with sister test yaccpp.test.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CXX
+AC_PROG_LEX
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo bar baz qux
+foo_SOURCES = foo.l++
+bar_SOURCES = bar.lpp
+baz_SOURCES = baz.ll
+qux_SOURCES = qux.lxx
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+
+sed -e 's/^/ /' -e 's/$/ /' Makefile.in >mk
+$FGREP ' foo.c++ ' mk
+$FGREP ' bar.cpp ' mk
+$FGREP ' baz.cc '  mk
+$FGREP ' qux.cxx ' mk
+
+:
diff --git a/tests/lexvpath.test b/tests/lexvpath.test
new file mode 100755 (executable)
index 0000000..378795e
--- /dev/null
@@ -0,0 +1,115 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This test checks that dependent files are updated before including
+# in the distribution.  `lexer.c' depends on `lexer.l'.  The latter is
+# updated so that `lexer.c' should be rebuild.  Then we are running
+# `make' and `make distdir' and check whether the version of `lexer.c'
+# to be distributed is up to date.
+
+# Please keep this in sync with sister test `yaccvapth.test'.
+
+required='gcc flex'
+. ./defs || Exit 1
+
+set -e
+
+distdir=$me-1.0
+
+cat > lexoutroot.in << 'END'
+LEX_OUTPUT_ROOT='@LEX_OUTPUT_ROOT@'
+END
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([lexoutroot])
+AC_PROG_CC
+AC_PROG_LEX
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = lexer.l foo.c
+LDADD = $(LEXLIB)
+END
+
+# Original lexer, with a "foobar" comment
+cat > lexer.l << 'END'
+%%
+"END" return EOF;
+.
+%%
+/*foobar*/
+END
+
+cat > foo.c << 'END'
+int main () { return 0; }
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir sub
+
+# We must run configure early, to find out whay $LEX_OUTPUT_ROOT is.
+cd sub
+../configure
+. ./lexoutroot
+test -n "$LEX_OUTPUT_ROOT" # sanity check
+cd ..
+
+flex lexer.l
+mv "$LEX_OUTPUT_ROOT".c lexer.c
+
+cd sub
+
+# Ensure that lexer.l will be newer than lexer.c.
+$sleep
+
+# New lexer, with `fubar' comment.
+cat > ../lexer.l << 'END'
+%%
+"END" return EOF;
+.
+%%
+/*fubar*/
+END
+
+$MAKE
+$MAKE distdir
+$FGREP '/*fubar*/' $distdir/lexer.c
+
+#
+# Now check to make sure that `make dist' will rebuilt the parser.
+#
+
+# Ensure that lexer.l will be newer than lexer.c.
+$sleep
+
+# New lexer, with `maude' comment.
+cat > ../lexer.l << 'END'
+%%
+"END" return EOF;
+.
+%%
+/*maude*/
+END
+
+$MAKE distdir
+$FGREP '/*maude*/' $distdir/lexer.c
+
+:
diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test
new file mode 100755 (executable)
index 0000000..af0c488
--- /dev/null
@@ -0,0 +1,78 @@
+#! /bin/sh
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Basic semantic checks on Yacc support.
+
+required=bison
+. ./defs || Exit 1
+
+set -e
+
+distdir=$me-1.0
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_YACC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = foo
+foo_SOURCES = parse.y foo.c
+END
+
+cat > parse.y << 'END'
+%{
+#include <stdio.h>
+#include <stdlib.h>
+int yylex () { return (getchar ()); }
+void yyerror (char *s) {}
+%}
+%%
+a : 'a' { exit(0); };
+END
+
+cat > foo.c << 'END'
+int main () { yyparse (); return 1; }
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+
+echo a | ./foo
+echo b | ./foo && Exit 1
+
+# The generated file `parse.c' must be shipped.
+$MAKE distdir
+test -f $distdir/parse.c
+
+# Sanity check on distribution.
+$MAKE distcheck
+
+# While we are at it, make sure that parse.c is erased by
+# maintainer-clean, and not by distclean.
+test -f parse.c
+$MAKE distclean
+test -f parse.c
+./configure # we must re-create `Makefile'
+$MAKE maintainer-clean
+test ! -f parse.c
+
+:
index bf6782fe1e5cced63f2b09c682baec643cac08ac..13b7fe3d9e04feac1eab90b954845cc954f5f4f8 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2006, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,4 +35,6 @@ END
 $ACLOCAL
 $AUTOMAKE -a
 
-grep 'zardoz.c' Makefile.in
+$FGREP 'zardoz.c' Makefile.in
+
+:
index a095edc2e45c62b699c3e00606de7932ad162bae..f598595c74441053f2a20448e9d8460158bb0319 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2003, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2003, 2006, 2010 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -26,6 +27,10 @@ AC_PROG_CC
 AC_PROG_YACC
 END
 
+# Run it here once and for all, since we are not going to modify
+# configure.in anymore.
+$ACLOCAL
+
 cat > Makefile.am <<'END'
 bin_PROGRAMS = zardoz
 zardoz_SOURCES = zardoz.y
@@ -34,53 +39,36 @@ END
 # Don't redefine several times the same variable.
 cp Makefile.am Makefile.src
 
-$ACLOCAL
 $AUTOMAKE -a
-
 # If zardoz.h IS mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null && Exit 1
-
-
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
 cp Makefile.src Makefile.am
 echo 'AM_YFLAGS = -d' >> Makefile.am
-
 $AUTOMAKE
-
 # If zardoz.h is NOT mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null
-
-
+$FGREP 'zardoz.h' Makefile.in
 
 cp Makefile.src Makefile.am
 echo 'AM_YFLAGS = ' >> Makefile.am
-
 $AUTOMAKE
-
 # If zardoz.h IS mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null && Exit 1
-
-
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
 cp Makefile.src Makefile.am
 echo 'YFLAGS = -d' >> Makefile.am
-
-# YFLAGS is a use variable.
+# YFLAGS is a user variable.
 AUTOMAKE_fails
-grep 'YFLAGS' stderr
+grep 'YFLAGS.* user variable' stderr
+grep 'AM_YFLAGS.* instead' stderr
 $AUTOMAKE -Wno-gnu
-
 # If zardoz.h is NOT mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null
-
-
+$FGREP 'zardoz.h' Makefile.in
 
 cp Makefile.src Makefile.am
 echo 'YFLAGS = ' >> Makefile.am
-
 $AUTOMAKE -Wno-gnu
-
 # If zardoz.h IS mentioned, fail
-grep 'zardoz.h' Makefile.in > /dev/null && Exit 1
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
 :
index 86d897c0d497a6bab9e61ea6e812826d985c7ea4..46f8d3e7f0b43c6e70d24464780fe2552978af0c 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2006, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -30,24 +31,22 @@ cat > Makefile.am <<'END'
 AUTOMAKE_OPTIONS = no-dependencies
 bin_PROGRAMS = zardoz
 zardoz_SOURCES = zardoz.y
-magic:
-       @echo $(DIST_COMMON)
 END
 
 $ACLOCAL
 $AUTOMAKE -a
 
-$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
 # It should not be disted here
-grep 'zardoz.h' Makefile.in && Exit 1
+$FGREP 'zardoz.h' Makefile.in && Exit 1
 
-cp Makefile.am Save
+cp Makefile.am Makefile.sav
 # Test all available flags to make sure header is distributed with
 # `-d'.
 for flag in YFLAGS AM_YFLAGS zardoz_YFLAGS; do
-   cp Save Makefile.am
+   cp Makefile.sav Makefile.am
    echo "$flag = -d" >> Makefile.am
-
    $AUTOMAKE -Wno-gnu
-   grep 'zardoz.h' Makefile.in
+   $FGREP 'zardoz.h' Makefile.in
 done
+
+:
index 0435ec081264f18256a40dcd216ec1caa6cd5400..bb252908d49e99126124108eca7d67e3bca5c424 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 required='bison gcc'
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE(foo, 0.1)
-PACKAGE=foo
-VERSION=0.1
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_YACC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -60,8 +57,6 @@ cat > foo.c << 'END'
 int main () { return 0; }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -86,6 +81,5 @@ test -f parse.c
 $MAKE maintainer-clean
 test ! -f bar.c
 test ! -f parse.c
-:
 
-Exit 0
+:
index 8b00ed806de493a5ee16f76b35d3fe9fc933192f..77de2e9989c7cbe2299d2520672aed5a68b44ddf 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_YACC
-AC_OUTPUT(Makefile)
 END
 
 cat > Makefile.am << 'END'
@@ -69,8 +66,8 @@ maude_SOURCES = sub/maude.y
 maude_YFLAGS = -d
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE -a || Exit 1
+$ACLOCAL
+$AUTOMAKE -a
 
 # Rule should use maude_YFLAGS.
 grep 'AM_YFLAGS.*maude' Makefile.in && Exit 1
@@ -80,3 +77,5 @@ grep 'maudec' Makefile.in && Exit 1
 
 # Make sure the .o file is required.
 grep '^am_maude_OBJECTS.*maude' Makefile.in
+
+:
index f10effdcb886a5df91b915c0ebedbf32f522c4ab..b9b259bb34dab6c6e3c56141a0e48bab0b8b5f8a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007  Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007, 2010 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -27,13 +27,13 @@ set -e
 
 cat > configure.in << 'END'
 AC_INIT([yacc6], [1.0])
+# `aux' is not an acceptable file/directory name on Windows systems
 AC_CONFIG_AUX_DIR([aux1])
 AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile sub/Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_YACC
-AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
 
@@ -89,11 +89,11 @@ $AUTOMAKE -a
 test -f aux1/ylwrap
 test ! -f ylwrap
 test ! -f sub/ylwrap
-$FGREP '(top_srcdir)/aux1/ylwrap' sub/Makefile.in
+$FGREP '$(top_srcdir)/aux1/ylwrap' sub/Makefile.in
 ./configure
 $MAKE
-grep '#.*line.*foo.y' sub/foo.c
-grep '#.*line.*bar.y' sub/bar.c
+grep '#.*line.*foo\.y' sub/foo.c
+grep '#.*line.*bar\.y' sub/bar.c
 
 $sleep
 : > z
@@ -106,3 +106,5 @@ sed s/TOKEN/TEKON/g sub/bar.y >sub/bar.yt
 mv -f sub/bar.yt sub/bar.y
 $MAKE
 $MAKE test-time-changed
+
+:
index 2edd15cb397d75401cf5439eb40b582c06217149..2b866bc9aedb2820c8578f4ea3d187a9b6d9cbce 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,6 +24,8 @@
 required=bison
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_YACC
@@ -52,8 +55,6 @@ WORD: "up";
 %%
 END
 
-set -e
-
 $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF
@@ -83,8 +84,9 @@ $MAKE distclean
 test -f foo.h
 test -f foo.c
 # ... but maintainer-clean should.
-./configure
+./configure # we must re-create `Makefile'
 $MAKE maintainer-clean
 test ! -f foo.h
 test ! -f foo.c
+
 :
index 979415c81d1bf54d1d658f85dc17bda8ad5691ed..797f4e76a13015fad3ad398d4d907005be5cf820 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2004, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2006, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,11 +23,7 @@ required="gcc bison"
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([yacc8], [1.0])
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_YACC
@@ -39,15 +36,16 @@ bin_PROGRAMS = foo/foo
 foo_foo_SOURCES = foo/parse.y
 AM_YFLAGS = -d
 
+.PHONY: obj
 obj: foo/parse.$(OBJEXT)
 
-test1: obj
-       test -f foo/parse.c
-       test -f foo/parse.$(OBJEXT)
-
-test2: obj
+.PHONY: test1 test2
+test1: foo/parse.$(OBJEXT)
        test -f foo/parse.c
        test -f foo/parse.$(OBJEXT)
+test2: foo/parse2.$(OBJEXT)
+       test -f foo/parse2.c
+       test -f foo/parse2.$(OBJEXT)
 END
 
 mkdir foo
@@ -104,9 +102,11 @@ EXTRA_foo_foo_SOURCES = foo/parse2.y
 END
 
 $AUTOMAKE -a
-test -f ./ylwrap || Exit 1
+test -f ./ylwrap
 
 cd sub
 # Regenerate Makefile (automatic in GNU Make, but not in other Makes)
 ./config.status
 $MAKE test2
+
+:
index 9013f4092285ce7fd0b3fc5387134ed891b9d8f9..9c4ae24cbb6f062e495c497719a6c5badc9ce053 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1997, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2006, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,7 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure yacc + c++ works.
+# Test to make sure Yacc + C++ is supported.
+# Please keep this is sync with sister test lexcpp.test.
 
 . ./defs || Exit 1
 
@@ -26,11 +28,20 @@ AC_PROG_YACC
 END
 
 cat > Makefile.am << 'END'
-bin_PROGRAMS = zardoz
-zardoz_SOURCES = zardoz.yy
+bin_PROGRAMS = foo bar baz qux
+foo_SOURCES = foo.y++
+bar_SOURCES = bar.ypp
+baz_SOURCES = baz.yy
+qux_SOURCES = qux.yxx
 END
 
 $ACLOCAL
 $AUTOMAKE -a
 
-grep zardoz.cc Makefile.in
+sed -e 's/^/ /' -e 's/$/ /' Makefile.in >mk
+$FGREP ' foo.c++ ' mk
+$FGREP ' bar.cpp ' mk
+$FGREP ' baz.cc '  mk
+$FGREP ' qux.cxx ' mk
+
+:
index 6db5fd7c176ddd9cee5f3120d39527dbaefbbc5b..7f4467114e38231685e8079795636e6d20b1da82 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test checks that dependent files are updated before including
-# in the distribution. `parse.c' depends on `parce.y'. The later is
+# in the distribution. `parse.c' depends on `parse.y'. The later is
 # updated so that `parse.c' should be rebuild. Then we are running
 # `make' and `make distdir' and check whether the version of `parse.c'
 # to be distributed is up to date.
 
+# Please keep this in sync with sister test `lexvapth.test'.
+
 required='gcc bison'
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE(foo, 0.1)
-PACKAGE=foo
-VERSION=0.1
+set -e
+
+distdir=$me-1.0
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AC_PROG_YACC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -53,8 +54,6 @@ cat > foo.c << 'END'
 int main () { return 0; }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -82,7 +81,7 @@ END
 
 $MAKE
 $MAKE distdir
-grep fubar foo-0.1/parse.c
+$FGREP fubar $distdir/parse.c
 
 #
 # Now check to make sure that `make dist' will rebuild the parser.
@@ -103,4 +102,6 @@ maude : 'm' 'a' 'u' 'd' 'e' {};
 END
 
 $MAKE distdir
-grep maude foo-0.1/parse.c
+$FGREP maude $distdir/parse.c
+
+: