2 # Copyright (C) 2011-2013 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)
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: whitespace normalization (or lack thereof) in the testsuite
18 # progress output on console. We keep all of these checks here in a single
19 # script so that a potential cosmetic change in the output format won't
20 # force us to tweak dozens of other tests (hopefully).
21 # See also related test 'tap-todo-skip-whitespace.sh'.
25 cat > Makefile.am << 'END'
26 TEST_LOG_COMPILER = cat
32 spaces_a=${sp}${tab}${tab}${sp}${sp}${tab}
33 spaces_b=${tab}${tab}${sp}${tab}${sp}${sp}${sp}
35 #-----------------------------------------------------------------------
37 echo TESTS += numbers.test >> Makefile.am
39 cat > numbers.test <<END
43 ok${spaces_a}3${spaces_b}
46 not ok${spaces_b}6${spaces_a}
58 #-----------------------------------------------------------------------
60 echo TESTS += description.test >> Makefile.am
62 cat > description.test <<END
66 ok${spaces_a}+baz${spaces_b}
68 not ok -bar${spaces_a}
69 not ok${spaces_b}-baz${spaces_a}
70 ok u${spaces_b}v${spaces_a}w${sp}
71 not ok${spaces_a}x${spaces_a}y${tab}z${tab}
75 PASS: description.test 1 +foo
76 PASS: description.test 2 +bar
77 PASS: description.test 3 +baz
78 FAIL: description.test 4 -foo
79 FAIL: description.test 5 -bar
80 FAIL: description.test 6 -baz
81 PASS: description.test 7 u${spaces_b}v${spaces_a}w
82 FAIL: description.test 8 x${spaces_a}y${tab}z
85 #-----------------------------------------------------------------------
89 echo TESTS += bailout.test >> Makefile.am
91 cat > bailout.test <<END
93 Bail out!${tab}${sp}${sp}${tab}We're out of disk space.
98 ERROR: bailout.test - Bail out! We're out of disk space.
101 echo TESTS += bailout2.test >> Makefile.am
103 cat > bailout2.test <<END
105 Bail out!foo${tab}${sp}
110 ERROR: bailout2.test - Bail out! foo
113 #-----------------------------------------------------------------------
117 echo AM_TEST_LOG_DRIVER_FLAGS = --comments >> Makefile.am
118 echo TESTS += cmnt.test >> Makefile.am
120 cat > cmnt.test <<END
123 #Leading whitespace gets added
124 # ${tab}${tab} ${tab}Extra leading whitespace is stripped
125 # Trailing whitespace is stripped ${tab} ${tab}${tab}
126 # Middle${tab}whitespace is${tab} ${tab}${tab} kept
127 # ${tab} And only${tab}middle ${tab}whitespace ${tab}${tab} ${tab}
132 # cmnt.test: Leading whitespace gets added
133 # cmnt.test: Extra leading whitespace is stripped
134 # cmnt.test: Trailing whitespace is stripped
135 # cmnt.test: Middle${tab}whitespace is${tab} ${tab}${tab} kept
136 # cmnt.test: And only${tab}middle ${tab}whitespace
139 #-----------------------------------------------------------------------
141 # TODO: we should have more checks here ... (but let's not over-do FTM).
143 #-----------------------------------------------------------------------
149 # We don't care about exit status or number of test results, they
150 # should be checked for in many other tests.
151 run_make -O -e FAIL check
153 LC_ALL=C sort exp > t
156 # We need the sort below to account for parallel make usage.
157 LC_ALL=C grep '[a-z0-9][a-z0-9]*\.test' stdout | LC_ALL=C sort > got