2 # Copyright (C) 2011 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 # Check that the parallel-tests driver correctly handle overrides of the
18 # TERM variable by either TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT.
25 # Check that grep can parse nonprinting characters.
26 # BSD 'grep' works from a pipe, but not a seekable file.
27 # GNU or BSD 'grep -a' works on files, but is not portable.
28 case `echo "$esc" | $FGREP "$esc"` in
30 *) skip_
"$FGREP can't parse nonprinting characters" ;;
33 cat >> configure.
in << 'END'
37 cat > Makefile.am
<< 'END'
38 AM_COLOR_TESTS
= always
39 AUTOMAKE_OPTIONS
= color-tests
46 echo "expected_term='$expected_term'"
47 test x
"$TERM" = x
"$expected_term"
53 if env AM_COLOR_TESTS
=always $
* $MAKE check
> stdout
; then
69 TERM
=ansi
; export TERM
70 expected_term
=dumb
; export expected_term
71 mkcheck TESTS_ENVIRONMENT
='TERM=dumb'
72 cat stdout |
grep "PASS.*foobar" |
$FGREP "$esc"
74 TERM
=dumb
; export TERM
75 expected_term
=ansi
; export expected_term
76 mkcheck TESTS_ENVIRONMENT
='TERM=ansi'
77 cat stdout |
$FGREP "$esc" && Exit
1
79 TERM
=ansi
; export TERM
80 expected_term
=dumb
; export expected_term
81 mkcheck AM_TESTS_ENVIRONMENT
='TERM=dumb'
82 cat stdout |
grep "PASS.*foobar" |
$FGREP "$esc"
84 TERM
=dumb
; export TERM
85 expected_term
=ansi
; export expected_term
86 mkcheck AM_TESTS_ENVIRONMENT
='TERM=ansi'
87 cat stdout |
$FGREP "$esc" && Exit
1