docs: deprecate .log -> .html conversion by parallel-tests
[automake.git] / tests / distcleancheck.test
blob0f32e33c4748bcfd07aedf1bd62f1e70eca683d5
1 #! /bin/sh
2 # Copyright (C) 2008, 2009, 2010 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 # Make sure the suggested `distcleancheck_listfiles' in the manual works.
18 # The example Makefile.am we use is from the FAQ entry `distcleancheck'.
20 . ./defs || Exit 1
22 set -e
24 cat >>configure.in << 'END'
25 AC_PROG_CC
26 AC_OUTPUT
27 END
29 cat > Makefile.am << 'END'
30 # This Makefile.am is bogus. See @node{distcleancheck} in the manual
31 # for how to fix it properly.
32 bin_PROGRAMS = foo
33 foo_SOURCES = foo.c
34 dist_man_MANS = foo.1
36 # We write `./foo.1' inside the rule on purpose, to avoid VPATH rewriting
37 # done by some `make' implementations.
38 foo.1: foo$(EXEEXT)
39 echo man page for foo$(EXEEXT) > ./foo.1
41 ## Ignore warnings about overridden variables
42 AUTOMAKE_OPTIONS = -Wno-override
43 distcleancheck_listfiles = \
44 find . -type f -exec sh -c 'test -f $(srcdir)/$$1 || echo $$1' \
45 sh '{}' ';'
46 END
48 cat >foo.c <<'END'
49 int main () { return 0; }
50 END
52 $ACLOCAL
53 $AUTOCONF
54 $AUTOMAKE
56 ./configure
57 $MAKE
58 $MAKE distcheck
60 # Now ensure that we really needed the override.
61 sed '/distcleancheck_listfiles/,$d' Makefile.am > t
62 mv -f t Makefile.am
63 $AUTOMAKE
64 ./configure
65 $MAKE
66 $MAKE distcheck 2>stderr && { cat srderr >&2; Exit 1; }
67 cat stderr >&2
69 grep 'ERROR:.*files left in build directory after distclean' stderr
70 grep '^\./foo\.1$' stderr