2009-03-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ parallel-tests: warn about $(srcdir), $(top_srcdir) in TESTS.
+ * automake.in (handle_tests): Warn about portability issue
+ concerning generated TESTS files listed with a `$(srcdir)/'
+ or `$(top_srcdir)/' prefix.
+ * doc/automake.texi (TESTS): Document this issue. Mention that
+ the parallel-tests driver is still experimental.
+ * tests/parallel-tests8.test: New test.
+ * tests/Makefile.am: Update.
+
check-html: Always create HTML output, note conversion failure.
* lib/am/check.am (check-html): Create `$(TEST_SUITE_HTML)' in
any case. Exit unsuccessfully if HTML creation failed.
return $obj
if $val =~ /^\@.*\@$/;
$obj =~ s/\$\(EXEEXT\)$//o;
+
+ if ($val =~ /(\$\((top_)?srcdir\))\//o)
+ {
+ msg ('error', $subvar->rdef ($cond)->location,
+ "parallel-tests: using `$1' in TESTS is currently broken: `$val'");
+ }
+
foreach my $test_suffix (@test_suffixes)
{
next
@section Simple tests using @samp{parallel-tests}
@cindex @option{parallel-tests}, Using
+
The option @option{parallel-tests} (@pxref{Options}) enables a test
suite driver that is mostly compatible to the simple test driver
described above, but provides a few more features and slightly different
the @code{check_*} variables are honored, and the environment variable
@env{srcdir} is set during test execution.
+This test driver is still experimental and may undergo changes in order
+to satisfy additional portability requirements.
+
@vindex TEST_SUITE_LOG
@vindex TEST_LOGS
The driver operates by defining a set of @command{make} rules to create
literal test names, @command{automake} can generate per-target rules
to avoid this limitation.
+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
+and has the unfortunate consequence thast it is not possible to specify
+distributed tests that are themselves generated by means of explicit
+rules, in a way that is portable to all @command{make} implementations
+(@pxref{Make Target Lookup,,, autoconf, The Autoconf Manual}, the
+semantics of FreeBSD and OpenBSD @command{make} conflict with this).
+In case of doubt you may want to require to use GNU @command{make},
+or work around the issue with inference rules to generate the tests.
+
@section DejaGnu Tests
parallel-tests5.test \
parallel-tests6.test \
parallel-tests7.test \
+parallel-tests8.test \
parse.test \
percent.test \
percent2.test \
parallel-tests5.test \
parallel-tests6.test \
parallel-tests7.test \
+parallel-tests8.test \
parse.test \
percent.test \
percent2.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check parallel-tests features:
+# - generated distributed tests.
+# - listing $(srcdir)/ or $(top_srcdir)/ in TESTS doesn't work ATM,
+# and is thus diagnosed.
+
+# TODO: this test should also ensure that the `make' implementation
+# properly adheres to rules in all cases. See the Autoconf
+# manual for the ugliness in this area, when VPATH comes into
+# play. :-/
+
+. ./defs-p || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TESTS = foo.test
+## the next line will cause automake to error out:
+TESTS += $(srcdir)/bar.test $(top_srcdir)/baz.test
+.in.test:
+ cp $< $@
+ chmod +x $@
+check_SCRIPTS = $(TESTS)
+EXTRA_DIST = foo.in foo.test
+DISTCLEANFILES = foo.test
+END
+
+cat >>foo.in <<'END'
+#! /bin/sh
+echo "this is $0"
+exit 0
+END
+
+$ACLOCAL
+$AUTOCONF
+AUTOMAKE_fails -a
+grep '(srcdir.*bar' stderr
+grep 'top_srcdir.*baz' stderr
+
+sed '/srcdir/d' < Makefile.am > t
+mv -f t Makefile.am
+$AUTOMAKE -a
+
+./configure
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+mkdir build
+cd build
+../configure
+$MAKE check
+test ! -f ../foo.log
+$MAKE distcheck
+
+: