Merge branch 'rmch'
[platform/upstream/automake.git] / t / parallel-tests-no-color-in-log.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Colorized output from the testsuite report shouldn't end up in log files.
18
19 am_parallel_tests=yes
20 . ./defs || Exit 1
21
22 esc='\e'
23
24 # Check that grep can parse nonprinting characters.
25 # BSD 'grep' works from a pipe, but not a seekable file.
26 # GNU or BSD 'grep -a' works on files, but is not portable.
27 case `echo "$esc" | $FGREP "$esc"` in
28   "$esc") ;;
29 # Creative quoting below to please maintainer-check.
30   *) echo "$me: f""grep can't parse nonprinting characters" >&2; Exit 77;;
31 esac
32
33 TERM=ansi; export TERM
34
35 cat >>configure.ac <<END
36 AC_OUTPUT
37 END
38
39 cat >Makefile.am <<'END'
40 LOG_COMPILER = $(SHELL)
41 AUTOMAKE_OPTIONS = color-tests parallel-tests
42 TESTS = pass fail skip xpass xfail error
43 XFAIL_TESTS = xpass xfail
44 END
45
46 # Creative quoting to please maintainer-check.
47 echo exit '0' > pass
48 echo exit '0' > xpass
49 echo exit '1' > fail
50 echo exit '1' > xfail
51 echo exit '77' > skip
52 echo exit '99' > error
53
54 $ACLOCAL
55 $AUTOCONF
56 $AUTOMAKE --add-missing
57
58 ./configure
59 mv config.log config-log # Avoid possible false positives below.
60 AM_COLOR_TESTS=always $MAKE -e check && Exit 1
61 $FGREP "$esc" *.log && Exit 1
62
63 :