2 # Copyright (C) 2009-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 parallel-tests features:
18 # - per-extension "test runners" a.k.a. "log compilers" (xxx_LOG_COMPILER
19 # and xxx_LOG_FLAGS), also with AC_SUBST'd stuff.
20 # See also related test 'parallel-tests-log-compiler-2.test'.
25 cat >> configure.ac << 'END'
26 AC_SUBST([acsubst_compiler], [t-compiler])
27 AC_CONFIG_LINKS([chk-compiler:chk-compiler])
31 cat > Makefile.am << 'END'
32 # Note that automake should not match the '/test' part of 'sub/test'
34 TESTS = foo.chk bar.test baz bla.t bli.suff sub/test
36 TEST_EXTENSIONS = .chk .test .t
38 CHK_LOG_COMPILER = ./chk-compiler
39 TEST_LOG_COMPILER = $(SHELL) $(srcdir)/test-compiler
40 T_LOG_COMPILER = @acsubst_compiler@
41 LOG_COMPILER = @SHELL@ -x $(srcdir)/noext-compiler
45 AM_TEST_LOG_FLAGS = --am-test
48 AM_T_LOG_FLAGS = --am-t
53 # 't-compiler' is deliberately not distributed; it should be available
54 # in PATH also from "make distcheck".
55 EXTRA_DIST = $(TESTS) chk-compiler test-compiler noext-compiler
60 cat > chk-compiler <<'END'
62 test x"$1" = x"--chk" || {
63 echo "$0: invalid command line: $*" >&2
70 sed 's/--chk/--am-test/' chk-compiler > test-compiler
73 PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
75 cat > bin/t-compiler <<'END'
77 if test x"$1,$2" != x"--am-t,--t"; then
78 echo "$0: invalid command line: $*" >&2
85 sed 's/--am-t,--t/-a,-b/' bin/t-compiler > noext-compiler
87 chmod a+x chk-compiler chk-compiler test-compiler bin/t-compiler noext-compiler
105 $MAKE check || { cat test-suite.log; Exit 1; }
115 T_LOG_FLAGS=--bad $MAKE -e check && Exit 1
118 # With the above flag overridden, bla.t should fail ...
119 $EGREP '(^ *|/)t-compiler:.* invalid .*--bad' bla.log
120 # ... but no other test should.
121 grep -v '^FAIL: bla\.t ' bla.log | grep 'FAIL:' && Exit 1
123 # Try also with a VPATH build.