Merge branch 'minor'
[automake.git] / t / tap-plan-middle.sh
blob97c95f34f9d137ce93d4fbcc15beca114fe86af6
1 #! /bin/sh
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)
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 support:
18 # - test plan preceding and/or following non-result TAP lines
20 . test-init.sh
22 . tap-setup.sh
24 cat > top1.test <<END
25 non-TAP line, ignored
26 1..1
27 ok 1
28 END
30 cat > top2.test <<END
31 some
32 non-TAP
33 lines
34 are
35 ignored
36 # and a TAP comment won't cause problems either
37 1..2
38 ok 1
39 ok 2
40 END
42 # Try with a blank line too, just to be sure.
43 cat > top3.test <<END
45 1..1
46 ok 1
47 END
49 cat > bot1.test <<END
50 ok 1 # SKIP
51 1..1
52 bla blah blah ...
53 END
55 cat > bot2.test <<END
56 ok 1
57 ok 2
58 not ok 3 # TODO
59 1..3
60 #@$%! (a cursing comment :-)
61 END
63 # Try with a blank line too, just to be sure.
64 cat > bot3.test <<END
65 ok 1
66 not ok 2 # TODO
67 ok 3 # SKIP
68 ok 4 # SKIP
69 1..4
71 END
73 tests=$(echo *.test)
75 for tap_flags in "" "--comments"; do
76 run_make -O TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" check
77 count_test_results total=12 pass=7 xfail=2 skip=3 fail=0 xpass=0 error=0
78 done