2 # Copyright (C) 2011-2017 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 # Test the 'recheck' target for TAP test protocol.
18 # Keep in sync with 'test-driver-custom-multitest-recheck.sh'.
24 cat >> configure.ac
<<END
28 cat > Makefile.am
<< 'END'
29 TEST_LOG_DRIVER
= $
(srcdir
)/tap-driver
30 TESTS
= a.
test b.
test c.
test d.
test
56 if test -f c.pass
; then
57 echo 'ok - c is ok :-)'
59 echo 'not ok - c is ko :-('
61 if test -f c.xfail
; then
62 echo 'not ok 2 # TODO'
66 echo 'not ok 3 - blah blah # TODO need better diagnostic'
72 test -f .
/d.count
&& . .
/d.count
73 echo 1..
${test_count-2}
74 echo ok
1 '# SKIP: who cares ...'
75 (. .
/d.extra
) ||
echo 'not ok 2 - d.extra failed'
90 *) fatal_
"invalid usage of function 'do_recheck'";;
93 run_make
-O -e $status recheck ||
{ ls -l; exit 1; }
97 for vpath
in : false
; do
108 : A
"make recheck" in a clean tree should run no tests.
119 count_test_results total
=0 pass
=0 fail
=0 xpass
=0 xfail
=0 skip
=0 error
=0
121 : Run the tests
for the first
time.
122 run_make
-O -e FAIL check
124 # All the test scripts should have run.
129 count_test_results total
=9 pass
=3 fail
=2 xpass
=1 xfail
=1 skip
=1 error
=1
131 : Let us
make b.
test pass.
132 using_gmake ||
$sleep # Required by BSD make.
135 # a.test has been successful the first time, so no need to re-run it.
136 # Similar considerations apply to similar checks, below.
141 count_test_results total
=7 pass
=2 fail
=2 xpass
=1 xfail
=1 skip
=1 error
=0
143 : Let us
make the first part of c.
test pass.
144 using_gmake ||
$sleep # Required by BSD make.
151 count_test_results total
=5 pass
=1 fail
=1 xpass
=1 xfail
=1 skip
=1 error
=0
153 : Let us
make also the second part of c.
test pass.
154 using_gmake ||
$sleep # Required by BSD make.
161 count_test_results total
=5 pass
=1 fail
=1 xpass
=0 xfail
=2 skip
=1 error
=0
163 : Nothing changed
, so only d.
test should be run.
165 using_gmake ||
$sleep # Required by BSD make.
171 count_test_results total
=2 pass
=0 fail
=1 xpass
=0 xfail
=0 skip
=1 error
=0
174 : Let us
make d.
test run
more testcases
, and experience _more_ failures.
175 using_gmake ||
$sleep # Required by BSD make.
176 echo 'test_count=9' > d.count
177 unindent
> d.extra
<<'END'
186 echo 'ok' # Extra test.
194 count_test_results total
=11 pass
=2 fail
=4 xpass
=1 xfail
=0 skip
=2 error
=2
196 : Let us finally
make d.
test pass.
197 using_gmake ||
$sleep # Required by BSD make.
198 echo 'test_count=1' > d.count
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