2001-02-25 Alexandre Duret-Lutz <duret_g@epita.fr>
authorTom Tromey <tromey@redhat.com>
Tue, 27 Feb 2001 04:16:40 +0000 (04:16 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 27 Feb 2001 04:16:40 +0000 (04:16 +0000)
* tests/Makefile.am (TESTS): Added yaccvpath.test.
* tests/yaccvpath.test: New file.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/yaccvpath.test [new file with mode: 0755]

index f97c2c4..715142b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-25  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * tests/Makefile.am (TESTS): Added yaccvpath.test.
+       * tests/yaccvpath.test: New file.
+
 2001-02-26  Akim Demaille  <akim@epita.fr>
 
        * automake.in (&am_install_var): Recognize whether predefined
index c2a270d..f208d72 100644 (file)
@@ -276,7 +276,8 @@ xsource.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
-yaccpp.test
+yaccpp.test \
+yaccpvath.test
 
 EXTRA_DIST = defs ChangeLog-old $(TESTS)
 
index 42f4c86..c99c2ab 100644 (file)
@@ -352,7 +352,8 @@ xsource.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
-yaccpp.test
+yaccpp.test \
+yaccpvath.test
 
 
 EXTRA_DIST = defs ChangeLog-old $(TESTS)
diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test
new file mode 100755 (executable)
index 0000000..ce4645b
--- /dev/null
@@ -0,0 +1,66 @@
+#! /bin/sh
+
+# This attempts to `make distcheck' from a separate directory
+# (i.e. builddir!=srcdir).  Before doing `make distcheck' a parser
+# definition is updated in the srcdir in order to check whether the
+# archived perser is up-to-date or not.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(foo, 0.1)
+PACKAGE=foo
+VERSION=0.1
+AC_PROG_CC
+AC_PROG_YACC
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS= foo
+foo_SOURCES= parse.y foo.c
+END
+
+cat > parse.y << 'END'
+%{
+int yylex () {return 0;}
+void yyerror (char *s) {}
+%}
+%%
+foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+END
+
+cat > foo.c << 'END'
+int main () { return 0; }
+END
+
+# Fail gracefully if no autoconf.
+$needs_autoconf
+# Likewise for gcc.
+(gcc -v) > /dev/null 2>&1 || exit 77
+
+# Remove some files installed by defs.
+# They will be reinstalled by automake.
+rm -f install-sh missing mkinstalldirs
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+$MAKE distclean
+# this should left parse.c in the current directory
+
+cat >> parse.y << 'END'
+fubar : 'f' foobar {};
+END
+
+mkdir sub
+cd sub
+../configure
+$MAKE
+$MAKE distcheck