doc: typos in test file.
[automake.git] / t / dist-missing-included-m4.sh
blob1357a6fe5d8da464d67b6f919ccf789a3b2c79c9
1 #! /bin/sh
2 # Copyright (C) 2011-2024 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 <https://www.gnu.org/licenses/>.
17 # The stub rules emitted to work around the "deleted header problem"
18 # for '.m4' files shouldn't prevent "make" from diagnosing a missing
19 # required '.m4' file from a distribution tarball.
20 # See discussion about automake bug#9768.
21 # See also sister test 'dist-missing-m4.sh'.
23 . test-init.sh
25 cat >> configure.ac <<'END'
26 m4_include([foobar.m4])
27 m4_include([zardoz.m4])
28 AC_OUTPUT
29 END
31 : > foobar.m4
32 : > zardoz.m4
34 : > Makefile.am
36 $ACLOCAL
37 $AUTOCONF
38 $AUTOMAKE
40 ./configure
42 # A faulty distribution tarball, with a required '.m4' file missing.
43 # Building from it should fail, both for in-tree and VPATH builds.
44 ocwd=$(pwd) || fatal_ "cannot get current working directory"
45 for vpath in false :; do
46 $MAKE distdir
47 test -f $distdir/zardoz.m4 # Sanity check.
48 rm -f $distdir/zardoz.m4
49 if $vpath; then
50 # We can't just build in a subdirectory of $distdir, otherwise
51 # we'll hit automake bug#10111.
52 mkdir vpath-distcheck
53 cd vpath-distcheck
54 ../$distdir/configure
55 else
56 cd $distdir
57 ./configure
59 run_make -e FAIL -M
60 # This error will come from automake, not make, so we can be stricter
61 # in our grepping of it.
62 grep 'zardoz\.m4.*does not exist' output
63 grep 'foobar\.m4' output && exit 1 # No spurious error, please.
64 cd "$ocwd" || fatal_ "cannot chdir back to top-level test directory"
65 done