2 # Copyright (C) 2007-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)
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 # Test Automake TESTS color output, by forcing it.
18 # Keep this in sync with the sister test 'color2.sh'.
20 required
='grep-nonprint'
21 # For gen-testsuite-part: ==> try-with-serial-tests <==
24 # Escape '[' for grep, below.
32 cat >>configure.ac
<<END
36 cat >Makefile.am
<<'END'
37 AUTOMAKE_OPTIONS = color-tests
38 TESTS = $(check_SCRIPTS)
39 check_SCRIPTS = pass fail skip xpass xfail error
40 XFAIL_TESTS = xpass xfail
65 chmod +x pass fail skip xpass xfail error
69 $AUTOMAKE --add-missing
73 # Not a useless use of cat; see above comments "grep-nonprinting"
74 # requirement in 'test-init.sh'.
75 cat stdout |
grep "^${grn}PASS${std}: .*pass"
76 cat stdout |
grep "^${red}FAIL${std}: .*fail"
77 cat stdout |
grep "^${blu}SKIP${std}: .*skip"
78 cat stdout |
grep "^${lgn}XFAIL${std}: .*xfail"
79 cat stdout |
grep "^${red}XPASS${std}: .*xpass"
80 # The old serial testsuite driver doesn't distinguish between failures
82 if test x
"$am_serial_tests" = x
"yes"; then
83 cat stdout |
grep "^${red}FAIL${std}: .*error"
85 cat stdout |
grep "^${mgn}ERROR${std}: .*error"
92 # With make implementations that, like Solaris make, in case of errors
93 # print the whole failing recipe on standard output, we should content
94 # ourselves with a laxer check, to avoid false positives.
95 # Keep this in sync with lib/am/check.am:$(am__color_tests).
96 if $FGREP '= Xalways; then' stdout
; then
97 # Extra verbose make, resort to laxer checks.
98 # Note that we also want to check that the testsuite summary is
99 # not unduly colorized.
101 set +e
# In case some grepped regex below isn't matched.
102 # Not a useless use of cat; see above comments "grep-nonprinting"
103 # requirement in 'test-init.sh'.
104 cat stdout |
grep "TOTAL.*:"
105 cat stdout |
grep "PASS.*:"
106 cat stdout |
grep "FAIL.*:"
107 cat stdout |
grep "SKIP.*:"
108 cat stdout |
grep "XFAIL.*:"
109 cat stdout |
grep "XPASS.*:"
110 cat stdout |
grep "ERROR.*:"
111 cat stdout |
grep 'test.*expected'
112 cat stdout |
grep 'test.*not run'
113 cat stdout |
grep '===='
114 cat stdout |
grep '[Ss]ee .*test-suite\.log'
115 cat stdout |
grep '[Tt]estsuite summary'
116 ) |
grep "$esc" && exit 1
117 : For shells with broken
'set -e'
119 cat stdout |
grep "$esc" && exit 1
120 : For shells with broken
'set -e'
124 for vpath
in false
:; do
136 # Forced colorization should take place also with non-ANSI terminals;
137 # hence the "TERM=dumb" definition.
138 TERM
=dumb AM_COLOR_TESTS
=always
$MAKE -e check
>stdout \
139 && { cat stdout
; exit 1; }
143 TERM
=ansi
$MAKE -e check
>stdout
&& { cat stdout
; exit 1; }