test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / man8.sh
1 #! /bin/sh
2 # Copyright (C) 2010-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 # Check for a bug in distcheck w.r.t. generated manpages.
18
19 . test-init.sh
20
21 # Avoid a spurious failure due to a known FreeBSD make incompatibility.
22 useless_vpath_rebuild \
23   && skip_ "VPATH useless rebuild detected (see bug#7884)"
24
25 cat > Makefile.am << 'END'
26 dist_man_MANS = foo.1
27 foo.1:
28 ## This 'rm' command will fail if $(srcdir) is unwritable.
29         rm -f $(srcdir)/$@
30         : > $(srcdir)/$@
31 END
32
33 cat >> configure.ac <<'END'
34 AC_OUTPUT
35 END
36
37 $ACLOCAL
38 $AUTOMAKE
39 $AUTOCONF
40
41 mkdir build
42 cd build
43 ../configure
44
45 $MAKE
46 test -f ../foo.1
47 $MAKE distdir
48 test -f $me-1.0/foo.1
49 $MAKE distcheck
50
51 cd ..
52 rm -f foo.1
53 ./configure
54
55 $MAKE
56 test -f foo.1
57 $MAKE distdir
58 test -f $me-1.0/foo.1
59 $MAKE distcheck
60
61 :