2 # Copyright (C) 2011-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 # Check that the parallel-tests driver correctly handle overrides of the
18 # TERM variable by either TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT.
25 TERM=ansi; export TERM
27 # Check that grep can parse nonprinting characters.
28 # BSD 'grep' works from a pipe, but not a seekable file.
29 # GNU or BSD 'grep -a' works on files, but is not portable.
30 case `echo "$esc" | $FGREP "$esc"` in
32 *) skip_ "$FGREP can't parse nonprinting characters" ;;
35 cat >> configure.ac << 'END'
39 cat > Makefile.am << 'END'
40 AM_COLOR_TESTS = always
41 AUTOMAKE_OPTIONS = color-tests
48 test x"$TERM" = x"dumb"
54 if $MAKE "$@" check > stdout; then
70 mkcheck TESTS_ENVIRONMENT='TERM=dumb'
71 cat stdout | grep "PASS.*foobar" | $FGREP "$esc"
73 mkcheck AM_TESTS_ENVIRONMENT='TERM=dumb'
74 cat stdout | grep "PASS.*foobar" | $FGREP "$esc"