0775f1029381eb073d289d1b31d4ef8be6f7ef7d
[platform/upstream/automake.git] / tests / tap-plan-middle.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 #  - test plan preceding and/or following non-result TAP lines
19
20 am_parallel_tests=yes
21 . ./defs || Exit 1
22
23 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
24
25 cat > top1.test <<END
26 non-TAP line, ignored
27 1..1
28 ok 1
29 END
30
31 cat > top2.test <<END
32 some
33 non-TAP
34 lines
35 are
36 ignored
37 # and a TAP comment won't cause problems either
38 1..2
39 ok 1
40 ok 2
41 END
42
43 # Try with a blank line too, just to be sure.
44 cat > top3.test <<END
45
46 1..1
47 ok 1
48 END
49
50 cat > bot1.test <<END
51 ok 1 # SKIP
52 1..1
53 bla blah blah ...
54 END
55
56 cat > bot2.test <<END
57 ok 1
58 ok 2
59 not ok 3 # TODO
60 1..3
61 #@$%! (a cursing comment :-)
62 END
63
64 # Try with a blank line too, just to be sure.
65 cat > bot3.test <<END
66 ok 1
67 not ok 2 # TODO
68 ok 3 # SKIP
69 ok 4 # SKIP
70 1..4
71
72 END
73
74 tests=`echo *.test`
75
76 for tap_flags in "" "--comments"; do
77   env TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" \
78     $MAKE -e check >stdout || { cat stdout; Exit 1; }
79   cat stdout
80   count_test_results total=12 pass=7 xfail=2 skip=3 fail=0 xpass=0 error=0
81 done
82
83 :