tests: avoid two spurious failures on FreeBSD
[automake.git] / t / remake-deleted-am-2.sh
blob0b5506270bb86c163b673e5661e1eb702abaa311
1 #! /bin/sh
2 # Copyright (C) 2011-2012 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 # Check that inclusion of '.am' fragments by automake does not suffer
18 # of the "deleted header problem". This test checks deeper inclusion
19 # stacks, and use VPATH builds.
21 . ./defs || exit 1
23 echo AC_OUTPUT >> configure.ac
25 $ACLOCAL
26 $AUTOCONF
28 cat > Makefile.am <<'END'
29 include $(srcdir)/foo.am
30 END
32 cat > foo.am <<'END'
33 # this is foo
34 include sub/bar.am
35 include baz.am
36 END
38 mkdir sub
39 echo 'include $(top_srcdir)/sub/zardoz.am' > sub/bar.am
40 echo '# this is zardoz' > sub/zardoz.am
42 echo 'include fnord.am' > baz.am
43 echo '# you are not seeing this' > fnord.am
45 $AUTOMAKE
46 # Sanity checks.
47 $FGREP 'this is zardoz' Makefile.in
48 $FGREP 'you are not seeing this' Makefile.in
50 mkdir build
51 cd build
53 srcdir=..
55 $srcdir/configure
56 $MAKE
58 $sleep
59 echo '# this is baz' > $srcdir/baz.am
60 rm -f $srcdir/fnord.am
61 $MAKE
62 # Sanity checks.
63 $FGREP 'you are not seeing this' $srcdir/Makefile.in Makefile && exit 1
64 $FGREP 'this is baz' $srcdir/Makefile.in
65 $FGREP 'this is baz' Makefile
67 $sleep
68 rm -rf $srcdir/sub $srcdir/foo.am $srcdir/baz.am
69 echo '# no more inclusions' > $srcdir/Makefile.am
70 $MAKE
71 # Sanity checks.
72 $EGREP 'this is (foo|bar|baz)' Makefile $srcdir/Makefile.in && exit 1
73 $FGREP 'no more inclusions' Makefile