tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / tap-numbers-leading-zero.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 #  - how does TAP result numbers with leading zero fares?
19
20 . test-init.sh
21
22 . tap-setup.sh
23
24 do_checks ()
25 {
26   run_make -O -e FAIL check
27   count_test_results "$@"
28   # Allow some normalization of leading zeros, without forcing it.
29   LC_ALL=C sed -n 's/: all\.test 0*\([0-9]\)/: all.test \1/p' stdout > got
30   cat exp
31   cat got
32   diff exp got
33 }
34
35 cat > all.test <<END
36 1..15
37
38 ok 01
39 ok 0002
40
41 not ok 03
42 not ok 0004
43
44 ok 05 # SKIP
45 ok 0006 # SKIP
46
47 not ok 07 # TODO
48 not ok 0008 # TODO
49
50 ok 009
51 ok 010
52
53 ok 00000011
54 not ok 0012
55 ok 00000013 # SKIP
56 not ok 0014 # TODO
57 ok 00000015 # TODO
58 END
59
60 cat > exp <<END
61 PASS: all.test 1
62 PASS: all.test 2
63 FAIL: all.test 3
64 FAIL: all.test 4
65 SKIP: all.test 5 # SKIP
66 SKIP: all.test 6 # SKIP
67 XFAIL: all.test 7 # TODO
68 XFAIL: all.test 8 # TODO
69 PASS: all.test 9
70 PASS: all.test 10
71 PASS: all.test 11
72 FAIL: all.test 12
73 SKIP: all.test 13 # SKIP
74 XFAIL: all.test 14 # TODO
75 XPASS: all.test 15 # TODO
76 END
77
78 do_checks total=15 pass=5 fail=3 xpass=1 xfail=3 skip=3 error=0
79
80 cat > all.test <<END
81 1..8
82
83 ok 010
84 not ok 003
85 ok 0001 # SKIP
86 not ok 010 # TODO
87 ok 00100 # TODO
88
89 ok 06
90 ok 00007
91 ok 8
92 END
93
94 cat > exp <<END
95 ERROR: all.test 10 # OUT-OF-ORDER (expecting 1)
96 ERROR: all.test 3 # OUT-OF-ORDER (expecting 2)
97 ERROR: all.test 1 # OUT-OF-ORDER (expecting 3)
98 ERROR: all.test 10 # OUT-OF-ORDER (expecting 4)
99 ERROR: all.test 100 # OUT-OF-ORDER (expecting 5)
100 PASS: all.test 6
101 PASS: all.test 7
102 PASS: all.test 8
103 END
104
105 do_checks total=8 pass=3 fail=0 xpass=0 xfail=0 skip=0 error=5
106
107 :