tests: more explicative names for some tests
[platform/upstream/automake.git] / t / txinfo-many-output-formats.sh
1 #! /bin/sh
2 # Copyright (C) 2003-2012 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 support for building HTML documentation, and the many
18 # install-DOC flavors.
19
20 required='makeinfo tex texi2dvi'
21 . test-init.sh
22
23 cat >>configure.ac <<\EOF
24 AC_CONFIG_FILES([rec/Makefile])
25
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'])
32
33 AC_OUTPUT
34 EOF
35
36 cat > Makefile.am << 'END'
37 check-local: ps pdf dvi html # For "make distcheck".
38 SUBDIRS = rec
39 info_TEXINFOS = main.texi sub/main2.texi
40 END
41
42 cat > main.texi << 'END'
43 \input texinfo
44 @setfilename main.info
45 @settitle main
46 @node Top
47 Hello walls.
48 @bye
49 END
50
51 mkdir sub
52 cat > sub/main2.texi << 'END'
53 \input texinfo
54 @setfilename main2.info
55 @settitle main2
56 @node Top
57 Hello walls.
58 @bye
59 END
60
61 mkdir rec
62 cat > rec/main3.texi << 'END'
63 \input texinfo
64 @setfilename main3.info
65 @settitle main3
66 @node Top
67 Hello walls.
68 @bye
69 END
70
71 cat > rec/Makefile.am << 'END'
72 info_TEXINFOS = main3.texi
73
74 install-pdf-local:
75         @$(MKDIR_P) "$(pdfdir)"
76         :> "$(pdfdir)/hello"
77 uninstall-local:
78         rm -f "$(pdfdir)/hello"
79
80 check-local: ps pdf dvi html # For "make distcheck".
81 END
82
83 $ACLOCAL
84 $AUTOMAKE --add-missing
85 $AUTOCONF
86
87 ./configure --prefix "$(pwd)"
88
89 $MAKE
90
91 $sleep
92 # Test production of split-per-node HTML.
93 $MAKE html
94 test -d main.html
95 test -d sub/main2.html
96 test -d rec/main3.html
97
98 # Rebuilding main.html should cause its timestamp to be updated.
99 is_newest main.html main.texi
100 $sleep
101 touch main.texi
102 $MAKE html
103 is_newest main.html main.texi
104
105 $MAKE clean
106 test ! -e main.html
107 test ! -e sub/main2.html
108 test ! -e rec/main3.html
109
110 # Test production of a single HTML file.
111 MAKEINFOFLAGS=--no-split $MAKE -e html
112 test -f main.html
113 test -f sub/main2.html
114 test -f rec/main3.html
115 $MAKE clean
116 test ! -e main.html
117 test ! -e sub/main2.html
118 test ! -e rec/main3.html
119
120 # Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.
121
122 cp Makefile.am Makefile.sav
123 cat >>Makefile.am <<\EOF
124 AM_MAKEINFOHTMLFLAGS = --no-headers --no-split
125 AM_MAKEINFOFLAGS = --unsupported-option
126 EOF
127 $AUTOMAKE
128 ./config.status Makefile
129
130 $MAKE html
131 test -f main.html
132 test -f sub/main2.html
133 test -d rec/main3.html
134
135 $MAKE clean
136 test ! -e main.html
137 test ! -e sub/main2.html
138 test ! -e rec/main3.html
139
140 $MAKE install-html
141 test -f share/$me/html/main.html
142 test -f share/$me/html/main2.html
143 test -d share/$me/html/main3.html
144 $MAKE uninstall
145 test ! -e share/$me/html/main.html
146 test ! -e share/$me/html/main2.html
147 test ! -e share/$me/html/main3.html
148
149 $MAKE install-dvi
150 test -f share/$me/dvi/main.dvi
151 test -f share/$me/dvi/main2.dvi
152 test -f share/$me/dvi/main3.dvi
153 $MAKE uninstall
154 test ! -e share/$me/dvi/main.dvi
155 test ! -e share/$me/dvi/main2.dvi
156 test ! -e share/$me/dvi/main3.dvi
157
158 dvips --help || skip_ "dvips is missing"
159
160 $MAKE install-ps
161 test -f share/$me/ps/main.ps
162 test -f share/$me/ps/main2.ps
163 test -f share/$me/ps/main3.ps
164 $MAKE uninstall
165 test ! -e share/$me/ps/main.ps
166 test ! -e share/$me/ps/main2.ps
167 test ! -e share/$me/ps/main3.ps
168
169 pdfetex --help || pdftex --help \
170   || skip_ "pdftex and pdfetex are both missing"
171
172 $MAKE install-pdf
173 test -f share/$me/pdf/main.pdf
174 test -f share/$me/pdf/main2.pdf
175 test -f share/$me/pdf/main3.pdf
176 test -f share/$me/pdf/hello
177 $MAKE uninstall
178 test ! -e share/$me/pdf/main.pdf
179 test ! -e share/$me/pdf/main2.pdf
180 test ! -e share/$me/pdf/main3.pdf
181 test ! -e share/$me/pdf/hello
182
183 # Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
184 mv -f Makefile.sav Makefile.am
185 $AUTOMAKE
186 ./config.status Makefile
187
188 $MAKE distcheck
189
190 :