tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / tap-bailout-leading-space.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 # Older versions of prove and TAP::Harness (e.g., 3.17) didn't recognize
18 # a "Bail out!" directive that was preceded by whitespace, but more modern
19 # versions (e.g., 3.23) do.  So we leave this behaviour undefined for the
20 # perl implementation of the Automake TAP driver, but expect the latter,
21 # "more modern" behaviour in our awk TAP driver.
22
23 am_tap_implementation=shell
24 . test-init.sh
25
26 . tap-setup.sh
27
28 cat > a.test <<END
29 1..1
30 ok 1
31  Bail out!
32 END
33
34 cat > b.test <<END
35 1..1
36 ok 1 # SKIP
37 ${tab}Bail out!
38 END
39
40 cat > c.test <<END
41 1..1
42   ${tab}  ${tab}${tab}Bail out!   FUBAR! $tab
43 END
44
45 cat >> exp <<END
46 PASS: a.test 1
47 ERROR: a.test - Bail out!
48 SKIP: b.test 1
49 ERROR: b.test - Bail out!
50 ERROR: c.test - Bail out! FUBAR!
51 END
52
53 run_make -O -e FAIL TESTS='a.test b.test c.test' check
54 count_test_results total=5 pass=1 fail=0 xpass=0 xfail=0 skip=1 error=3
55
56 LC_ALL=C sort exp > t
57 mv -f t exp
58
59 # We need the sort below to account for parallel make usage.
60 grep ': [abcde]\.test' stdout \
61   | sed "s/[ $tab]*#[ $tab]*SKIP.*//" \
62   | LC_ALL=C sort > got
63
64 cat exp
65 cat got
66 diff exp got
67
68 :