2 # Copyright (C) 2011 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # This test checks that dependent files are updated before including
18 # in the distribution. `parse.c' depends on `parse.y'. The latter is
19 # updated so that `parse.c' should be rebuilt. Then we are running
20 # `make' and `make distdir' and check whether the version of `parse.c'
21 # to be distributed is up to date.
23 # Please keep this in sync with sister test `yaccvpath.test'.
30 cat >> configure.in << 'END'
36 cat > Makefile.am << 'END'
38 foo_SOURCES = parse.y foo.c
42 # Original parser, with `foobar'
43 cat > parse.y << 'END'
45 int yylex () { return 0; }
46 void yyerror (char *s) {}
50 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
55 int main () { return 0; }
75 # New parser, with `fubar'
76 cat > ../parse.y << 'END'
78 int yylex () { return 0; }
79 void yyerror (char *s) {}
83 fubar : 'f' 'u' 'b' 'a' 'r' {};
88 $FGREP fubar $distdir/parse.c
89 $FGREP FUBAR $distdir/parse.h
91 # Now check to make sure that `make dist' will rebuild the parser.
95 # New parser, with `maude'
96 cat > ../parse.y << 'END'
98 int yylex () { return 0; }
99 void yyerror (char *s) {}
103 maude : 'm' 'a' 'u' 'd' 'e' {};
107 $FGREP maude $distdir/parse.c
108 $FGREP MAUDE $distdir/parse.h