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/>.
18 # - A "Bail out!" directive causes the driver to ignore any TAP
19 # result or error in the rest of the following TAP stream.
25 # Various errors that can all be squashed into a single test script.
26 cat > foo.
test << 'END'
29 # All possible test results.
34 # Another bailout directive.
36 # Stop now, with too few tests run.
39 # Tests run after a "SKIP" plan.
40 cat > bar.
test << 'END'
47 cat > baz.
test << 'END'
55 run_make
-e FAIL
-O TESTS
='foo.test bar.test baz.test' check
56 count_test_results total
=5 pass
=1 fail
=0 xpass
=0 xfail
=0 skip
=1 error
=3
58 grep '^ERROR: foo\.test - Bail out!$' stdout
59 grep '^ERROR: bar\.test - Bail out!$' stdout
60 grep '^SKIP: bar\.test' stdout
61 grep '^ERROR: baz\.test - Bail out!$' stdout
62 grep '^PASS: baz\.test 1$' stdout
64 $FGREP 'Not seen' stdout
&& exit 1
66 test $
($FGREP -c ': foo.test' stdout
) -eq 1
67 test $
($FGREP -c ': bar.test' stdout
) -eq 2
68 test $
($FGREP -c ': baz.test' stdout
) -eq 2