tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / tests / tap-bailout-suppress-later-errors.test
1 #! /bin/sh
2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # TAP support:
18 #  - A "Bail out!" directive causes the driver to ignore any TAP
19 #    result or error in the rest of the following TAP stream.
20
21 am_parallel_tests=yes
22 . ./defs || Exit 1
23
24 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
25
26 # Various errors that can all be squashed into a single test script.
27 cat > foo.test << 'END'
28 1..5
29 Bail out!
30 # All possible test results.
31 # Test out-of-order.
32 ok 4
33 # Extra TAP plan.
34 1..2
35 # Another bailout directive.
36 Bail out! Not seen.
37 # Stop now, with too few tests run.
38 END
39
40 # Tests run after a "SKIP" plan.
41 cat > bar.test << 'END'
42 1..0 # SKIP
43 Bail out!
44 ok 1
45 END
46
47 # Too many tests run.
48 cat > baz.test << 'END'
49 1..1
50 ok 1
51 Bail out!
52 ok 2
53 ok 3
54 END
55
56 TESTS='foo.test bar.test baz.test' $MAKE -e check >stdout \
57   && { cat stdout; Exit 1; }
58 cat stdout
59
60 count_test_results total=5 pass=1 fail=0 xpass=0 xfail=0 skip=1 error=3
61
62 grep '^ERROR: foo\.test - Bail out!$' stdout
63 grep '^ERROR: bar\.test - Bail out!$' stdout
64 grep '^SKIP: bar\.test'               stdout
65 grep '^ERROR: baz\.test - Bail out!$' stdout
66 grep '^PASS: baz\.test 1$'            stdout
67
68 $FGREP 'Not seen' stdout && Exit 1
69
70 test `$FGREP -c ': foo.test' stdout` -eq 1
71 test `$FGREP -c ': bar.test' stdout` -eq 2
72 test `$FGREP -c ': baz.test' stdout` -eq 2
73
74 :