tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / tap-plan-middle.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 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 #  - test plan preceding and/or following non-result TAP lines
19
20 . test-init.sh
21
22 . tap-setup.sh
23
24 cat > top1.test <<END
25 non-TAP line, ignored
26 1..1
27 ok 1
28 END
29
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
41
42 # Try with a blank line too, just to be sure.
43 cat > top3.test <<END
44
45 1..1
46 ok 1
47 END
48
49 cat > bot1.test <<END
50 ok 1 # SKIP
51 1..1
52 bla blah blah ...
53 END
54
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
62
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
70
71 END
72
73 tests=$(echo *.test)
74
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
79
80 :