test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / t / tap-xfail-tests.sh
blob4c95bd6f12c1b5829aead77f1fe0c4d677a6a1c2
1 #! /bin/sh
2 # Copyright (C) 2011-2024 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 <https://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 . test-init.sh
22 . tap-setup.sh
24 echo 'XFAIL_TESTS = $(TESTS)' >> Makefile
26 cat > all.test <<END
27 1..6
28 ok 1
29 not ok 2
30 ok 3 # TODO
31 not ok 4 # TODO
32 ok 5 # SKIP
33 # The next should count as a failure (and thus will be
34 # rendered into an expected failure by XFAIL_TESTS).
35 not ok 6 # SKIP
36 Bail out!
37 END
39 run_make -O -e FAIL check
40 count_test_results total=7 pass=0 fail=0 xpass=2 xfail=3 skip=1 error=1
42 grep '^XPASS: all\.test 1$' stdout
43 grep '^XFAIL: all\.test 2$' stdout
44 grep '^XPASS: all\.test 3 # TODO' stdout
45 grep '^XFAIL: all\.test 4 # TODO' stdout
46 grep '^SKIP: all\.test 5 # SKIP' stdout
47 grep '^XFAIL: all\.test 6 # SKIP' stdout
48 grep '^ERROR: all\.test - Bail out!' stdout
50 # Check that the exit status of the testsuite is indeed 0 when we
51 # would expect success.
53 cat > all.test <<END
54 1..3
55 not ok 1
56 ok 2 # SKIP
57 not ok 3 # TODO
58 END
60 run_make -O check
61 count_test_results total=3 pass=0 fail=0 xpass=0 xfail=2 skip=1 error=0