tests: make 'lzip.test' executable
[automake.git] / tests / yaccdry.test
blobd2e76323148bd72c9223ffc06d728e4c358e1776
1 #! /bin/sh
2 # Copyright (C) 2010 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)
7 # any later version.
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 # Removal recovery rules for headers should not remove files with `make -n'.
19 required=bison
20 . ./defs || Exit 1
22 set -e
24 cat >> configure.in << 'END'
25 AC_PROG_CC
26 AC_PROG_YACC
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 AM_YFLAGS = -d
32 bin_PROGRAMS = foo
33 foo_SOURCES = foo.c parse.y
34 END
36 cat > foo.c << 'END'
37 int main () { return 0; }
38 END
40 cat > parse.y << 'END'
42 int yylex () {return 0;}
43 void yyerror (char *s) {}
46 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
47 END
49 $ACLOCAL
50 $AUTOMAKE --add-missing
51 $AUTOCONF
52 ./configure
53 $MAKE
55 rm -f parse.h
56 $MAKE -n parse.h
57 test -f parse.c
58 test ! -f parse.h