tests: expose automake bug#13940
[platform/upstream/automake.git] / t / deleted-am.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 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 # The stub rules emitted to work around the "deleted header problem"
18 # for '.am' files shouldn't prevent the remake rules from correctly
19 # erroring out when a still-required file is missing.
20 # See also discussion about automake bug#9768.
21
22 . test-init.sh
23
24 echo AC_OUTPUT >> configure.ac
25
26 echo 'include $(top_srcdir)/foobar.am' > Makefile.am
27 echo 'include zardoz.am' > foobar.am
28 : > zardoz.am
29
30 $ACLOCAL
31 $AUTOCONF
32 $AUTOMAKE
33
34 ./configure
35 $MAKE
36
37 rm -f zardoz.am
38 using_gmake || $sleep # Required by BSD make.
39 run_make -e FAIL -M
40 # This error will come from automake, not make, so we can be stricter
41 # in our grepping of it.
42 grep 'cannot open.*zardoz\.am' output
43 grep 'foobar\.am' output && exit 1 # No spurious error, please.
44
45 # Try with one less indirection.
46 : > foobar.am
47 $AUTOMAKE Makefile
48 ./config.status Makefile
49 $MAKE # Sanity check.
50 rm -f foobar.am
51 using_gmake || $sleep # Required by BSD make.
52 run_make -e FAIL -M
53 # This error will come from automake, not make, so we can be stricter
54 # in our grepping of it.
55 grep 'cannot open.*foobar\.am' output
56
57 :