test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / tap-msg0-result.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 #  - the string "0" as a test description
19
20 . test-init.sh
21
22 . tap-setup.sh
23
24 cat > all.test << 'END'
25 1..10
26 ok 1 0
27 ok - 0
28 not ok 3 0
29 not ok - 0
30 ok 5 0 # TODO
31 ok - 0 # TODO
32 not ok 7 0 # TODO
33 not ok - 0 # TODO
34 ok 9 0 # SKIP
35 ok - 0 # SKIP
36 END
37
38 run_make -O -e FAIL check
39 count_test_results total=10 pass=2 fail=2 xpass=2 xfail=2 skip=2 error=0
40
41 cat > exp << 'END'
42 PASS: all.test 1 0
43 PASS: all.test 2 - 0
44 FAIL: all.test 3 0
45 FAIL: all.test 4 - 0
46 XPASS: all.test 5 0 # TODO
47 XPASS: all.test 6 - 0 # TODO
48 XFAIL: all.test 7 0 # TODO
49 XFAIL: all.test 8 - 0 # TODO
50 SKIP: all.test 9 0 # SKIP
51 SKIP: all.test 10 - 0 # SKIP
52 END
53
54 $FGREP ': all.test' stdout > got
55
56 cat exp
57 cat got
58 diff exp got
59
60 :