]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
testsuite: optimize tests on TAP for speed and against duplication
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 1 Aug 2011 14:14:44 +0000 (16:14 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 2 Aug 2011 21:31:31 +0000 (23:31 +0200)
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'.

47 files changed:
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/tap-autonumber.test
tests/tap-bailout.test
tests/tap-color.test
tests/tap-common-setup.test [new file with mode: 0755]
tests/tap-deps.test
tests/tap-diagnostic.test
tests/tap-empty-diagnostic.test
tests/tap-empty.test
tests/tap-escape-directive.test
tests/tap-exit.test
tests/tap-fancy.test
tests/tap-fancy2.test
tests/tap-global-log.test
tests/tap-global-result.test
tests/tap-html.test
tests/tap-log.test
tests/tap-merge-stdout-stderr.test
tests/tap-message-0.test
tests/tap-no-disable-hard-error.test
tests/tap-no-merge-stdout-stderr.test
tests/tap-no-spurious-summary.test
tests/tap-no-spurious.test
tests/tap-not-ok-skip.test
tests/tap-numeric-description.test
tests/tap-out-of-order.test
tests/tap-passthrough-exit.test
tests/tap-passthrough.test
tests/tap-plan-corner.test
tests/tap-plan-corner2.test
tests/tap-plan-errors.test
tests/tap-plan.test
tests/tap-realtime.test
tests/tap-recheck-logs.test
tests/tap-setup.sh [new file with mode: 0755]
tests/tap-signal.test
tests/tap-skip-whole-whitespace.test
tests/tap-skip-whole.test
tests/tap-todo-skip-together.test
tests/tap-todo-skip-whitespace.test
tests/tap-todo-skip.test
tests/tap-unplanned.test
tests/tap-whitespace-normalization.test
tests/tap-with-and-without-number.test
tests/tap-xfail-tests.test

index 356c7636c2115b35a4bd444117b82c94adbc252c..9c017febf16b4144adee306a50ffc05669f439be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,71 @@
+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
index 104f70be86f8d9d5f257977aa317670e038769a4..09e5340af2c8abb5a1492bf414096004b5122e91 100644 (file)
@@ -994,55 +994,8 @@ suffix13.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 \
@@ -1170,6 +1123,72 @@ EXTRA_DIST += extract-testsuite-summary
 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)
 
index 1732555d97eb2eb74f81761b60c6f71c9651a650..065a772c807f37d1167379875ed3ba181a729a67 100644 (file)
@@ -276,7 +276,7 @@ top_srcdir = @top_srcdir@
 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 \
@@ -1245,55 +1245,8 @@ suffix13.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 \
@@ -1405,6 +1358,70 @@ yflags-force-conditional.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:
@@ -1861,6 +1878,9 @@ testsuite-summary-color.log testsuite-summary-count.log: \
 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)
 
index 745a6398f4d2ed5f64bbb146d717d18222baae76..12dec1160b4acce9e9329bef96000ec0d007ae37 100755 (executable)
 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
@@ -58,13 +45,7 @@ not ok
 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
 
index 6c0a588f947835e8784e84fa4980741b23a68424..8354b277d4663d7508038ba480d5f219fe3ccd4c 100755 (executable)
 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
 
@@ -131,13 +119,8 @@ echo "ERROR: e.test - Bail out!" >> 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
index 82c0b51628e28763b398560f2c0a45ff8152e016..dbd662903bf3e555f45767f447727de3be65adc5 100755 (executable)
@@ -20,9 +20,6 @@
 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'
@@ -42,20 +39,16 @@ case `echo "$std" | grep .` in
   *) 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
@@ -102,12 +95,6 @@ cat > order.test << 'END'
 ok 5
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 AM_COLOR_TESTS=always $MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
 
diff --git a/tests/tap-common-setup.test b/tests/tap-common-setup.test
new file mode 100755 (executable)
index 0000000..de8ff2c
--- /dev/null
@@ -0,0 +1,47 @@
+#! /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
+
+:
index ec744857b0984d093ee2c064a0eabbc5bb83ac53..b86d2356d7371b524f29c48403bb0c1d05ec4cc7 100755 (executable)
 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
index caef65119bf545be0f7d81da69640e34a38713f9..73ab45eb21220efe6aa9750941f7ee3e67b37e54 100755 (executable)
 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=\''"\$!&()[]<>#;^?*'
 
@@ -65,12 +53,6 @@ PASS: all.test 4 - zardoz
 # 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
index 0edea1392701115a158892e682910992d9aa2e2e..2dcc880e73674bb5ffc26880f90ed29ecb805cd4 100755 (executable)
 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$
@@ -53,6 +40,7 @@ $AUTOMAKE
 $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
 
