* tests/Makefile.am (TESTS): Added yacc5.test.
[automake.git] / tests / yacc4.test
blob769ca5e3e8862bf62e6c0bd5ba81d7f7504230db
1 #! /bin/sh
3 # Some simple tests of ylwrap functionality.
5 . $srcdir/defs || exit 1
7 # Fail gracefully if no autoconf.
8 $needs_autoconf
9 # Likewise for some other tools.
10 (gcc -v) > /dev/null 2>&1 || exit 77
11 (bison -V) > /dev/null 2>&1 || exit 77
13 cat > configure.in << 'END'
14 AC_INIT
15 AC_CONFIG_AUX_DIR([.])
16 AM_INIT_AUTOMAKE(foo, 0.1)
17 PACKAGE=foo
18 VERSION=0.1
19 AC_PROG_CC
20 AC_PROG_YACC
21 AC_OUTPUT(Makefile)
22 END
24 cat > Makefile.am << 'END'
25 bin_PROGRAMS = foo bar
26 foo_SOURCES = parse.y foo.c
27 bar_SOURCES = bar.y foo.c
28 END
30 # First parser.
31 cat > parse.y << 'END'
33 int yylex () {return 0;}
34 void yyerror (char *s) {}
37 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
38 END
40 # Second parser.
41 cat > bar.y << 'END'
43 int yylex () {return 0;}
44 void yyerror (char *s) {}
47 fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
48 END
50 cat > foo.c << 'END'
51 int main () { return 0; }
52 END
54 # We are not checking Autoconf, so we pick $YACC for it.
55 YACC="bison -y"
56 export YACC
58 set -e
60 $ACLOCAL
61 $AUTOCONF
62 $AUTOMAKE -a
64 test -f ylwrap
66 mkdir sub
67 cd sub
69 ../configure
70 $MAKE
72 grep '^#.*/sub/\.\./' bar.c && exit 1
73 grep '^#.*/sub/\.\./' parse.c && exit 1
75 exit 0