readme: fixlets to HACKING
[automake.git] / t / tap-out-of-order.sh
blobff0e8061423be5ad2a654cb3007cbad5195b400e
1 #! /bin/sh
2 # Copyright (C) 2011-2012 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 <http://www.gnu.org/licenses/>.
17 # TAP support:
18 # - out-of-order test results
20 . ./defs || exit 1
22 . tap-setup.sh
24 cat > a.test <<END
25 1..3
27 not ok 2 # TODO
28 ok 71
29 END
31 cat > b.test <<END
32 1..5
33 ok 1
34 ok 2
35 ok 4 foo # SKIP mu
36 not ok 2 bar # TODO um
37 ok 5
38 END
40 cat > c.test <<END
41 1..4
42 ok 1
43 ok foo
44 ok 4 - zardoz
45 not ok 3
46 END
48 # This is documented as an "test out of sequence" error in the
49 # TAP::Parser documentation. Keep it in sync with the example
50 # there.
51 cat > d.test <<'END'
52 1..5
53 ok 1
54 ok 2
55 ok 15
56 ok 16
57 ok 17
58 END
60 TESTS='a.test b.test c.test d.test' $MAKE -e check >stdout \
61 && { cat stdout; exit 1; }
62 cat stdout
64 count_test_results total=17 pass=8 fail=0 xpass=0 xfail=1 skip=0 error=8
66 test $($FGREP -c ': a.test' stdout) -eq 3
67 test $($FGREP -c ': b.test' stdout) -eq 5
68 test $($FGREP -c ': c.test' stdout) -eq 4
69 test $($FGREP -c ': d.test' stdout) -eq 5
71 grep '^ERROR: a\.test 71 # OUT-OF-ORDER (expecting 3)$' stdout
72 grep '^ERROR: b\.test 4 foo # OUT-OF-ORDER (expecting 3)$' stdout
73 grep '^ERROR: b\.test 2 bar # OUT-OF-ORDER (expecting 4)$' stdout
74 grep '^ERROR: c\.test 4 - zardoz # OUT-OF-ORDER (expecting 3)$' stdout
75 grep '^ERROR: c\.test 3 # OUT-OF-ORDER (expecting 4)$' stdout
76 grep '^ERROR: d\.test 15 # OUT-OF-ORDER (expecting 3)$' stdout
77 grep '^ERROR: d\.test 16 # OUT-OF-ORDER (expecting 4)$' stdout
78 grep '^ERROR: d\.test 17 # OUT-OF-ORDER (expecting 5)$' stdout