+2010-03-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Avoid generation of `tests/defs-p' file.
+ * tests/defs.in: In the generated `configure.in' snippet: call
+ `AM_INIT_AUTOMAKE' with the `parallel-tests' option if the shell
+ variable `parallel_tests' is set to `yes'.
+ * tests/Makefile.am (defs-p): Target removed.
+ (check_SCRIPTS): Removed `defs-p'.
+ (clean-local-check): Do not unlink `defs-p' anymore.
+ ($(parallel_tests)): Transformation rules for the test scripts
+ adjusted.
+ * tests/gen-parallel-tests: Selection rules for the test
+ scripts adjusted.
+ * tests/parallel-tests.test: Set `$parallel_tests' to `yes'
+ then include `./defs' (rather than simply including `./defs-p').
+ * tests/parallel-tests2.test: Likewise.
+ * tests/parallel-tests3.test: Likewise.
+ * tests/parallel-tests4.test: Likewise.
+ * tests/parallel-tests5.test: Likewise.
+ * tests/parallel-tests6.test: Likewise.
+ * tests/parallel-tests7.test: Likewise.
+ * tests/parallel-tests8.test: Likewise.
+ * tests/parallel-tests9.test: Likewise.
+ * tests/parallel-tests10.test: Likewise.
+ * tests/README (Section "Writing Test Cases" subsection "Do"):
+ Adjusted the parts referring to tests checking `parallel-tests'
+ behaviour. Some other minor related improvements.
+ * tests/.gitignore (defs-p): Removed.
+
2010-03-04 Stefano Lattarini <stefano.lattarini@gmail.com>
Remove redundant unset of variable TESTS from some test scripts.
aclocal-*
automake-*
defs
-defs-p
parallel-tests.am
*.dir
*.log
$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
- sed 's,^\. \./defs,. ./defs-p,' < $(srcdir)/$$input > $@
+ sed 's|^\. \./defs.*|parallel_tests=yes; &|' \
+ < $(srcdir)/$$input >$@
chmod a+rx $@
MAINTAINERCLEANFILES = $(parallel_tests)
-defs-p: defs Makefile.am
- sed 's,^AM_INIT_AUTOMAKE$$,&([parallel-tests]),' < defs >$@
-
TESTS = \
aclibobj.test \
aclocal.test \
EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
# Each test case depends on defs, aclocal, and automake.
-check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION)
+check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
clean-local: clean-local-check
.PHONY: clean-local-check
find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
rm -rf "$$@"; \
fi;
- -rm -f defs-p
EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
# Each test case depends on defs, aclocal, and automake.
-check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION)
+check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
all: all-am
.SUFFIXES:
$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
- sed 's,^\. \./defs,. ./defs-p,' < $(srcdir)/$$input > $@
+ sed 's|^\. \./defs.*|parallel_tests=yes; &|' \
+ < $(srcdir)/$$input >$@
chmod a+rx $@
-defs-p: defs Makefile.am
- sed 's,^AM_INIT_AUTOMAKE$$,&([parallel-tests]),' < defs >$@
-
clean-local: clean-local-check
.PHONY: clean-local-check
clean-local-check:
find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
rm -rf "$$@"; \
fi;
- -rm -f defs-p
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
Use `required=...' for required tools.
- Include ./defs (see other tests) for normal tests, ./defs-p for tests
- that use the `parallel-tests' option. For the latter, use a name that
- ends in `-p.test' and does not clash with any generated tests in the
- suite.
+ Include ./defs in every test script (see existing tests for examples
+ of how to do this).
- Use `set -e' to catch failures you might not have thought of.
+ For tests that use the `parallel-tests' Automake option, set the shell
+ variable `parallel_tests' to "yes" before including ./defs. Also,
+ use for them a name that ends in `-p.test' and does not clash with any
+ generated tests in the suite.
./defs sets a skeleton configure.in. If possible, append to this
file. In some cases you'll have to overwrite it, but this should
but do not output anything by default. If you need ./configure
to create Makefile, append AC_OUTPUT to configure.in.
+ Use `set -e' to catch failures you might not have thought of.
+
Use $ACLOCAL, $AUTOMAKE, $AUTOCONF, $AUTOUPDATE, $AUTOHEADER,
$PERL, $MAKE, $EGREP, and $FGREP, instead of the corresponding
commands.
# Don't use AC_OUTPUT, but AC_CONFIG_FILES so that appending
# still produces a valid configure.ac. But then, tests running
# config.status really need to append AC_OUTPUT.
-cat > configure.in << END
-AC_INIT([$me], [1.0])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
-END
+{
+ echo "AC_INIT([$me], [1.0])"
+ if test x"$parallel_tests" = x"yes"; then
+ echo "AM_INIT_AUTOMAKE([parallel-tests])"
+ else
+ echo "AM_INIT_AUTOMAKE"
+ fi
+ echo "AC_CONFIG_FILES([Makefile])"
+} >configure.in
# Unset some MAKE... variables that may cause $MAKE to act like a
# recursively invoked sub-make. Any $MAKE invocation in a test is
#! /bin/sh
# Generate parallel-tests.am.
#
+# Copyright (C) 2009, 2010 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 2, 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/>.
+
# For each test in the TESTS list in this Makefile.am file, that itself
# tests features of the TESTS automake interface, generate a sibling
# test that does likewise, but with the option `parallel-tests' enabled.
LC_ALL=C sort -u |
while read tst; do
if grep '^[^#]*parallel-tests' $tst >/dev/null \
- || grep '^\. \./defs-p' $tst >/dev/null
+ || grep "parallel_tests=yes" $tst >/dev/null \
+ || grep "parallel_tests=['\"]yes" $tst >/dev/null
then :; else echo $tst; fi;
done |
{
# - TEST_LOGS
# - RECHECK_LOGS
-. ./defs-p || Exit 1
+parallel_tests=yes
+. ./defs || Exit 1
set -e
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 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
# - trailing whitespace in TESTS
# GNU make 3.80 may expand trailing white space to `.log'.
-. ./defs-p || Exit 1
+parallel_tests=yes
+. ./defs || Exit 1
set -e
cat >> configure.in << 'END'
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 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
# - check-html
# - recheck-html
+parallel_tests=yes
required=rst2html
-. ./defs-p || Exit 1
+. ./defs || Exit 1
set -e
# Check parallel-tests features:
# - concurrent parallel execution
+parallel_tests=yes
required=GNUmake
-. ./defs-p || Exit 1
+. ./defs || Exit 1
# This test does not work well if $MAKE contains -j.
case $MAKE in
# Check parallel-tests features:
# - suffix rules
-. ./defs-p || Exit 1
+parallel_tests=yes
+. ./defs || Exit 1
set -e
cat >> configure.in << 'END'
# Actually, this test doesn't ensure that things happen concurrently.
# It merely serves as demonstration. :-)
+parallel_tests=yes
required=GNUmake
-. ./defs-p || Exit 1
+. ./defs || Exit 1
set -e
# BSD make will expand `$(TESTS:=.log)' to `.log' unless overridden.
# See parallel-tests10.test for a similar issue.
-. ./defs-p || Exit 1
+parallel_tests=yes
+. ./defs || Exit 1
set -e
cat >> configure.in << 'END'
# Check parallel-tests features:
# - per-extension test drivers
-. ./defs-p || Exit 1
+parallel_tests=yes
+. ./defs || Exit 1
set -e
cat >> configure.in << 'END'
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 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
# manual for the ugliness in this area, when VPATH comes into
# play. :-/
-. ./defs-p || Exit 1
+parallel_tests=yes
+. ./defs || Exit 1
set -e
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 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
# Check parallel-tests features:
# - recheck
-. ./defs-p || Exit 1
+parallel_tests=yes
+. ./defs || Exit 1
set -e