index 565c1347f424c8ecd0a6642ada113b41570e219d..557b7c796a5b7f53d8ebeeafb76f546b24d76c70 100755 (executable)
 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
index fb333baa632d20b6db8451cefb951869c9ff600b..2f8cb73499c53f8c4e545f3eba8366e292b5b32b 100755 (executable)
 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
index 07209d1b8cc096636bdd831b223500230533415f..381adff12b54ed8be4950288fb177076e2697e07 100755 (executable)
 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
@@ -47,11 +35,7 @@ done
 
 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
index 68612dec0b36d4016e1f98646daa78ecee96940b..3348db770a9af8876debc859c4db3182b2aafcbc 100755 (executable)
 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):
index 977d38f4e22a7b7c90db481cdb81e6813e83e75f..ddd64eabc06cbe7604603fc36d3c4ae56a0113fd 100755 (executable)
 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):
index da5aeb8bd3c40c49e175d2024f28a3a09e95a1bf..a4f6428aa3f330b24bfade77ab48bc3ad52979c5 100755 (executable)
 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
@@ -108,20 +102,8 @@ cat > skipall.test << 'END'
 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
index d2e593ecf0c1e614d079a5612f4e78d58bf9bfb0..c49fae481a2e7fe836652f1ffacee74581af19fc 100755 (executable)
 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
@@ -97,13 +79,7 @@ END
 # 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 \
index 12dcb3689ba119a3e608007623a8ebaa400d625f..b5a1beb30ca9e506ced85cb66f275e543f93b492 100755 (executable)
 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
@@ -49,12 +42,6 @@ ok 2 - spurious success # TODO
 Bail out! hard error
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 no_rst2html_error ()
 {
   $EGREP '(test-suite\.log:[0-9]|WARNING|SEVERE)' output && Exit 1
index e5bab2f47095650ed9dd40139065cd381394f678..eecb2a2cf1de97334ff00df409a8f86385a7f3e8 100755 (executable)
 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
@@ -93,12 +86,6 @@ END
 
 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
index e73f0ec052d907d5f9e21ef5921a4ba3ea3d6bf4..787ad51f2fefecbb8a53104f030a69a4d0e5d11b 100755 (executable)
@@ -24,25 +24,12 @@ parallel_tests=yes
 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
@@ -53,6 +40,7 @@ echo "not ok 3 # TODO" >&2
 echo "ok 4 # SKIP"
 echo "# foo foo foo" >&2
 END
+chmod a+x all.test
 
 $MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
index 9f16171cfcb7d35d6aea4f818b8d41cb47ed4d02..bce333fbb9c0524f2599a6415bd6ed54ec3f707d 100755 (executable)
 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
@@ -51,12 +39,6 @@ not ok 9 0 # TODO 0
 ok 10 0 # SKIP 0
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 $MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
 
index a2f88f948897f45586bc90c7b009fec8f8a56d29..678e1849b415668cb51282394d133f3adbad17ee 100755 (executable)
 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!
@@ -49,12 +42,6 @@ cat > noplan.test <<END
 # nothing here
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 $MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
 
index c2995b29dfcd239c199bc829dd49358cd2ad992f..25a06fdc78fcb283803304bf2803adc387097366 100755 (executable)
 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
index 4c358da08280474d35548a19eb87c9db05966d87..bc7fd51febbbeec7dd52c3cfd89ea28ebcf0ac80 100755 (executable)
 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
@@ -47,12 +35,6 @@ cat > all.test <<'END'
 ok 1
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 $MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
 
index cfe7dbd48aa5252e618fcf631e6b00d00eec76c8..91b115fec8422bb2bee1aa009530809e6d956b98 100755 (executable)
 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
 
index 57b8d7a970a852f43f583a17c52eafbff6cbcd52..f154d23066fb0b76b9228c51aa0be94308523b45 100755 (executable)
 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
@@ -43,12 +31,6 @@ not ok - foo # SKIP
 not ok 4 - bar # SKIP
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 $MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
 
index a2b4f79c7af7eafc6a632cb0fc36e6892e57aa50..ea010386ce1eaa0d98f2111d7514e534879e1299 100755 (executable)
 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
@@ -66,12 +54,6 @@ XPASS: all.test 9 ${x9} # TODO
 XPASS: all.test 10 - ${x10} # TODO
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 $MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
 
index 2639e2cb418ee8516b5aa2585b5292fbae698435..f8f69c79f907e1e63d14b3dee485b64d8e72b1ff 100755 (executable)
 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
@@ -76,7 +64,9 @@ $AUTOMAKE
 
 ./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
index 98213a3814f72351b4b6f38945122893b38fd992..ae8ffa89111988e6a86ba11905352ca84c4a518b 100755 (executable)
 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
@@ -48,11 +39,7 @@ 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=$?
index b4a7c127a8b534e111b5fbc84dfd4cc3e565a4ad..ba773ed5826bcaf87aa31431119d87a5f31e3334 100755 (executable)
 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.
index 7f462636bcb82b3d489abbc266319b14faf27a1d..4215556fcb7658a963252771b9bf605a9e07117c 100755 (executable)
 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
index 155cf8586b949c7bc9f3e0b4773bc111fb898798..54fd5e92d19ab223a7ed13f21b95b34051be1523 100755 (executable)
 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
index 539cb8fe3add1fa48024ade6ac276914ea6c80ba..fd12e1b0f30144d9038d829d7f8394d0e85183e2 100755 (executable)
 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
 }
 
index 10fa377fdff1880dd6b79f6049ff7996fa6929eb..79e9bddda42f98f9f19d216697c1c88dbaaca335 100755 (executable)
 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
@@ -62,7 +44,7 @@ END
 
 # 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
 
index 0f43e9e438a6c0189d4696e32e947a9be08f8935..4a38f1422d03af6416754b9c71bf19d4be8b715f 100755 (executable)
@@ -35,18 +35,10 @@ expect -f expect-check || {
 }
 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
@@ -72,12 +64,6 @@ END
 
 chmod a+x all.test
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 cat > expect-make <<'END'
 eval spawn $env(MAKE) check
 expect {
index a3484bbc7f9f6ba0d185b57057737a955973d675..6e1b646d67f6b353cfd9bd9a4d15eabbfde7ae60 100755 (executable)
 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'
@@ -53,12 +46,6 @@ cat > baz.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 ()
diff --git a/tests/tap-setup.sh b/tests/tap-setup.sh
new file mode 100755 (executable)
index 0000000..0d1a1e3
--- /dev/null
@@ -0,0 +1,48 @@
+#! /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
+
+:
index b1ac2dfed48663dd3a25d4cc81f51227545c16c0..fb75c83e4d4bca8b37005ce8d19b68a5dfa3dd13 100755 (executable)
 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
@@ -46,11 +34,7 @@ done
 
 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
index 2a19d4c9e7802bf7cbb77ff645d01d1c31629533..bf83241a7817611376935c218d7b98da7e3f16cb 100755 (executable)
 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}
@@ -50,13 +35,8 @@ cat > baz.test <<END
 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
index bd75e904ab7efb267ca15c003bff2cedc0870fc2..6b14be473c62a0064cef1c319c22d7f0cbd66f9b 100755 (executable)
 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
@@ -78,13 +66,8 @@ not ok 333
 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
index 1528ca32e5733e820bb4459d64de8e1a54dd8333..14b8ed525e3acbad7c7b3c423b43cc12f18e86a0 100755 (executable)
 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
@@ -40,12 +28,6 @@ ok 1 # SKIP TODO
 not ok 2 # TODO SKIP
 END
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
 $MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
 
index 68fbbc1a134245dd335953b1f6597bea6c6e6630..695e98c2c4d5dfff2178c2e5c3d36510f1390eb2 100755 (executable)
 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
index c37b6315875f011307472c66aa3fd9cbd9a8e45f..d00dddd94b304a7eb11c9e1133580511665a4927 100755 (executable)
 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:                  #
index 696f73beff7b4aebf02d96905bd941e0ab347a1e..177e36e9651e6a5aea663d7d786cbf7301c13803 100755 (executable)
 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
@@ -48,10 +30,10 @@ END
 $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
@@ -60,11 +42,11 @@ END
 $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
@@ -72,15 +54,15 @@ ok 3
 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
 
@@ -143,11 +125,11 @@ $MAKE check >stdout && { cat stdout; Exit 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
@@ -159,7 +141,7 @@ diff exp 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
@@ -167,11 +149,11 @@ for x in 'ok' 'ok 3' 'not ok' 'not ok # TODO' 'ok # TODO' 'ok # SKIP'; do
 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
 
 :
index 16e68015f200bea0ead4d2682e7386f33865b75e..a902438bc7443ea6c0f43292fbe02266387bf6fa 100755 (executable)
 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}
 
@@ -157,11 +145,7 @@ END
 
 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.
index a1f7a4bf44237ac45e258cb635edcb833fc54861..e989cc81bc6c06ed4a921c5594b779b3e048fd18 100755 (executable)
 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
@@ -47,12 +35,6 @@ ok 6 # SKIP
 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
index f159e8ae7e3640a7db0c592276046e490bdb1fe1..22733c8f8efdb895c8072e074bfe41f43550abbb 100755 (executable)
 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
@@ -59,18 +42,18 @@ cat stdout
 
 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