Merge branch 'yacc-quote-fix'
[automake.git] / tests / tap-xfail-tests.test
blob6cede301c2bf81e6eac254300d8e993e21634011
1 #! /bin/sh
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)
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 # TAP and $(XFAIL_TESTS): test results without directives are turned from
18 # PASS to XPASS and from FAIL to XFAIL; other results are unchanged.
20 am_parallel_tests=yes
21 . ./defs || Exit 1
23 . "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
25 echo 'XFAIL_TESTS = $(TESTS)' >> Makefile
27 cat > all.test <<END
28 1..6
29 ok 1
30 not ok 2
31 ok 3 # TODO
32 not ok 4 # TODO
33 ok 5 # SKIP
34 # The next should count as a failure (and thus will be
35 # rendered into an expected failure by XFAIL_TESTS).
36 not ok 6 # SKIP
37 Bail out!
38 END
40 $MAKE check >stdout && { cat stdout; Exit 1; }
41 cat stdout
43 count_test_results total=7 pass=0 fail=0 xpass=2 xfail=3 skip=1 error=1
45 grep '^XPASS: all\.test 1$' stdout
46 grep '^XFAIL: all\.test 2$' stdout
47 grep '^XPASS: all\.test 3 # TODO' stdout
48 grep '^XFAIL: all\.test 4 # TODO' stdout
49 grep '^SKIP: all\.test 5 # SKIP' stdout
50 grep '^XFAIL: all\.test 6 # SKIP' stdout
51 grep '^ERROR: all\.test - Bail out!' stdout
53 # Check that the exit status of the testsuite is indeed 0 when we
54 # would expect success.
56 cat > all.test <<END
57 1..3
58 not ok 1
59 ok 2 # SKIP
60 not ok 3 # TODO
61 END
63 $MAKE check >stdout || { cat stdout; Exit 1; }
64 cat stdout
66 count_test_results total=3 pass=0 fail=0 xpass=0 xfail=2 skip=1 error=0