2 # Copyright (C) 2007, 2008 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 3, 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.
32 # Check that grep can parse nonprinting characters.
33 # BSD 'grep' works from a pipe, but not a seekable file.
34 # GNU or BSD 'grep -a' works on files, but is not portable.
35 case `echo "$std" | grep .` in
40 cat >>configure.
in <<END
44 cat >Makefile.am
<<'END'
45 AUTOMAKE_OPTIONS = color-tests
46 TESTS = $(check_SCRIPTS)
47 check_SCRIPTS = pass fail skip xpass xfail
48 XFAIL_TESTS = xpass xfail
68 chmod +x pass fail skip xpass xfail
77 # Not a useless use of cat; see above comments about grep.
78 cat stdout |
grep ": pass" |
$FGREP "$grn"
79 cat stdout |
grep ": fail" |
$FGREP "$red"
80 cat stdout |
grep ": xfail" |
$FGREP "$lgn"
81 cat stdout |
grep ": xpass" |
$FGREP "$red"
82 cat stdout |
grep ": skip" |
$FGREP "$blu"
87 # Not a useless use of cat; see above comments about grep.
88 cat stdout |
grep ": pass" |
$FGREP "$grn" && exit 1
89 cat stdout |
grep ": fail" |
$FGREP "$red" && exit 1
90 cat stdout |
grep ": xfail" |
$FGREP "$lgn" && exit 1
91 cat stdout |
grep ": xpass" |
$FGREP "$red" && exit 1
92 cat stdout |
grep ": skip" |
$FGREP "$blu" && exit 1
96 cat >expect-make
<<'END'
98 spawn $env(MAKE) -e check
104 AM_COLOR_TESTS
=always
$MAKE -e check
>stdout
&& { cat stdout
; exit 1; }
108 MAKE
=$MAKE expect
-f expect-make
>stdout ||
exit 77
112 AM_COLOR_TESTS
=no MAKE
=$MAKE expect
-f expect-make
>stdout ||
exit 77