Merge branch 'maint'
[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 . ./defs || Exit 1
20
21 esc='\e'
22
23 # Check that grep can parse nonprinting characters.
24 # BSD 'grep' works from a pipe, but not a seekable file.
25 # GNU or BSD 'grep -a' works on files, but is not portable.
26 case `echo "$esc" | $FGREP "$esc"` in
27   "$esc") ;;
28 # Creative quoting below to please maintainer-check.
29   *) echo "$me: f""grep can't parse nonprinting characters" >&2; Exit 77;;
30 esac
31
32 TERM=ansi; export TERM
33
34 cat >>configure.ac <<END
35 AC_OUTPUT
36 END
37
38 cat >Makefile.am <<'END'
39 LOG_COMPILER = $(SHELL)
40 AUTOMAKE_OPTIONS = color-tests
41 TESTS = pass fail skip xpass xfail error
42 XFAIL_TESTS = xpass xfail
43 END
44
45 # Creative quoting to please maintainer-check.
46 echo exit '0' > pass
47 echo exit '0' > xpass
48 echo exit '1' > fail
49 echo exit '1' > xfail
50 echo exit '77' > skip
51 echo exit '99' > error
52
53 $ACLOCAL
54 $AUTOCONF
55 $AUTOMAKE --add-missing
56
57 ./configure
58 mv config.log config-log # Avoid possible false positives below.
59 AM_COLOR_TESTS=always $MAKE -e check && Exit 1
60 $FGREP "$esc" *.log && Exit 1
61
62 :