tests: expose automake bug#14560
[platform/upstream/automake.git] / t / deleted-m4.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 '.m4' 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 cat >> configure.ac <<'END'
25 m4_include([foobar.m4])
26 AC_OUTPUT
27 END
28
29 : > Makefile.am
30
31 echo 'm4_include([zardoz.m4])' > foobar.m4
32 : > zardoz.m4
33
34 $ACLOCAL
35 $AUTOCONF
36 $AUTOMAKE
37
38 ./configure
39 $MAKE
40
41 rm -f zardoz.m4
42 run_make -e FAIL -M
43 # This error will come from aclocal, not make, so we can be stricter
44 # in our grepping of it.
45 grep ' foobar\.m4:1:.*zardoz\.m4.*does not exist' output
46 # No spurious errors, please.
47 $FGREP -v ' foobar.m4:1:' output | $FGREP 'foobar.m4' && exit 1
48
49 # Try with one less indirection.
50 : > foobar.m4
51 $ACLOCAL --force
52 $AUTOCONF
53 ./configure
54 $MAKE # Sanity check.
55 rm -f foobar.m4
56 run_make -e FAIL -M
57 # This error will come from aclocal, not make, so we can be stricter
58 # in our grepping of it.
59 grep 'foobar\.m4.*does not exist' output
60 # No spurious errors, please (ok, this is really paranoid).
61 $FGREP 'zardoz.m4' output && exit 1
62
63 :