tests: never source test-defs.sh directly, source test-lib.sh instead
[automake.git] / t / txinfo21.sh
blob5a3da1595099cb6ab621a390c1bb288bbb422472
1 #! /bin/sh
2 # Copyright (C) 2003-2012 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 # Test support for building HTML documentation, and the many
18 # install-DOC flavors.
20 required='makeinfo-html tex texi2dvi'
21 . ./defs || exit 1
23 cat >>configure.ac <<\EOF
24 AC_CONFIG_FILES([rec/Makefile])
26 # At the time of writing, Autoconf does not supplies any of these
27 # definitions (and those below are purposely not those of the standard).
28 AC_SUBST([dvidir], ['${datadir}/${PACKAGE}/dvi'])
29 AC_SUBST([htmldir], ['${datadir}/${PACKAGE}/html'])
30 AC_SUBST([pdfdir], ['${datadir}/${PACKAGE}/pdf'])
31 AC_SUBST([psdir], ['${datadir}/${PACKAGE}/ps'])
33 AC_OUTPUT
34 EOF
36 cat > Makefile.am << 'END'
37 SUBDIRS = rec
38 info_TEXINFOS = main.texi sub/main2.texi
39 END
41 cat > main.texi << 'END'
42 \input texinfo
43 @setfilename main.info
44 @settitle main
45 @node Top
46 Hello walls.
47 @bye
48 END
50 mkdir sub
51 cat > sub/main2.texi << 'END'
52 \input texinfo
53 @setfilename main2.info
54 @settitle main2
55 @node Top
56 Hello walls.
57 @bye
58 END
60 mkdir rec
61 cat > rec/main3.texi << 'END'
62 \input texinfo
63 @setfilename main3.info
64 @settitle main3
65 @node Top
66 Hello walls.
67 @bye
68 END
70 cat > rec/Makefile.am << 'END'
71 info_TEXINFOS = main3.texi
73 install-pdf-local:
74 @$(MKDIR_P) "$(pdfdir)"
75 :> "$(pdfdir)/hello"
76 uninstall-local:
77 rm -f "$(pdfdir)/hello"
78 END
80 $ACLOCAL
81 $AUTOMAKE --add-missing
82 $AUTOCONF
84 ./configure
86 $MAKE
88 $sleep
89 # Test production of split-per-node HTML.
90 $MAKE html
91 test -d main.html
92 test -d sub/main2.html
93 test -d rec/main3.html
95 # Rebuilding main.html should cause its timestamp to be updated.
96 is_newest main.html main.texi
97 $sleep
98 touch main.texi
99 $MAKE html
100 is_newest main.html main.texi
102 $MAKE clean
103 test ! -e main.html
104 test ! -e sub/main2.html
105 test ! -e rec/main3.html
107 # Test production of a single HTML file.
108 MAKEINFOFLAGS=--no-split $MAKE -e html
109 test -f main.html
110 test -f sub/main2.html
111 test -f rec/main3.html
112 $MAKE clean
113 test ! -e main.html
114 test ! -e sub/main2.html
115 test ! -e rec/main3.html
117 # Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.
118 cat >>Makefile.am <<\EOF
119 AM_MAKEINFOHTMLFLAGS = --no-headers --no-split
120 AM_MAKEINFOFLAGS = --unsupported-option
122 $AUTOMAKE
123 ./configure --prefix "$(pwd)"
125 $MAKE html
126 test -f main.html
127 test -f sub/main2.html
128 test -d rec/main3.html
129 $MAKE clean
130 test ! -e main.html
131 test ! -e sub/main2.html
132 test ! -e rec/main3.html
134 $MAKE install-html
135 test -f share/$me/html/main.html
136 test -f share/$me/html/main2.html
137 test -d share/$me/html/main3.html
138 $MAKE uninstall
139 test ! -e share/$me/html/main.html
140 test ! -e share/$me/html/main2.html
141 test ! -e share/$me/html/main3.html
143 $MAKE install-dvi
144 test -f share/$me/dvi/main.dvi
145 test -f share/$me/dvi/main2.dvi
146 test -f share/$me/dvi/main3.dvi
147 $MAKE uninstall
148 test ! -e share/$me/dvi/main.dvi
149 test ! -e share/$me/dvi/main2.dvi
150 test ! -e share/$me/dvi/main3.dvi
152 dvips --help || skip_ "dvips is missing"
154 $MAKE install-ps
155 test -f share/$me/ps/main.ps
156 test -f share/$me/ps/main2.ps
157 test -f share/$me/ps/main3.ps
158 $MAKE uninstall
159 test ! -e share/$me/ps/main.ps
160 test ! -e share/$me/ps/main2.ps
161 test ! -e share/$me/ps/main3.ps
163 pdfetex --help || pdftex --help \
164 || skip_ "pdftex and pdfetex are both missing"
166 $MAKE install-pdf
167 test -f share/$me/pdf/main.pdf
168 test -f share/$me/pdf/main2.pdf
169 test -f share/$me/pdf/main3.pdf
170 test -f share/$me/pdf/hello
171 $MAKE uninstall
172 test ! -e share/$me/pdf/main.pdf
173 test ! -e share/$me/pdf/main2.pdf
174 test ! -e share/$me/pdf/main3.pdf
175 test ! -e share/$me/pdf/hello