configure.ac:
AC_SUBST([LOG_DRIVER], ['unused but required by automake'])
+* The parallel testsuite harness realizes whether an entry of $(TESTS)
+ start with $(srcdir) (as in "TESTS = $(srcdir)/foo.test"), and manages
+ to correctly create the corresponding '.log' and '.trs' files in the
+ build directory rather than in the source directory.
+
* The contents of $(TESTS) are mostly analyzed at make runtime rather
than at automake runtime, so that it is now possible to use GNU make
advanced features (like specific builtins or user-defined functions)
push @test_suffixes, '';
define_variable ('am__test_logs1',
- '$(patsubst %,%.log,$(strip $(TESTS)))',
+ '$(patsubst %,%.log,$(strip $(am__cooked_tests)))',
INTERNAL);
my $nhelper = 1;
foreach my $test_suffix (@test_suffixes)
literal test names, @command{automake} can generate per-target rules
to avoid this limitation.
-@c FIXME: Automake does not warn about these anymore!
-Please note that it is currently not possible to use @code{$(srcdir)/}
-or @code{$(top_srcdir)/} in the @code{TESTS} variable. This technical
-limitation is necessary to avoid generating test logs in the source tree.
-
@node Custom Test Drivers
@section Custom Test Drivers
## of more test metadata, and the use of custom test derivers and protocols
## (among them, TAP).
+# Required to support explicit use of $(srcdir) in TESTS entries.
+# That might actually be very useful in practice, for example in usages
+# like this:
+# TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh)
+# Removing the '$(srcdir)' in there would cause the idiom to break in
+# VPATH builds.
+am__cooked_tests = $(patsubst $(srcdir)/%,%,$(strip $(TESTS)))
+am__cooked_xfail_tests = $(patsubst $(srcdir)/%,%,$(strip $(XFAIL_TESTS)))
+
# Restructured Text title and section.
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
am__rst_section = { sed 'p;s/./=/g;' && echo; }
else \
am__enable_hard_errors=yes; \
fi; \
-case " $(strip $(XFAIL_TESTS)) " in \
+case " $(am__cooked_xfail_tests) " in \
*" $$f "*) am__expect_failure=yes;; \
*) am__expect_failure=no;; \
esac; \
t/interp3.sh \
t/java-nobase.sh \
t/objext-pr10128.sh \
-t/parallel-tests-srcdir-in-test-name.sh \
t/parallel-tests-many.sh \
t/pr8365-remake-timing.sh \
t/remake-am-pr10111.sh \
my_add_dirprefix = $(strip $(1))/$(strip $(2))
EXTRA_DIST = $(TESTS) get-tests-list
TEST_EXTENSIONS = .sh
-TESTS = $(wildcard t[0-9][0-9]*.sh) $(shell $(srcdir)/get-tests-list)
+TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh)
+TESTS += $(shell $(srcdir)/get-tests-list)
TESTS += $(call my_add_dirprefix, t, nosuffix)
-XFAIL_TESTS = $(wildcard t9[0-9]*.sh)
+XFAIL_TESTS = $(wildcard $(srcdir)/t9[0-9]*.sh)
END
$ACLOCAL
$MAKE distcheck > stdout || { cat stdout; Exit 1; }
cat stdout
-# FIXME: this is currently broken, as the $(wildcard ...) call miss the
-# FIXME: $(srcdir) component ...
-#count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0
+count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0
$MAKE check tests1='$(wildcard t00*.sh t98?.sh)' \
tests2='$(shell ./get-tests-list | sed 1d)' \
echo AC_OUTPUT >> configure.ac
cat > Makefile.am << 'END'
-TESTS = $(srcdir)/bar.test $(top_srcdir)/baz.test
+TESTS = \
+ $(srcdir)/foo \
+ @srcdir@/foo2 \
+ @srcdir@/bar.test \
+ ${srcdir}/sub/baz.test \
+ built.test
+
+XFAIL_TESTS = $(srcdir)/bar.test foo2
+
+built.test:
+ (echo '#!/bin/sh' && echo 'exit 77') >$@-t
+ chmod a-w,a+x $@-t && mv -f $@-t $@
+END
+
+cat > foo <<'END'
+#!/bin/sh
+exit 0
+END
+chmod a+x foo
+
+cat > foo2 <<'END'
+#!/bin/sh
+exit 1
END
+chmod a+x foo2
+
+cp foo2 bar.test
+
+mkdir sub
+cp foo sub/baz.test
$ACLOCAL
$AUTOCONF
-AUTOMAKE_fails -a
-grep '$(srcdir).*TESTS.*bar\.test' stderr
-grep '$(top_srcdir).*TESTS.*baz\.test' stderr
+$AUTOMAKE -a
+
+mkdir build
+cd build
+../configure
+$MAKE check
+
+ls -l . .. # For debugging.
+
+test -f built.log
+test -f foo.log
+test -f bar.log
+test -f sub/baz.log
+test -f test-suite.log
+
+test ! -f ../built.log
+test ! -f ../foo.log
+test ! -f ../bar.log
+test ! -f ../sub/baz.log
+test ! -f ../test-suite.log
: