| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # Copyright (C) 2003-2025 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 <https://www.gnu.org/licenses/>. |
| 16 | |
| 17 | # Test support for building HTML documentation, and the many |
| 18 | # install-DOC flavors, in VPATH builds. |
| 19 | # Keep in sync with sister test 'txinfo-many-output-formats.sh'. |
| 20 | # FIXME: in the long term, the best thing to do is probably to convert |
| 21 | # FIXME: this test and that sister test to TAP, and merge them. |
| 22 | |
| 23 | required='makeinfo tex texi2dvi' |
| 24 | . test-init.shscip-shell source . . `test-init.sh`. |
| 25 | |
| 26 | catscip-shell system . . cat. >>configure.ac <<\EOF |
| 27 | AC_CONFIG_FILES([rec/Makefile]) |
| 28 | |
| 29 | # At the time of writing, Autoconf does not supplies any of these |
| 30 | # definitions (and those below are purposely not those of the standard). |
| 31 | AC_SUBST([dvidir], ['${datadir}/${PACKAGE}/dvi']) |
| 32 | AC_SUBST([htmldir], ['${datadir}/${PACKAGE}/html']) |
| 33 | AC_SUBST([pdfdir], ['${datadir}/${PACKAGE}/pdf']) |
| 34 | AC_SUBST([psdir], ['${datadir}/${PACKAGE}/ps']) |
| 35 | |
| 36 | AC_OUTPUT |
| 37 | EOF |
| 38 | |
| 39 | catscip-shell system . . cat. > Makefile.am << 'END' |
| 40 | SUBDIRS = rec |
| 41 | info_TEXINFOS = main.texi sub/main2.texi |
| 42 | END |
| 43 | |
| 44 | catscip-shell system . . cat. > main.texi << 'END' |
| 45 | \input texinfo |
| 46 | @setfilename main.info |
| 47 | @settitle main |
| 48 | @node Top |
| 49 | Hello walls. |
| 50 | @bye |
| 51 | END |
| 52 | |
| 53 | mkdirscip-shell system . . mkdir. sub |
| 54 | catscip-shell system . . cat. > sub/main2.texi << 'END' |
| 55 | \input texinfo |
| 56 | @setfilename main2.info |
| 57 | @settitle main2 |
| 58 | @node Top |
| 59 | Hello walls. |
| 60 | @bye |
| 61 | END |
| 62 | |
| 63 | mkdirscip-shell system . . mkdir. rec |
| 64 | catscip-shell system . . cat. > rec/main3.texi << 'END' |
| 65 | \input texinfo |
| 66 | @setfilename main3.info |
| 67 | @settitle main3 |
| 68 | @node Top |
| 69 | Hello walls. |
| 70 | @bye |
| 71 | END |
| 72 | |
| 73 | catscip-shell system . . cat. > rec/Makefile.am << 'END' |
| 74 | info_TEXINFOS = main3.texi |
| 75 | |
| 76 | install-pdf-local: |
| 77 | @$(MKDIR_P) "$(pdfdir)" |
| 78 | : > "$(pdfdir)/hello" |
| 79 | uninstall-local: |
| 80 | rm -f "$(pdfdir)/hello" |
| 81 | |
| 82 | check-local: ps pdf dvi html # For "make distcheck". |
| 83 | END |
| 84 | |
| 85 | $ACLOCAL |
| 86 | $AUTOMAKE --add-missing |
| 87 | $AUTOCONF |
| 88 | |
| 89 | # To simplify syncing with sister test 'txinfo-many-output-formats.sh' |
| 90 | srcdir=.. |
| 91 | |
| 92 | if testscip-shell system . . test. $srcdir = ..; then |
| 93 | mkdirscip-shell system . . mkdir. build |
| 94 | cd build |
| 95 | fi |
| 96 | |
| 97 | $srcdir/configure --prefix="$(pwdscip-shell system . . pwd.)" |
| 98 | |
| 99 | $MAKE |
| 100 | |
| 101 | $sleep |
| 102 | # Test production of split-per-node HTML. |
| 103 | $MAKE html |
| 104 | testscip-shell system . . test. -d main.html |
| 105 | testscip-shell system . . test. -d sub/main2.html |
| 106 | testscip-shell system . . test. -d rec/main3.html |
| 107 | |
| 108 | # Rebuilding main.html should cause its timestamp to be updated. |
| 109 | is_newest main.html $srcdir/main.texi |
| 110 | $sleep |
| 111 | touchscip-shell system . . touch. $srcdir/main.texi |
| 112 | $MAKE html |
| 113 | is_newest main.html $srcdir/main.texi |
| 114 | |
| 115 | $MAKE clean |
| 116 | testscip-shell system . . test. ! -e main.html |
| 117 | testscip-shell system . . test. ! -e sub/main2.html |
| 118 | testscip-shell system . . test. ! -e rec/main3.html |
| 119 | |
| 120 | # Test production of a single HTML file. |
| 121 | run_make MAKEINFOFLAGS=--no-split html |
| 122 | testscip-shell system . . test. -f main.html |
| 123 | testscip-shell system . . test. -f sub/main2.html |
| 124 | testscip-shell system . . test. -f rec/main3.html |
| 125 | $MAKE clean |
| 126 | testscip-shell system . . test. ! -e main.html |
| 127 | testscip-shell system . . test. ! -e sub/main2.html |
| 128 | testscip-shell system . . test. ! -e rec/main3.html |
| 129 | |
| 130 | # Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO. |
| 131 | |
| 132 | cpscip-shell system . . cp. $srcdir/Makefile.am $srcdir/Makefile.sav |
| 133 | catscip-shell system . . cat. >> $srcdir/Makefile.am <<'EOF' |
| 134 | AM_MAKEINFOHTMLFLAGS = --no-headers --no-split |
| 135 | AM_MAKEINFOFLAGS = --unsupported-option |
| 136 | EOF |
| 137 | (cd $srcdir && $AUTOMAKE) |
| 138 | ./config.status Makefile |
| 139 | |
| 140 | $MAKE html |
| 141 | testscip-shell system . . test. -f main.html |
| 142 | testscip-shell system . . test. -f sub/main2.html |
| 143 | testscip-shell system . . test. -d rec/main3.html |
| 144 | $MAKE clean |
| 145 | testscip-shell system . . test. ! -e main.html |
| 146 | testscip-shell system . . test. ! -e sub/main2.html |
| 147 | testscip-shell system . . test. ! -e rec/main3.html |
| 148 | |
| 149 | $MAKE install-html |
| 150 | testscip-shell system . . test. -f share/$me/html/main.html |
| 151 | testscip-shell system . . test. -f share/$me/html/main2.html |
| 152 | testscip-shell system . . test. -d share/$me/html/main3.html |
| 153 | $MAKE uninstall |
| 154 | testscip-shell system . . test. ! -e share/$me/html/main.html |
| 155 | testscip-shell system . . test. ! -e share/$me/html/main2.html |
| 156 | testscip-shell system . . test. ! -e share/$me/html/main3.html |
| 157 | |
| 158 | # Restore the makefile without a broken AM_MAKEINFOFLAGS definition. |
| 159 | # This must happen before processing any non-html targets. See |
| 160 | # https://bugs.gnu.org/30172 |
| 161 | cpscip-shell system . . cp. -f $srcdir/Makefile.sav $srcdir/Makefile.am |
| 162 | (cd $srcdir && $AUTOMAKE) |
| 163 | ./config.status Makefile |
| 164 | |
| 165 | $MAKE dvi |
| 166 | testscip-shell system . . test. -f main.dvi |
| 167 | testscip-shell system . . test. -f sub/main2.dvi |
| 168 | testscip-shell system . . test. -f rec/main3.dvi |
| 169 | $MAKE clean |
| 170 | testscip-shell system . . test. ! -e main.dvi |
| 171 | testscip-shell system . . test. ! -e sub/main2.dvi |
| 172 | testscip-shell system . . test. ! -e rec/main3.dvi |
| 173 | |
| 174 | $MAKE install-dvi |
| 175 | testscip-shell system . . test. -f share/$me/dvi/main.dvi |
| 176 | testscip-shell system . . test. -f share/$me/dvi/main2.dvi |
| 177 | testscip-shell system . . test. -f share/$me/dvi/main3.dvi |
| 178 | $MAKE uninstall |
| 179 | testscip-shell system . . test. ! -e share/$me/dvi/main.dvi |
| 180 | testscip-shell system . . test. ! -e share/$me/dvi/main2.dvi |
| 181 | testscip-shell system . . test. ! -e share/$me/dvi/main3.dvi |
| 182 | |
| 183 | dvips --help || skip_ "dvips is missing" |
| 184 | |
| 185 | $MAKE install-ps |
| 186 | testscip-shell system . . test. -f share/$me/ps/main.ps |
| 187 | testscip-shell system . . test. -f share/$me/ps/main2.ps |
| 188 | testscip-shell system . . test. -f share/$me/ps/main3.ps |
| 189 | $MAKE uninstall |
| 190 | testscip-shell system . . test. ! -e share/$me/ps/main.ps |
| 191 | testscip-shell system . . test. ! -e share/$me/ps/main2.ps |
| 192 | testscip-shell system . . test. ! -e share/$me/ps/main3.ps |
| 193 | |
| 194 | pdfetex --help || pdftex --help \ |
| 195 | || skip_ "pdftex and pdfetex are both missing" |
| 196 | |
| 197 | $MAKE install-pdf |
| 198 | testscip-shell system . . test. -f share/$me/pdf/main.pdf |
| 199 | testscip-shell system . . test. -f share/$me/pdf/main2.pdf |
| 200 | testscip-shell system . . test. -f share/$me/pdf/main3.pdf |
| 201 | testscip-shell system . . test. -f share/$me/pdf/hello |
| 202 | $MAKE uninstall |
| 203 | testscip-shell system . . test. ! -e share/$me/pdf/main.pdf |
| 204 | testscip-shell system . . test. ! -e share/$me/pdf/main2.pdf |
| 205 | testscip-shell system . . test. ! -e share/$me/pdf/main3.pdf |
| 206 | testscip-shell system . . test. ! -e share/$me/pdf/hello |
| 207 | |
| 208 | using_gmake || $MAKE Makefile |
| 209 | $MAKE distcheck |
| 210 | |
| 211 | : |