tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / tap-numeric-description.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 result lines whose description is a number.
18
19 . test-init.sh
20
21 . tap-setup.sh
22
23 # Some random numbers to be used as test names.  The definitions below are
24 # selected so that $x<n> != <n> for every n >= 1.  We can't use positional
25 # parameters for this unfortunately, since Solaris 10 /bin/sh doesn't allow
26 # the dereferencing of parameters from ${10} onwards.
27 x1=5 x2=7 x3=45 x4=11 x5=7 x6=3 x7=6 x8=9 x9=1000 x10=1
28
29 cat > all.test <<END
30 1..10
31 ok 1 ${x1}
32 ok - ${x2}
33 not ok 3 ${x3}
34 not ok - ${x4}
35 ok 5 ${x5} # SKIP
36 ok - ${x6} # SKIP
37 not ok 7 ${x7} # TODO
38 not ok - ${x8} # TODO
39 ok 9 ${x9} # TODO
40 ok - ${x10} # TODO
41 END
42
43 cat > exp <<END
44 PASS: all.test 1 ${x1}
45 PASS: all.test 2 - ${x2}
46 FAIL: all.test 3 ${x3}
47 FAIL: all.test 4 - ${x4}
48 SKIP: all.test 5 ${x5} # SKIP
49 SKIP: all.test 6 - ${x6} # SKIP
50 XFAIL: all.test 7 ${x7} # TODO
51 XFAIL: all.test 8 - ${x8} # TODO
52 XPASS: all.test 9 ${x9} # TODO
53 XPASS: all.test 10 - ${x10} # TODO
54 END
55
56 run_make -O -e FAIL check
57 count_test_results total=10 pass=2 fail=2 xpass=2 xfail=2 skip=2 error=0
58
59 $FGREP ': all.test' stdout > got
60
61 cat exp
62 cat got
63 diff exp got
64
65
66 :