4e88f3de04bb57ca4cc96ddc011f64cc31a3b7d5
[platform/upstream/automake.git] / t / tap-autonumber.sh
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 #  - unnumbered tests are OK, as long as their final total number
19 #    agrees with the plan
20 #  - test results without number get automatically numbered in the
21 #    console progress output
22
23 am_parallel_tests=yes
24 . ./defs || Exit 1
25
26 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
27
28 cat > all.test <<'END'
29 1..14
30 ok
31 ok foo
32 ok - foo2
33 not ok
34 not ok bar
35 not ok - bar2
36 ; See that we can intermingle different kind of results without
37 ; messing up the autonumbering
38 ok
39 ok # TODO
40 not ok # TODO who cares?
41 ok
42 not ok
43 ok muuu # SKIP
44 not ok
45 ok
46 END
47
48 TESTS=all.test $MAKE -e check >stdout && { cat stdout; Exit 1; }
49 cat stdout
50 count_test_results total=14 pass=6 fail=5 xpass=1 xfail=1 skip=1 error=0
51
52 cat > exp <<'END'
53 PASS: all.test 1
54 PASS: all.test 2 foo
55 PASS: all.test 3 - foo2
56 FAIL: all.test 4
57 FAIL: all.test 5 bar
58 FAIL: all.test 6 - bar2
59 PASS: all.test 7
60 XPASS: all.test 8 # TODO
61 XFAIL: all.test 9 # TODO who cares?
62 PASS: all.test 10
63 FAIL: all.test 11
64 SKIP: all.test 12 muuu # SKIP
65 FAIL: all.test 13
66 PASS: all.test 14
67 END
68
69 $FGREP ': all.test' stdout > got
70
71 cat exp
72 cat got
73 diff exp got
74
75 :