2 # Copyright (C) 2011-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/>.
18 # - unplanned tests are properly reported as errors
23 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
30 $MAKE check >stdout && { cat stdout; Exit 1; }
32 count_test_results total=3 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=2
33 grep '^ERROR: all\.test - too many tests run (expected 1, got 2)$' stdout
34 grep '^ERROR: all\.test 2 # UNPLANNED$' stdout
42 $MAKE check >stdout && { cat stdout; Exit 1; }
44 count_test_results total=4 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=2
45 grep '^ERROR: all\.test - too many tests run (expected 2, got 3)$' stdout
46 grep '^ERROR: all\.test 3 # UNPLANNED$' stdout
48 # Interaction with XFAIL_TESTS.
57 XFAIL_TESTS=all.test $MAKE -e check >stdout && { cat stdout; Exit 1; }
59 count_test_results total=6 pass=0 fail=0 xpass=0 xfail=1 skip=1 error=4
60 grep '^ERROR: all\.test - too many tests run (expected 2, got 5)$' stdout
61 grep '^ERROR: all\.test 3 # UNPLANNED$' stdout
62 grep '^ERROR: all\.test 4 # UNPLANNED$' stdout
63 grep '^ERROR: all\.test 5 # UNPLANNED$' stdout
82 ok 13 - bar bar # TODO
87 not ok 17 - bar bar # TODO
92 ok 21 - bar bar # SKIP
124 $MAKE check >stdout && { cat stdout; Exit 1; }
126 count_test_results total=22 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=21
128 echo 'PASS: all.test 1' > exp
129 sed -e '/^$/d' -e 's/.*/ERROR: all.test & # UNPLANNED/' t >> exp
130 echo 'ERROR: all.test - too many tests run (expected 1, got 21)' >> exp
132 $FGREP ': all.test' stdout > got
138 # Note that, if the TAP input has a trailing plan, it is not possible
139 # to flag unplanned tests as such, since we do not know they're unplanned
140 # until the plan is reached; still, we should give at least an error
141 # message about the unmatched number of tests once we've got the plan.
143 for x in 'ok' 'ok 3' 'not ok' 'not ok # TODO' 'ok # TODO' 'ok # SKIP'; do
144 unindent > all.test <<END
150 $MAKE check >stdout && { cat stdout; Exit 1; }
152 test `$FGREP -c ': all.test' stdout` -eq 4
153 $EGREP '^PASS: all\.test 1($| )' stdout
154 $EGREP '^SKIP: all\.test 2($| )' stdout
155 $EGREP ': all\.test 3($| )' stdout
156 grep '^ERROR: all\.test - too many tests run (expected 2, got 3)$' stdout