2 # Copyright (C) 2009-2024 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 <https://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.sh'.
24 cat >> configure.ac
<< 'END'
25 AC_SUBST
([acsubst_compiler
], [t-compiler
])
26 AC_CONFIG_LINKS
([chk-compiler
:chk-compiler
])
30 cat > Makefile.am
<< 'END'
31 # Note that automake should not match the '/test' part of 'sub/test'
33 TESTS
= foo.chk bar.
test baz bla.t bli.suff sub
/test
35 TEST_EXTENSIONS
= .chk .
test .t
37 CHK_LOG_COMPILER
= .
/chk-compiler
38 TEST_LOG_COMPILER
= $
(SHELL
) $
(srcdir
)/test-compiler
39 T_LOG_COMPILER
= @acsubst_compiler@
40 LOG_COMPILER
= @SHELL@
-x $
(srcdir
)/noext-compiler
44 AM_TEST_LOG_FLAGS
= --am-test
47 AM_T_LOG_FLAGS
= --am-t
52 # 't-compiler' is deliberately not distributed; it should be available
53 # in PATH also from "make distcheck".
54 EXTRA_DIST
= $
(TESTS
) chk-compiler test-compiler noext-compiler
59 cat > chk-compiler
<<'END'
61 test x"$1" = x"--chk" || {
62 echo "$0: invalid command line: $*" >&2
69 sed 's/--chk/--am-test/' chk-compiler
> test-compiler
72 PATH
=$
(pwd)/bin
$PATH_SEPARATOR$PATH; export PATH
74 cat > bin
/t-compiler
<<'END'
76 if test x"$1,$2" != x"--am-t,--t"; then
77 echo "$0: invalid command line: $*" >&2
84 sed 's/--am-t,--t/-a,-b/' bin
/t-compiler
> noext-compiler
86 chmod a
+x chk-compiler chk-compiler test-compiler bin
/t-compiler noext-compiler
104 $MAKE check ||
{ cat test-suite.log
; exit 1; }
114 run_make
-e FAIL T_LOG_FLAGS
=--bad check
117 # With the above flag overridden, bla.t should fail ...
118 $EGREP '(^ *|/)t-compiler:.* invalid .*--bad' bla.log
119 # ... but no other test should.
120 grep -v '^FAIL: bla\.t ' bla.log |
grep 'FAIL:' && exit 1
122 # Try also with a VPATH build.