+2011-08-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: optimize tests on TAP for speed and against duplication
+ The creation and configuration of common files and data used by
+ many tests on TAP is, with this change, factored out into a new
+ dedicated auxiliary test, from which those tests will depend upon.
+ This reduces code duplication in tests and, more importantly,
+ offers a noticeable speedup in the involved tests (30-40%).
+ * tests/tap-common-setup.test: New test, setting up the common
+ files and data used by various tests on TAP support.
+ * tests/tap-setup.sh: New file, to be sourced by tests wanting to
+ bring in data generated by `tap-common-setup.test'.
+ * tests/tap-autonumber.test: Update to use the pre-computed data
+ files.
+ * tests/tap-bailout.test: Likewise.
+ * tests/tap-color.test: Likewise.
+ * tests/tap-deps.test: Likewise.
+ * tests/tap-diagnostic.test: Likewise.
+ * tests/tap-empty-diagnostic.test: Likewise.
+ * tests/tap-empty.test: Likewise.
+ * tests/tap-escape-directive.test: Likewise.
+ * tests/tap-exit.test: Likewise.
+ * tests/tap-signal.test: Likewise.
+ * tests/tap-fancy.test: Likewise.
+ * tests/tap-fancy2.test: Likewise.
+ * tests/tap-global-log.test: Likewise.
+ * tests/tap-global-result.test: Likewise.
+ * tests/tap-html.test: Likewise.
+ * tests/tap-log.test: Likewise.
+ * tests/tap-merge-stdout-stderr.test: Likewise.
+ * tests/tap-no-merge-stdout-stderr.test: Likewise.
+ * tests/tap-message-0.test: Likewise.
+ * tests/tap-no-disable-hard-error.test: Likewise.
+ * tests/tap-no-spurious-summary.test: Likewise.
+ * tests/tap-no-spurious.test: Likewise.
+ * tests/tap-not-ok-skip.test: Likewise.
+ * tests/tap-numeric-description.test: Likewise.
+ * tests/tap-out-of-order.test: Likewise.
+ * tests/tap-passthrough.test: Likewise.
+ * tests/tap-passthrough-exit.test: Likewise.
+ * tests/tap-plan.test: Likewise.
+ * tests/tap-plan-corner.test: Likewise.
+ * tests/tap-plan-corner2.test: Likewise.
+ * tests/tap-plan-errors.test: Likewise.
+ * tests/tap-realtime.test: Likewise.
+ * tests/tap-recheck-logs.test: Likewise.
+ * tests/tap-skip-whole.test: Likewise.
+ * tests/tap-todo-skip-together.test: Likewise.
+ * tests/tap-todo-skip-whitespace.test: Likewise.
+ * tests/tap-todo-skip.test: Likewise.
+ * tests/tap-unplanned.test: Likewise.
+ * tests/tap-with-and-without-number.test: Likewise.
+ * tests/tap-xfail-tests.test: Likewise.
+ * tests/tap-skip-whole-whitespace.test: Likewise, and remove
+ redundant definitions of `$sp' and `$tab' (they are already
+ defined in `tests/defs').
+ * tests/tap-whitespace-normalization.test: Likewise.
+ * tests/Makefile.am (TESTS): Update.
+ (EXTRA_DIST): Distribute `tap-setup.sh'.
+ (tap_with_common_setup_tests, tap_with_common_setup_logs)): New
+ variables, holding respectively the list of tests using the files
+ pre-computed by `tap-common-setup.test', and the list of their
+ corresponding log files.
+ (tap_other_tests): New variable, holding the list of other tests
+ on TAP support.
+ ($(tap_with_common_setup_logs)): Depend on `tap-common-setup.log'
+ and `tap-setup.sh'.
+
2011-08-01 Stefano Lattarini <stefano.lattarini@gmail.com>
test harness: use new `.trs' files to hold test metadata
symlink.test \
symlink2.test \
syntax.test \
-tap-autonumber.test \
-tap-bad-prog.test \
-tap-bailout.test \
-tap-basic.test \
-tap-color.test \
-tap-deps.test \
-tap-diagnostic.test \
-tap-doc.test \
-tap-empty.test \
-tap-empty-diagnostic.test \
-tap-escape-directive.test \
-tap-exit.test \
-tap-signal.test \
-tap-fancy.test \
-tap-fancy2.test \
-tap-global-log.test \
-tap-global-result.test \
-tap-html.test \
-tap-log.test \
-tap-more.test \
-tap-more2.test \
-tap-message-0.test \
-tap-merge-stdout-stderr.test \
-tap-no-merge-stdout-stderr.test \
-tap-no-disable-hard-error.test \
-tap-no-spurious-summary.test \
-tap-no-spurious.test \
-tap-not-ok-skip.test \
-tap-numeric-description.test \
-tap-out-of-order.test \
-tap-passthrough.test \
-tap-passthrough-exit.test \
-tap-plan.test \
-tap-plan-errors.test \
-tap-plan-corner.test \
-tap-plan-corner2.test \
-tap-realtime.test \
-tap-recheck-logs.test \
-tap-recheck.test \
-tap-summary.test \
-tap-skip-whole.test \
-tap-skip-whole-whitespace.test \
-tap-todo-skip.test \
-tap-todo-skip-whitespace.test \
-tap-todo-skip-together.test \
-tap-unplanned.test \
-tap-whitespace-normalization.test \
-tap-with-and-without-number.test \
-tap-xfail-tests.test \
+$(tap_with_common_setup_tests) \
+$(tap_other_tests) \
tags.test \
tags2.test \
tagsub.test \
testsuite-summary-count-many.log: trivial-test-driver
testsuite-summary-count-many.log: extract-testsuite-summary
+# List of tests on TAP support that use the files pre-computed by
+# `tap-common-setup.test', and sources the `tap-setup.sh' helper
+# script.
+tap_with_common_setup_tests = \
+tap-autonumber.test \
+tap-bailout.test \
+tap-color.test \
+tap-deps.test \
+tap-diagnostic.test \
+tap-empty-diagnostic.test \
+tap-empty.test \
+tap-escape-directive.test \
+tap-exit.test \
+tap-signal.test \
+tap-fancy.test \
+tap-fancy2.test \
+tap-global-log.test \
+tap-global-result.test \
+tap-html.test \
+tap-log.test \
+tap-merge-stdout-stderr.test \
+tap-no-merge-stdout-stderr.test \
+tap-message-0.test \
+tap-no-disable-hard-error.test \
+tap-no-spurious-summary.test \
+tap-no-spurious.test \
+tap-not-ok-skip.test \
+tap-numeric-description.test \
+tap-out-of-order.test \
+tap-passthrough.test \
+tap-passthrough-exit.test \
+tap-plan.test \
+tap-plan-corner.test \
+tap-plan-corner2.test \
+tap-plan-errors.test \
+tap-realtime.test \
+tap-recheck-logs.test \
+tap-skip-whole-whitespace.test \
+tap-skip-whole.test \
+tap-todo-skip-together.test \
+tap-todo-skip-whitespace.test \
+tap-todo-skip.test \
+tap-unplanned.test \
+tap-whitespace-normalization.test \
+tap-with-and-without-number.test \
+tap-xfail-tests.test
+
+# Their log files.
+tap_with_common_setup_logs = $(tap_with_common_setup_tests:.test=.log)
+
+# Their dependencies.
+$(tap_with_common_setup_logs): tap-common-setup.log tap-setup.sh
+EXTRA_DIST += tap-setup.sh
+
+# Other tests on TAP support.
+tap_other_tests = \
+tap-common-setup.test \
+tap-bad-prog.test \
+tap-basic.test \
+tap-doc.test \
+tap-empty.test \
+tap-more.test \
+tap-more2.test \
+tap-recheck.test \
+tap-summary.test
+
# Dependencies valid for each test case.
$(TEST_LOGS): defs defs-static aclocal-$(APIVERSION) automake-$(APIVERSION)
MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests)
EXTRA_DIST = ChangeLog-old gen-parallel-tests instspc-tests.sh \
$(TESTS) trivial-test-driver testsuite-summary-checks.sh \
- extract-testsuite-summary
+ extract-testsuite-summary tap-setup.sh
XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
override-conditional-2.test pr8365-remake-timing.test \
yacc-dist-nobuild-subdir.test tap-bad-prog.test \
symlink.test \
symlink2.test \
syntax.test \
-tap-autonumber.test \
-tap-bad-prog.test \
-tap-bailout.test \
-tap-basic.test \
-tap-color.test \
-tap-deps.test \
-tap-diagnostic.test \
-tap-doc.test \
-tap-empty.test \
-tap-empty-diagnostic.test \
-tap-escape-directive.test \
-tap-exit.test \
-tap-signal.test \
-tap-fancy.test \
-tap-fancy2.test \
-tap-global-log.test \
-tap-global-result.test \
-tap-html.test \
-tap-log.test \
-tap-more.test \
-tap-more2.test \
-tap-message-0.test \
-tap-merge-stdout-stderr.test \
-tap-no-merge-stdout-stderr.test \
-tap-no-disable-hard-error.test \
-tap-no-spurious-summary.test \
-tap-no-spurious.test \
-tap-not-ok-skip.test \
-tap-numeric-description.test \
-tap-out-of-order.test \
-tap-passthrough.test \
-tap-passthrough-exit.test \
-tap-plan.test \
-tap-plan-errors.test \
-tap-plan-corner.test \
-tap-plan-corner2.test \
-tap-realtime.test \
-tap-recheck-logs.test \
-tap-recheck.test \
-tap-summary.test \
-tap-skip-whole.test \
-tap-skip-whole-whitespace.test \
-tap-todo-skip.test \
-tap-todo-skip-whitespace.test \
-tap-todo-skip-together.test \
-tap-unplanned.test \
-tap-whitespace-normalization.test \
-tap-with-and-without-number.test \
-tap-xfail-tests.test \
+$(tap_with_common_setup_tests) \
+$(tap_other_tests) \
tags.test \
tags2.test \
tagsub.test \
yflags-var-expand.test \
$(parallel_tests)
+
+# List of tests on TAP support that use the files pre-computed by
+# `tap-common-setup.test', and sources the `tap-setup.sh' helper
+# script.
+tap_with_common_setup_tests = \
+tap-autonumber.test \
+tap-bailout.test \
+tap-color.test \
+tap-deps.test \
+tap-diagnostic.test \
+tap-empty-diagnostic.test \
+tap-empty.test \
+tap-escape-directive.test \
+tap-exit.test \
+tap-signal.test \
+tap-fancy.test \
+tap-fancy2.test \
+tap-global-log.test \
+tap-global-result.test \
+tap-html.test \
+tap-log.test \
+tap-merge-stdout-stderr.test \
+tap-no-merge-stdout-stderr.test \
+tap-message-0.test \
+tap-no-disable-hard-error.test \
+tap-no-spurious-summary.test \
+tap-no-spurious.test \
+tap-not-ok-skip.test \
+tap-numeric-description.test \
+tap-out-of-order.test \
+tap-passthrough.test \
+tap-passthrough-exit.test \
+tap-plan.test \
+tap-plan-corner.test \
+tap-plan-corner2.test \
+tap-plan-errors.test \
+tap-realtime.test \
+tap-recheck-logs.test \
+tap-skip-whole-whitespace.test \
+tap-skip-whole.test \
+tap-todo-skip-together.test \
+tap-todo-skip-whitespace.test \
+tap-todo-skip.test \
+tap-unplanned.test \
+tap-whitespace-normalization.test \
+tap-with-and-without-number.test \
+tap-xfail-tests.test
+
+
+# Their log files.
+tap_with_common_setup_logs = $(tap_with_common_setup_tests:.test=.log)
+
+# Other tests on TAP support.
+tap_other_tests = \
+tap-common-setup.test \
+tap-bad-prog.test \
+tap-basic.test \
+tap-doc.test \
+tap-empty.test \
+tap-more.test \
+tap-more2.test \
+tap-recheck.test \
+tap-summary.test
+
all: all-am
.SUFFIXES:
testsuite-summary-count-many.log: trivial-test-driver
testsuite-summary-count-many.log: extract-testsuite-summary
+# Their dependencies.
+$(tap_with_common_setup_logs): tap-common-setup.log tap-setup.sh
+
# Dependencies valid for each test case.
$(TEST_LOGS): defs defs-static aclocal-$(APIVERSION) automake-$(APIVERSION)
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-EXTRA_DIST = $(TESTS)
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<'END'
1..14
ok
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-$MAKE check >stdout && { cat stdout; Exit 1; }
+TESTS=all.test $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
count_test_results total=14 pass=6 fail=5 xpass=1 xfail=1 skip=1 error=0
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = a.test b.test c.test d.test e.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
: > exp
# Doing the sums above, we have:
test_counts='total=12 pass=3 fail=1 xpass=1 xfail=1 skip=1 error=5'
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-$MAKE check >stdout && { cat stdout; Exit 1; }
+TESTS='a.test b.test c.test d.test e.test' $MAKE -e check >stdout \
+ && { cat stdout; Exit 1; }
cat stdout
count_test_results $test_counts
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
TERM=ansi; export TERM
esc='\e'
*) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;;
esac
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = color-tests
AM_TEST_LOG_DRIVER_FLAGS = --comments
TEST_LOG_COMPILER = cat
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TESTS = all.test skip.test bail.test badplan.test noplan.test \
few.test many.test order.test
END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
cat > all.test << 'END'
1..5
ok 1 - foo
ok 5
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
AM_COLOR_TESTS=always $MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Auxiliary test to set up common data used by many tests on TAP support.
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+cp "$top_testsrcdir"/lib/tap-driver . \
+ || fatal_ "failed to fetch auxiliary script tap-driver"
+
+cat >> configure.in << END
+AC_SUBST([PERL], ['$PERL'])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TEST_LOG_COMPILER = cat
+TESTS = all.test
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+rm -rf autom4te*.cache
+
+# So that the data files we've created won't be removed at exit.
+keep_testdirs=yes
+
+:
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
# The tests are *deliberately* listed in inversed order here.
TESTS = c.test b.test a.test
b.log: a.log
c.log: b.log
END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
cat > a.test << 'END'
#!/bin/sh
echo 1..2
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
metacharacters=\''"\$!&()[]<>#;^?*'
# all.test: Shell metacharacters here: $metacharacters
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
$EGREP -i "#.*all\\.test|a comment|(Tests|Shell) " stdout && Exit 1
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-AM_TEST_LOG_DRIVER_FLAGS = --comments
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
sed 's/\$$//' > all.test <<END
1..1$
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
+grep '^PASS:.*all\.test' stdout # Sanity check.
grep '#.*all\.test' stdout && Exit 1
grep "all\.test[ $tab]*:[ $tab]*$" stdout && Exit 1
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
# Empty TAP input.
: > empty.test
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<'END'
1..2
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TESTS =
-END
-
+echo TESTS = > Makefile.am
for st in 1 2 77 99; do
unindent > exit${st}.test <<END
#!/bin/sh
chmod a+x *.test
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
#
# From manpage Test::Harness::TAP(3):
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
#
# From manpage Test::Harness::TAP(3):
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > ok.test << 'END'
1..5
1..0 # SKIP all
END
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-END
-echo TESTS = *.test >> Makefile.am
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
# We don't care about the exit status of "make check" here.
-$MAKE check || :
+TESTS="`echo *.test`" $MAKE -e check || :
cat test-suite.log
grep 'ok\.test|not seen' test-suite.log && Exit 1
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = \
- ok.test \
- skip.test skipall.test \
- fail.test fail2.test \
- xpass.test xpass2.test \
- error.test error2.test \
- hodgepodge.test hodgepodge-all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > ok.test <<END
1..3
# TODO: add scripts with TAP errors (multiple plans, out-of-order
# tests, etc).
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-$MAKE check >stdout && { cat stdout; Exit 1; }
+TESTS="`echo *.test`" $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
for tst in ok skip skipall fail fail2 xpass xpass2 error error2 \
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TEST_LOG_COMPILER = cat
TESTS = ok.test ko.test
END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
cat > ok.test << 'END'
1..3
ok 1 - expected success
Bail out! hard error
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
no_rst2html_error ()
{
$EGREP '(test-suite\.log:[0-9]|WARNING|SEVERE)' output && Exit 1
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TESTS = pass.test skip.test xfail.test fail.test xpass.test error.test
TEST_SUITE_LOG = global.log
END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
# Custom markers, for use in grepping checks.
cmarker=::: # comment marker
pmarker=%%% # plain maker
chmod a+x *.test
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
-
TEST_SUITE_LOG=my.log $MAKE -e check && Exit 1
ls -l # For debugging.
test ! -f test-suite.log
cp "$top_testsrcdir"/lib/tap-driver . \
|| fatal_ "failed to fetch auxiliary script tap-driver"
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
AM_TEST_LOG_DRIVER_FLAGS = --comments --merge
TESTS = all.test
END
-: > all.test # Updated later.
-chmod a+x all.test
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<END
#!/bin/sh
echo "ok 4 # SKIP"
echo "# foo foo foo" >&2
END
+chmod a+x all.test
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test << 'END'
1..10
ok 10 0 # SKIP 0
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
DISABLE_HARD_ERRORS = yes
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TEST_LOG_COMPILER = cat
TESTS = bail.test few.test noplan.test
END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
cat > bail.test <<END
1..1
Bail out!
# nothing here
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TEST_LOG_DRIVER_FLAGS = --comments
TESTS = all.test
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<END
#!/bin/sh
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<'END'
1..1
ok 1
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
echo 1..5 > all.test
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<'END'
1..4
not ok 4 - bar # SKIP
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
# Some random numbers to be used as test names. The definitions below are
# selected so that $x<n> != <n> for every n >= 1. We can't use positional
XPASS: all.test 10 - ${x10} # TODO
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = a.test b.test c.test d.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > a.test <<END
1..3
./configure
-$MAKE check >stdout && { cat stdout; Exit 1; }
+
+TESTS='a.test b.test c.test d.test' $MAKE -e check >stdout \
+ && { cat stdout; Exit 1; }
cat stdout
count_test_results total=17 pass=8 fail=0 xpass=0 xfail=1 skip=0 error=8
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TEST_LOG_COMPILER = $(SHELL)
TESTS =
END
echo TESTS += exit-$e.test >> Makefile.am
done
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
st=0
$MAKE check || st=$?
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS =
-END
-
weirdchars=\''"\$@!&()[]<>#;,:.^?*/'
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
#
# Only successful tests.
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > leading-repeated-1.test <<END
1..1
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
# The leading blank line is meant.
cat > leading-blank.test <<END
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = foo.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
my_check ()
{
- cat > foo.test
+ cat > all.test
test -n "$err" || fatal_ "\$err not set before calling my_check"
- cat foo.test # For debugging.
+ cat all.test # For debugging.
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
count_test_results "$@"
- grep "^ERROR: foo\\.test - $err$" stdout
+ grep "^ERROR: all\\.test - $err$" stdout
unset err
}
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = top.test bot.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > top.test <<END
1..3
# Check that the plans doesn't cause any problem
-$MAKE check >stdout || { cat stdout; Exit 1; }
+TESTS='top.test bot.test' $MAKE -e check >stdout || { cat stdout; Exit 1; }
cat stdout
count_test_results total=7 pass=5 xfail=1 skip=1 fail=0 xpass=0 error=0
}
rm -f expect-check
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TESTS = all.test
END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<'END'
#! /bin/sh
chmod a+x all.test
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
cat > expect-make <<'END'
eval spawn $env(MAKE) check
expect {
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TEST_LOG_COMPILER = cat
TESTS = foo.test bar.test baz.test
baz.log: zardoz
END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
: > zardoz
cat > foo.test <<'END'
Bail out!
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-
-./configure
-
# Even the tests that are not re-run should contribute to the testsuite
# summary when obtained by "make check RECHECK_LOGS=".
grep_summary ()
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Auxiliary shell script that copies the common data and files used by
+# many tests on TAP support into the current directory. It should be
+# sourced by client test scripts, and assumes the auxiliary test
+# `tap-common-setup.test' has been run beforehand (it will error out
+# if this is not the case).
+
+# Check that we are running from a proper directory: last thing we want
+# is to overwrite some random user files.
+test -f ../defs-static && test -f ../defs \
+ || fatal_ "running from a wrong directory"
+
+test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
+ || fatal_ "failed to save Makefile.am"
+
+test -d ../tap-common-setup.dir && cp -Rp ../tap-common-setup.dir/* . \
+ || fatal_ "couldn't get precomputed data files"
+
+cp "$top_testsrcdir"/lib/tap-driver . \
+ || fatal_ "failed to fetch auxiliary script tap-driver"
+
+if test -f Makefile.am~; then
+ mv -f Makefile.am~ Makefile.am \
+ || fatal_ "failed to restore Makefile.am"
+ echo 'TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver' >> Makefile.am \
+ || fatal_ "failed to update Makefile.am"
+ $AUTOMAKE Makefile \
+ || fatal_ "failed to remake Makefile.in"
+ ./config.status Makefile \
+ || fatal_ "failed to remake Makefile"
+fi
+
+:
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TESTS =
-END
-
+echo TESTS = > Makefile.am
for sig in 1 2 13 15; do
unindent > signal-$sig.test <<END
#!/bin/sh
chmod a+x *.test
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
for append in '' 'TEST_LOG_DRIVER_FLAGS = --ignore-exit'; do
echo "$append" >> Makefile
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-sp=' '
-tab=' '
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = foo.test bar.test baz.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > foo.test <<END
1..0${tab}${tab} #${tab}SKIP ${tab}Strip leading & trailing ${tab}${tab}
1..0 # SKIP${tab} Strip${tab}external preserve ${tab}middle ${tab}${sp}
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-$MAKE check > stdout || { cat stdout; Exit 1; }
+TESTS='foo.test bar.test baz.test' $MAKE -e check > stdout \
+ || { cat stdout; Exit 1; }
cat stdout
count_test_results total=3 pass=0 fail=0 error=0 xpass=0 xfail=0 skip=3
parallel_tests=yes
. ./defs || Exit 1
-weirdchars=\''"$!&()[]<>#;^?*/@%=,.:'
-
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = foo.test bar.test baz.test wget.test curl.test mu.test
-END
+weirdchars=\''"$!&()[]<>#;^?*/@%=,.:'
cat > foo.test <<END
1..0
1..7
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-$MAKE check >stdout || { cat stdout; Exit 1; }
+env TESTS='foo.test bar.test baz.test wget.test curl.test mu.test' \
+ $MAKE -e check >stdout || { cat stdout; Exit 1; }
cat stdout
count_test_results total=6 pass=0 fail=0 xpass=0 xfail=0 skip=6 error=0
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<END
1..2
not ok 2 # TODO SKIP
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > stub.tap <<END
1 # TODO
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
# ----------------------------------------------------- #
# Check all possible combinations of: #
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = foo.test
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-cat > foo.test <<END
+cat > all.test <<END
1..1
ok 1
ok 2
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
count_test_results total=3 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=2
-grep '^ERROR: foo\.test - too many tests run (expected 1, got 2)$' stdout
-grep '^ERROR: foo\.test 2 # UNPLANNED$' stdout
+grep '^ERROR: all\.test - too many tests run (expected 1, got 2)$' stdout
+grep '^ERROR: all\.test 2 # UNPLANNED$' stdout
-cat > foo.test <<END
+cat > all.test <<END
1..2
ok 1
ok 2
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
count_test_results total=4 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=2
-grep '^ERROR: foo\.test - too many tests run (expected 2, got 3)$' stdout
-grep '^ERROR: foo\.test 3 # UNPLANNED$' stdout
+grep '^ERROR: all\.test - too many tests run (expected 2, got 3)$' stdout
+grep '^ERROR: all\.test 3 # UNPLANNED$' stdout
# Interaction with XFAIL_TESTS.
-cat > foo.test <<END
+cat > all.test <<END
1..2
not ok 1
ok 2 # SKIP
not ok 4
ok 5 # SKIP
END
-XFAIL_TESTS=foo.test $MAKE -e check >stdout && { cat stdout; Exit 1; }
+XFAIL_TESTS=all.test $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
count_test_results total=6 pass=0 fail=0 xpass=0 xfail=1 skip=1 error=4
-grep '^ERROR: foo\.test - too many tests run (expected 2, got 5)$' stdout
-grep '^ERROR: foo\.test 3 # UNPLANNED$' stdout
-grep '^ERROR: foo\.test 4 # UNPLANNED$' stdout
-grep '^ERROR: foo\.test 5 # UNPLANNED$' stdout
+grep '^ERROR: all\.test - too many tests run (expected 2, got 5)$' stdout
+grep '^ERROR: all\.test 3 # UNPLANNED$' stdout
+grep '^ERROR: all\.test 4 # UNPLANNED$' stdout
+grep '^ERROR: all\.test 5 # UNPLANNED$' stdout
-cat > foo.test <<END
+cat > all.test <<END
1..1
ok 1
cat stdout
count_test_results total=22 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=21
-echo 'PASS: foo.test 1' > exp
-sed -e '/^$/d' -e 's/.*/ERROR: foo.test & # UNPLANNED/' t >> exp
-echo 'ERROR: foo.test - too many tests run (expected 1, got 21)' >> exp
+echo 'PASS: all.test 1' > exp
+sed -e '/^$/d' -e 's/.*/ERROR: all.test & # UNPLANNED/' t >> exp
+echo 'ERROR: all.test - too many tests run (expected 1, got 21)' >> exp
-$FGREP ': foo.test' stdout > got
+$FGREP ': all.test' stdout > got
cat exp
cat got
# message about the unmatched number of tests once we've got the plan.
for x in 'ok' 'ok 3' 'not ok' 'not ok # TODO' 'ok # TODO' 'ok # SKIP'; do
- unindent > foo.test <<END
+ unindent > all.test <<END
ok 1
ok 2 # SKIP
$x
END
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
- test `$FGREP -c ': foo.test' stdout` -eq 4
- $EGREP '^PASS: foo\.test 1($| )' stdout
- $EGREP '^SKIP: foo\.test 2($| )' stdout
- $EGREP ': foo\.test 3($| )' stdout
- grep '^ERROR: foo\.test - too many tests run (expected 2, got 3)$' stdout
+ test `$FGREP -c ': all.test' stdout` -eq 4
+ $EGREP '^PASS: all\.test 1($| )' stdout
+ $EGREP '^SKIP: all\.test 2($| )' stdout
+ $EGREP ': all\.test 3($| )' stdout
+ grep '^ERROR: all\.test - too many tests run (expected 2, got 3)$' stdout
done
:
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
TEST_LOG_COMPILER = cat
TESTS =
END
: > exp
-sp=' '
-tab=' '
-
spaces_a=${sp}${tab}${tab}${sp}${sp}${tab}
spaces_b=${tab}${tab}${sp}${tab}${sp}${sp}${sp}
chmod a+x *.test
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
# Don't care about exit status or number of test results, they should be
# checked for in many other tests.
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = all.test
-END
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test <<'END'
1..7
ok zardoz
END
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
count_test_results total=7 pass=4 fail=0 xpass=0 xfail=2 skip=1 error=0
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
-TEST_LOG_COMPILER = cat
-TESTS = the.test
-XFAIL_TESTS = $(TESTS)
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
+echo 'XFAIL_TESTS = $(TESTS)' >> Makefile
-cat > the.test <<END
+cat > all.test <<END
1..6
ok 1
not ok 2
count_test_results total=7 pass=0 fail=0 xpass=2 xfail=3 skip=1 error=1
-grep '^XPASS: the\.test 1$' stdout
-grep '^XFAIL: the\.test 2$' stdout
-grep '^XPASS: the\.test 3 # TODO' stdout
-grep '^XFAIL: the\.test 4 # TODO' stdout
-grep '^SKIP: the\.test 5 # SKIP' stdout
-grep '^XFAIL: the\.test 6 # SKIP' stdout
-grep '^ERROR: the\.test - Bail out!' stdout
+grep '^XPASS: all\.test 1$' stdout
+grep '^XFAIL: all\.test 2$' stdout
+grep '^XPASS: all\.test 3 # TODO' stdout
+grep '^XFAIL: all\.test 4 # TODO' stdout
+grep '^SKIP: all\.test 5 # SKIP' stdout
+grep '^XFAIL: all\.test 6 # SKIP' stdout
+grep '^ERROR: all\.test - Bail out!' stdout
# Check that the exit status of the testsuite is indeed 0 when we
# would expect success.
-cat > the.test <<END
+cat > all.test <<END
1..3
not ok 1
ok 2 # SKIP