2 # Copyright (C) 2011-2013 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 # Custom test drivers: try the "recheck" functionality with test protocols
18 # that allow multiple testcases in a single test script. This test not
19 # only checks implementation details in Automake's custom test drivers
20 # support, but also serves as a "usability test" for our APIs.
21 # See also related tests 'test-driver-custom-multitest-recheck2.sh'
22 # and 'parallel-tests-recheck-override.sh'.
23 # Keep in sync with 'tap-recheck.sh'.
27 cp "$am_testaux_srcdir"/trivial-test-driver . \
28 || fatal_ "failed to fetch auxiliary script trivial-test-driver"
30 cat >> configure.ac << 'END'
34 cat > Makefile.am << 'END'
35 TEST_LOG_DRIVER = $(SHELL) $(srcdir)/trivial-test-driver
36 TESTS = a.test b.test c.test d.test
59 if test -f c.pass; then
64 if test -f c.xfail; then
75 echo SKIP: who cares ...
76 (. ./d.extra) || echo FAIL: d.extra failed
91 *) fatal_ "invalid usage of function 'do_recheck'";;
94 run_make -O -e $status recheck || { ls -l; exit 1; }
98 for vpath in : false; do
109 : A "make recheck" in a clean tree should run no tests.
110 using_gmake || $sleep # Required by BSD make.
121 count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
123 : Run the tests for the first time.
124 run_make -O -e FAIL check
126 # All the test scripts should have run.
131 count_test_results total=9 pass=3 fail=2 xpass=1 xfail=1 skip=1 error=1
133 : Let us make b.test pass.
134 using_gmake || $sleep # Required by BSD make.
137 # a.test has been successful the first time, so no need to re-run it.
138 # Similar considerations apply to similar checks, below.
143 count_test_results total=7 pass=2 fail=2 xpass=1 xfail=1 skip=1 error=0
145 : Let us make the first part of c.test pass.
146 using_gmake || $sleep # Required by BSD make.
153 count_test_results total=5 pass=1 fail=1 xpass=1 xfail=1 skip=1 error=0
155 : Let us make also the second part of c.test pass.
156 using_gmake || $sleep # Required by BSD make.
163 count_test_results total=5 pass=1 fail=1 xpass=0 xfail=2 skip=1 error=0
165 : Nothing changed, so only d.test should be run.
167 using_gmake || $sleep # Required by BSD make.
173 count_test_results total=2 pass=0 fail=1 xpass=0 xfail=0 skip=1 error=0
176 : Let us make d.test run more testcases, and experience _more_ failures.
177 using_gmake || $sleep # Required by BSD make.
178 unindent > d.extra <<'END'
195 count_test_results total=11 pass=2 fail=4 xpass=1 xfail=0 skip=2 error=2
197 : Let us finally make d.test pass.
198 using_gmake || $sleep # Required by BSD make.
205 count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=0
207 : All tests have been successful or skipped, nothing should be re-run.
208 using_gmake || $sleep # Required by BSD make.
214 count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0