2 # Copyright (C) 2007-2015 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 'color-tests2.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 TESTS = $(check_SCRIPTS)
38 check_SCRIPTS = pass fail skip xpass xfail error
39 XFAIL_TESTS = xpass xfail
64 chmod +x pass fail skip xpass xfail error
68 $AUTOMAKE --add-missing
72 # Not a useless use of cat; see above comments "grep-nonprinting"
73 # requirement in 'test-init.sh'.
74 cat stdout |
grep "^${grn}PASS${std}: .*pass"
75 cat stdout |
grep "^${red}FAIL${std}: .*fail"
76 cat stdout |
grep "^${blu}SKIP${std}: .*skip"
77 cat stdout |
grep "^${lgn}XFAIL${std}: .*xfail"
78 cat stdout |
grep "^${red}XPASS${std}: .*xpass"
79 # The old serial testsuite driver doesn't distinguish between failures
81 if test x
"$am_serial_tests" = x
"yes"; then
82 cat stdout |
grep "^${red}FAIL${std}: .*error"
84 cat stdout |
grep "^${mgn}ERROR${std}: .*error"
91 # With make implementations that, like Solaris make, in case of errors
92 # print the whole failing recipe on standard output, we should content
93 # ourselves with a laxer check, to avoid false positives.
94 # Keep this in sync with lib/am/check.am:$(am__color_tests).
95 if $FGREP '= Xalways; then' stdout
; then
96 # Extra verbose make, resort to laxer checks.
97 # Note that we also want to check that the testsuite summary is
98 # not unduly colorized.
100 set +e
# In case some grepped regex below isn't matched.
101 # Not a useless use of cat; see above comments "grep-nonprinting"
102 # requirement in 'test-init.sh'.
103 cat stdout |
grep "TOTAL.*:"
104 cat stdout |
grep "PASS.*:"
105 cat stdout |
grep "FAIL.*:"
106 cat stdout |
grep "SKIP.*:"
107 cat stdout |
grep "XFAIL.*:"
108 cat stdout |
grep "XPASS.*:"
109 cat stdout |
grep "ERROR.*:"
110 cat stdout |
grep 'test.*expected'
111 cat stdout |
grep 'test.*not run'
112 cat stdout |
grep '===='
113 cat stdout |
grep '[Ss]ee .*test-suite\.log'
114 cat stdout |
grep '[Tt]estsuite summary'
115 ) |
grep "$esc" && exit 1
116 : For shells with broken
'set -e'
118 cat stdout |
grep "$esc" && exit 1
119 : For shells with broken
'set -e'
123 for vpath
in false
:; do
135 # Forced colorization should take place also with non-ANSI terminals;
136 # hence the "TERM=dumb" definition.
137 AM_COLOR_TESTS
=always
; export AM_COLOR_TESTS
138 run_make
-e FAIL
-O TERM
=dumb check
142 run_make
-e FAIL
-O TERM
=ansi check