Merge branch 'yacc-quote-fix'
[automake.git] / tests / tap-no-spurious.test
bloba46ba5c50af3c6d538a5c35d95bfe190fd45586b
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 # - don't spuriously recognize lines that are "almost" TAP lines as
19 # real TAP lines
21 am_parallel_tests=yes
22 . ./defs || Exit 1
24 . "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
26 echo 1..5 > all.test
28 # The only recognized directives are "TODO" and "SKIP".
29 # So the following should count as passed tests.
30 cat >> all.test <<END
31 ok 1 # XFAIL
32 ok 2 # SKIPPED
33 ok 3 # TO DO
34 ok 4 # TODOALL
35 ok 5 # FIXME
36 END
38 # According to documentation of Test::Harness::TAP(3):
40 # ``Lines written to standard output matching /^(not )?ok\b/
41 # must be interpreted as test lines. All other lines must
42 # not be considered test output.''
44 cat >> all.test <<END
46 ok 1
47 ${tab}ok
48 ${tab}ok 1
49 not ok
50 not ok 1
51 ${tab}not ok
52 ${tab}not ok 1
53 notok
54 notok 1
55 not${tab}ok
56 not${tab}ok 1
57 not ok
58 not ok 1
59 no ok
60 no ok 1
61 # ok
62 # not ok
63 # ok 1
64 # not ok 1
65 #ok
66 #not ok
67 #ok 1
68 #not ok 1
69 END
71 set +x # Don't pollute logs too much.
72 for r in 'ok' 'not ok'; do
73 for s1 in \
74 a b c d e f g h i j k l m n o p q r s t u v w x y z \
75 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
76 0 1 2 3 4 5 6 7 8 9 _ ab 0a 23 a1B2c _o _x_y_
78 for s2 in '' @ % + - = / . : \; \* \? \& \! \# \$ \< \> \\; do
79 printf '%s\n' "$r$s1$s2"
80 done
81 done
82 done >> all.test
83 set -x # Reset shell xtraces.
85 # The prove(1) utility doesn't bail out on these, so our driver
86 # shouldn't either.
87 # See comments in `tap-bailout-leading-space.test' for an explanation
88 # of why we don't have a whitespace-prepended "Bail out!" line here.
89 cat >> all.test <<'END'
90 bailout
91 bailout!
92 bail out
93 bail out!
94 Bailout
95 Bailout!
96 Bail out
97 Bail out
98 #Bail out!
99 # Bail out!
102 cat all.test # For debugging.
104 # Minor sanity check.
105 test `grep -c '^ok1$' all.test` -eq 1 \
106 && test `grep -c '^not ok1$' all.test` -eq 1 \
107 || framework_failure_ "creating all.test"
109 $MAKE check >stdout || { cat stdout; Exit 1; }
110 cat stdout
112 count_test_results total=5 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=0