2 # Copyright (C) 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)
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 # Recursive use of 'check-html'. See Automake bug#11287.
21 # Try the variants that are tried in check-html.am.
23 for r2h in $RST2HTML rst2html rst2html.py; do
24 echo "$me: running $r2h --version"
25 $r2h --version && break 2
26 : For shells with busted 'set -e'.
28 skip_all_ "no proper rst2html program found"
32 cp "$am_top_srcdir"/contrib/check-html.am . \
33 || fatal_ "cannot fetch 'check-html.am' from contrib"
35 cat >> configure.ac << 'END'
36 AM_EXTRA_RECURSIVE_TARGETS([check-html])
37 AC_CONFIG_FILES([sub/Makefile sub/more/Makefile])
41 cat > Makefile.am << 'END'
44 TEST_SUITE_LOG = mylog.log
45 TESTS = foo.test bar.sh mu
49 echo '#!/bin/sh' > $@-t
50 echo 'echo Blah Blah Blah' >> $@-t
54 include $(srcdir)/check-html.am
58 echo SUBDIRS = more > sub/Makefile.am
61 cat > sub/more/Makefile.am << 'END'
62 include $(top_srcdir)/check-html.am
63 TEST_EXTENSIONS = .test .sh
64 TESTS = sh.sh test.test
67 nodist_check_DATA = x.txt
70 CLEANFILES = $(nodist_check_DATA)
74 cat > foo.test <<'END'
89 test -f sub/more/test.log
90 test -f sub/more/sh.log
93 cat > sub/more/test.test << 'END'
102 cat > sub/more/sh.sh << 'END'
110 cat > sub/more/mu << 'END'
115 chmod a+x foo.test bar.sh mu sub/more/test.test sub/more/sh.sh
124 grep 'Blah Blah Blah' mylog.html
125 grep 'this is .*bar\.sh' mylog.html
126 grep 'this is .*test\.test' sub/more/test-suite.html
127 # check-html should cause check_SCRIPTS and check_DATA to be created.
129 test -f sub/more/x.txt
131 # "make clean" should remove HTML files.
134 test ! -e sub/more/test-suite.html
136 test ! -e sub/more/x.txt
138 # Create HTML output for individual tests.
141 $MAKE foo.html bar.sh.html
142 grep 'Blah Blah Blah' foo.html
143 grep 'this is .*bar\.sh' bar.sh.html
146 ocwd=$(pwd) || fatal_ "getting current workind directory"
150 && test ! -e test.html \
152 && grep 'this is .*test\.test' test.html) || exit 1
154 # HTML output removed by mostlyclean.
157 test -f sub/more/test-suite.html
159 find . -name '*.html' | grep . && exit 1