check: separate .log -> .html conversion from core testsuite harness
[automake.git] / tests / parallel-tests2.test
blobaa2afef5e67d311914cac2af5372bf2d7164072b
1 #! /bin/sh
2 # Copyright (C) 2009, 2010 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 # Check parallel-tests features:
18 # - check-html
19 # - recheck-html
21 parallel_tests=yes
22 required=rst2html
23 . ./defs || Exit 1
25 set -e
27 cat >> configure.in << 'END'
28 AC_OUTPUT
29 END
31 cat > Makefile.am << 'END'
32 TEST_SUITE_LOG = mylog.log
33 TESTS = foo.test bar.test baz.test
34 check_SCRIPTS = bla
35 bla:
36 echo bla > $@
37 CLEANFILES = bla
38 END
40 cat >>foo.test <<'END'
41 #! /bin/sh
42 echo "this is $0"
43 test -f bla || exit 1
44 exit 0
45 END
46 cat >>bar.test <<'END'
47 #! /bin/sh
48 echo "this is $0"
49 exit 99
50 END
51 cat >>baz.test <<'END'
52 #! /bin/sh
53 echo "this is $0"
54 exit 1
55 END
56 chmod a+x foo.test bar.test baz.test
58 $ACLOCAL
59 $AUTOCONF
60 $AUTOMAKE -a
62 ./configure
63 $MAKE check-html >stdout && { cat stdout; Exit 1; }
64 cat stdout
65 test -f mylog.html
67 # Always create the HTML output, even if there were no failures.
68 rm -f mylog.html
69 env TESTS=foo.test $MAKE -e check-html >stdout || { cat stdout; Exit 1; }
70 cat stdout
71 test -f mylog.html
73 # Create HTML output also with recheck-html
74 rm -f mylog.html
75 env TESTS=foo.test $MAKE -e recheck-html >stdout || { cat stdout; Exit 1; }
76 cat stdout
77 test -f mylog.html
79 # Create HTML output for an individual test.
80 $MAKE foo.html
81 grep 'this is .*foo\.test' foo.html
82 test ! -f bar.html
83 test ! -f baz.html
85 # Create HTML output for individual tests. Since the pre-existing log
86 # files are expected to be used for the HTML conversion, this should
87 # go smoothly even for failed tests.
88 $MAKE bar.html baz.html
89 grep 'this is .*bar\.test' bar.html
90 grep 'this is .*baz\.test' baz.html
92 # HTML output removed by mostlyclean.
93 $MAKE mostlyclean
94 test ! -f foo.html
95 test ! -f bar.html
96 test ! -f baz.html
97 test ! -f mylog.html
99 # check-html and recheck-html should cause check_SCRIPTS to be created,
100 # and recheck-html should rerun no tests if check has not been run.
101 $MAKE clean
102 env TESTS=foo.test $MAKE -e check-html
103 test -f bla
104 $MAKE clean
105 env TESTS=foo.test $MAKE -e recheck-html
106 test -f bla
107 test ! -f foo.log
108 test -f mylog.html