tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / t / yacc2.sh
1 #! /bin/sh
2 # Copyright (C) 1999-2012 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Test to make sure intermediate .h file is not generated nor removed
18 # if (AM_)?YFLAGS do not contain -d.  Requested by Jim Meyering.
19 # See also the related semantic test 'yacc-d-basic.test'.
20
21 . ./defs || Exit 1
22
23 cat >> configure.ac << 'END'
24 AC_PROG_CC
25 AC_PROG_YACC
26 END
27
28 # Run it here once and for all, since we are not going to modify
29 # configure.ac anymore.
30 $ACLOCAL
31
32 cat > Makefile.am <<'END'
33 bin_PROGRAMS = zardoz
34 zardoz_SOURCES = zardoz.y
35 END
36
37 # Don't redefine several times the same variable.
38 cp Makefile.am Makefile.src
39
40 $AUTOMAKE -a
41 # If zardoz.h IS mentioned, fail.
42 $FGREP 'zardoz.h' Makefile.in && Exit 1
43
44 cp Makefile.src Makefile.am
45 echo 'AM_YFLAGS = -d' >> Makefile.am
46 $AUTOMAKE
47 # If zardoz.h is NOT mentioned, fail.
48 $FGREP 'zardoz.h' Makefile.in
49
50 cp Makefile.src Makefile.am
51 echo 'AM_YFLAGS = ' >> Makefile.am
52 $AUTOMAKE
53 # If zardoz.h IS mentioned, fail.
54 $FGREP 'zardoz.h' Makefile.in && Exit 1
55
56 cp Makefile.src Makefile.am
57 echo 'YFLAGS = -d' >> Makefile.am
58 # YFLAGS is a user variable.
59 AUTOMAKE_fails
60 grep 'YFLAGS.* user variable' stderr
61 grep 'AM_YFLAGS.* instead' stderr
62 $AUTOMAKE -Wno-gnu
63 # If zardoz.h is NOT mentioned, fail.
64 $FGREP 'zardoz.h' Makefile.in
65
66 cp Makefile.src Makefile.am
67 echo 'YFLAGS = ' >> Makefile.am
68 $AUTOMAKE -Wno-gnu
69 # If zardoz.h IS mentioned, fail.
70 $FGREP 'zardoz.h' Makefile.in && Exit 1
71
72 :