Merge branch 'yacc-quote-fix'
[automake.git] / tests / txinfo21.test
blob5e1148c752b921a681a3f38c7da21cb0f3c62cd5
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.in <<\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 ! -d main.html
104 test ! -d sub/main2.html
105 test ! -d 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 ! -f main.html
114 test ! -f sub/main2.html
115 test ! -f 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`"
124 $MAKE html
125 test -f main.html
126 test -f sub/main2.html
127 test -d rec/main3.html
128 $MAKE clean
129 test ! -f main.html
130 test ! -f sub/main2.html
131 test ! -d rec/main3.html
133 $MAKE install-html
134 test -f share/$me/html/main.html
135 test -f share/$me/html/main2.html
136 test -d share/$me/html/main3.html
137 $MAKE uninstall
138 test ! -f share/$me/html/main.html
139 test ! -f share/$me/html/main2.html
140 test ! -d share/$me/html/main3.html
142 $MAKE install-dvi
143 test -f share/$me/dvi/main.dvi
144 test -f share/$me/dvi/main2.dvi
145 test -f share/$me/dvi/main3.dvi
146 $MAKE uninstall
147 test ! -f share/$me/dvi/main.dvi
148 test ! -f share/$me/dvi/main2.dvi
149 test ! -f share/$me/dvi/main3.dvi
151 dvips --help || skip_ "dvips is missing"
153 $MAKE install-ps
154 test -f share/$me/ps/main.ps
155 test -f share/$me/ps/main2.ps
156 test -f share/$me/ps/main3.ps
157 $MAKE uninstall
158 test ! -f share/$me/ps/main.ps
159 test ! -f share/$me/ps/main2.ps
160 test ! -f share/$me/ps/main3.ps
162 pdfetex --help || pdftex --help \
163 || skip_ "pdftex and pdfetex are both missing"
165 $MAKE install-pdf
166 test -f share/$me/pdf/main.pdf
167 test -f share/$me/pdf/main2.pdf
168 test -f share/$me/pdf/main3.pdf
169 test -f share/$me/pdf/hello
170 $MAKE uninstall
171 test ! -f share/$me/pdf/main.pdf
172 test ! -f share/$me/pdf/main2.pdf
173 test ! -f share/$me/pdf/main3.pdf
174 test ! -f share/$me/pdf/hello