test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / txinfo-add-missing-and-dist.sh
1 #! /bin/sh
2 # Copyright (C) 1999-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 # Test to make sure texinfo.tex is correctly installed and disted by
18 # -a when we're using AC_CONFIG_AUX_DIR.  Bug report by by Per
19 # Cederqvist.
20
21 . test-init.sh
22
23 cat > configure.ac << END
24 AC_INIT([$me], [1.0])
25 AC_CONFIG_AUX_DIR([auxdir])
26 AM_INIT_AUTOMAKE
27 AC_CONFIG_FILES([Makefile])
28 AC_OUTPUT
29 END
30
31 cat > Makefile.am << 'END'
32 info_TEXINFOS = textutils.texi
33 .PHONY: test1 test2
34 test1:
35         @echo DISTFILES = $(DISTFILES)
36         echo ' ' $(DISTFILES) ' ' | grep '[ /]auxdir/texinfo\.tex '
37 test2: distdir
38         ls -l $(distdir)/*
39         test -f $(distdir)/auxdir/texinfo.tex
40 END
41
42 echo '@setfilename textutils.info' > textutils.texi
43
44 mkdir auxdir
45
46 $ACLOCAL
47 $AUTOCONF
48 $AUTOMAKE -a
49
50 test -f auxdir/texinfo.tex
51
52 ./configure
53
54 # Create textutils.info by hand, so that we don't have to require
55 # makeinfo.  Also ensure it's really newer than textutils.texi, so
56 # that make won't try to re-create it.
57 $sleep
58 : > textutils.info
59
60 $MAKE test1 test2
61
62 :