Merge branch 'maint'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 16:16:47 +0000 (18:16 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 16:16:47 +0000 (18:16 +0200)
* maint: (38 commits)
  maintcheck: fixup list of files in $(xdefs)
  tests: never source test-defs.sh directly, source test-lib.sh instead
  runtest: sanitize test environment
  tests: remove an obsolescent self test
  tests: "am_using_tap=yes" -> "am_test_protocol=tap"
  tests: protect test libs against multiple inclusion
  configure: testsuite shell can return early from "dot-sourced" files
  tests: move sanitization and "Bournification" in the generic test lib
  tests: source test defs in the generic test lib
  test defs: no need to re-add $srcdir/t/ax to $PATH
  tests: split test libs into "generic" and "automake-specific"
  test setup: move actual calling of testsuite setup in ./defs
  test setup: merge definitions of function for simple tests
  test init: refactor: new function 'am_test_setup'
  test init: refactor: move displaying of debugging info later
  test init: refactor: new function 'am_setup_testdir'
  test init: refactor: new function 'am_set_exit_traps'
  configure: testsuite shell set exit traps in shell functions
  test init: refactor: new function 'am_exit_trap'
  test init: refactor: new function 'process_requirements'
  ...

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
90 files changed:
.gitignore
Makefile.am
configure.ac
defs
gen-testsuite-part
runtest.in
syntax-checks.mk
t/README
t/ax/am-test-lib.sh [moved from t/ax/test-init.sh with 74% similarity]
t/ax/plain-functions.sh [deleted file]
t/ax/tap-setup.sh
t/ax/test-defs.in [moved from defs-static.in with 73% similarity]
t/ax/test-lib.sh [new file with mode: 0644]
t/list-of-tests.mk
t/primary-prefix-couples-force-valid.sh
t/self-check-env-sanitize.tap [deleted file]
t/self-check-tap.sh [deleted file]
t/tap-ambiguous-directive.sh
t/tap-autonumber.sh
t/tap-bailout-and-logging.sh
t/tap-bailout-leading-space.sh
t/tap-bailout-suppress-badexit.sh
t/tap-bailout-suppress-later-diagnostic.sh
t/tap-bailout-suppress-later-errors.sh
t/tap-bailout.sh
t/tap-color.sh
t/tap-deps.sh
t/tap-diagnostic.sh
t/tap-empty-diagnostic.sh
t/tap-empty.sh
t/tap-escape-directive-2.sh
t/tap-escape-directive.sh
t/tap-exit.sh
t/tap-fancy.sh
t/tap-fancy2.sh
t/tap-global-log.sh
t/tap-global-result.sh
t/tap-log.sh
t/tap-merge-stdout-stderr.sh
t/tap-missing-plan-and-bad-exit.sh
t/tap-msg0-bailout.sh
t/tap-msg0-directive.sh
t/tap-msg0-misc.sh
t/tap-msg0-planskip.sh
t/tap-msg0-result.sh
t/tap-negative-numbers.sh
t/tap-no-disable-hard-error.sh
t/tap-no-merge-stdout-stderr.sh
t/tap-no-spurious-numbers.sh
t/tap-no-spurious-summary.sh
t/tap-no-spurious.sh
t/tap-not-ok-skip.sh
t/tap-number-wordboundary.sh
t/tap-numbers-leading-zero.sh
t/tap-numeric-description.sh
t/tap-out-of-order.sh
t/tap-passthrough-exit.sh
t/tap-passthrough.sh
t/tap-plan-corner.sh
t/tap-plan-errors.sh
t/tap-plan-leading-zero.sh
t/tap-plan-malformed.sh
t/tap-plan-middle.sh
t/tap-plan-whitespace.sh
t/tap-plan.sh
t/tap-planskip-and-logging.sh
t/tap-planskip-badexit.sh
t/tap-planskip-bailout.sh
t/tap-planskip-case-insensitive.sh
t/tap-planskip-late.sh
t/tap-planskip-later-errors.sh
t/tap-planskip-unplanned-corner.sh
t/tap-planskip-unplanned.sh
t/tap-planskip-whitespace.sh
t/tap-planskip.sh
t/tap-realtime.sh
t/tap-recheck-logs.sh
t/tap-result-comment.sh
t/tap-summary-color.sh
t/tap-summary.sh
t/tap-test-number-0.sh
t/tap-todo-skip-together.sh
t/tap-todo-skip-whitespace.sh
t/tap-todo-skip.sh
t/tap-unplanned.sh
t/tap-whitespace-normalization.sh
t/tap-with-and-without-number.sh
t/tap-xfail-tests.sh
t/testsuite-summary-color.sh
t/testsuite-summary-count.sh

index b09a0a6..c42aef3 100644 (file)
@@ -38,7 +38,7 @@
 /test-suite.log
 /t/wrap/aclocal-1.*
 /t/wrap/automake-1.*
-/defs-static
+/t/ax/test-defs.sh
 /t/testsuite-part.am
 /t/*-w.tap
 /t/*-w.sh
index a5332d3..028b070 100644 (file)
@@ -329,14 +329,17 @@ TESTS = ## Will be updated later.
 
 # Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
+# Keep this in sync with the similar list in 'runtest.in'.
 AM_TESTS_ENVIRONMENT = \
   for v in \
     required \
-    am_using_tap \
+    am_test_protocol \
     am_serial_tests \
     am_test_prefer_config_shell \
     am_original_AUTOMAKE \
     am_original_ACLOCAL \
+    am_test_lib_sourced \
+    test_lib_sourced \
   ; do \
     eval test x"\$${$$v}" = x || unset $$v; \
   done;
@@ -345,6 +348,16 @@ AM_TESTS_ENVIRONMENT = \
 AM_TESTS_FD_REDIRECT = 9>&2
 AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
 
+# For sourcing of extra "shell libraries" by our test scripts.  As per
+# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
+# in case it is given with a relative name containing no slashes.
+AM_TESTS_ENVIRONMENT += \
+  if test $(srcdir) != .; then \
+    PATH='$(abs_srcdir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
+  fi; \
+  PATH='$(abs_builddir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
+  export PATH;
+
 # Hand-written tests.
 
 include $(srcdir)/t/list-of-tests.mk
@@ -379,26 +392,34 @@ include $(srcdir)/contrib/t/local.am
 TESTS += $(contrib_TESTS)
 EXTRA_DIST += $(contrib_TESTS)
 
-# Static dependencies valid for each test case.
-check_SCRIPTS = t/wrap/aclocal-$(APIVERSION) t/wrap/automake-$(APIVERSION)
-dist_check_DATA = \
-  t/ax/test-init.sh  \
-  t/ax/plain-functions.sh  \
+# Static dependencies valid for each test case (also further
+# extended later).  Note that use 'noinst_' rather than 'check_'
+# as the prefix, because we really want them to be built by
+# "make all".  This makes it easier to run the test cases by
+# hand after having simply configured and built the package.
+
+nodist_noinst_SCRIPTS = \
+  t/wrap/aclocal-$(APIVERSION) \
+  t/wrap/automake-$(APIVERSION)
+
+dist_noinst_DATA = \
+  t/ax/test-lib.sh \
+  t/ax/am-test-lib.sh \
   t/ax/tap-functions.sh
-nodist_check_DATA = defs-static
 
 # Few more static dependencies.
 t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am
 t/distcheck-outdated-m4.log: t/ax/distcheck-hook-m4.am
 EXTRA_DIST += t/ax/distcheck-hook-m4.am
 
-defs-static: defs-static.in Makefile
+t/ax/test-defs.sh: t/ax/test-defs.in Makefile
        $(AM_V_at)rm -f $@ $@-t
-       $(AM_V_GEN)in=defs-static.in\
-         && $(do_subst) <$(srcdir)/defs-static.in >$@-t
+       $(AM_V_GEN)in=t/ax/test-defs.in \
+         && $(do_subst) <$(srcdir)/$$in >$@-t
        $(generated_file_finalize)
-EXTRA_DIST += defs-static.in
-CLEANFILES += defs-static
+EXTRA_DIST += t/ax/test-defs.in
+CLEANFILES += t/ax/test-defs.sh
+nodist_noinst_DATA = t/ax/test-defs.sh
 
 runtest: runtest.in Makefile
        $(AM_V_at)rm -f $@ $@-t
@@ -462,7 +483,7 @@ check-local: check-tests-syntax
 .PHONY: check-tests-syntax
 
 ## Checking the list of tests.
-test_subdirs = t t/pm t/perf contrib/t
+test_subdirs = t t/pm contrib/t
 include $(srcdir)/t/CheckListOfTests.am
 
 # Run the testsuite with the installed aclocal and automake.
@@ -470,6 +491,15 @@ installcheck-local: installcheck-testsuite
 installcheck-testsuite:
        am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
 
+# Performance tests.
+.PHONY: perf
+perf: all
+       $(MAKE) $(AM_MAKEFLAGS) TEST_SUITE_LOG='$(PERF_TEST_SUITE_LOG)' \
+                               TESTS='$(perf_TESTS)' check
+PERF_TEST_SUITE_LOG = t/perf/test-suite.log
+CLEANFILES += $(PERF_TEST_SUITE_LOG)
+EXTRA_DIST += $(perf_TESTS)
+
 clean-local: clean-local-check
 .PHONY: clean-local-check
 clean-local-check:
@@ -545,7 +575,7 @@ amhello_configury = \
   missing \
   src/Makefile.in
 
-dist_noinst_DATA = $(amhello_sources)
+dist_noinst_DATA += $(amhello_sources)
 dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz
 
 # We depend on configure.ac so that we regenerate the tarball
index 69edd9a..b3dfe1f 100644 (file)
@@ -325,10 +325,23 @@ AC_DEFUN([_AM_CHECK_CANDIDATE_SHELL],
       [], [am_score=1; break])
 
     _AM_CHECK_SHELL_FEATURE([$1],
+      [can define exit traps in a shell function],
+      [fail=0 && foo() { trap 'fail=1' 0; } && foo && test $fail = 0],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
       [corrupts stderr with "set -x"],
       [(set -x; P=1 true 2>&3) 3>&1 2>/dev/null | grep P=1],
       [am_score=9], [])
 
+    echo 'return 34' > conftest-return.sh
+    echo 'ok=no' >> conftest-return.sh
+    _AM_CHECK_SHELL_FEATURE([$1],
+      [can return early from "dot-sourced" files],
+      [ok=yes; . ./conftest-return.sh; test $? -eq 34 && test $ok = yes],
+      [rm -f conftest-return.sh],
+      [rm -f conftest-return.sh; am_score=1; break])
+
     echo 'alias false=echo' > conftest-alias.sh
     echo 'false && test "$(false 97)" = 97' >> conftest-alias.sh
     _AM_CHECK_SHELL_FEATURE([$1],
diff --git a/defs b/defs
index df85746..1ee1116 100644 (file)
--- a/defs
+++ b/defs
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Source the shell static setup and variable definitions.
-. ./defs-static; test $? -eq 0 || exit 99
+set -e
 
-# Source the actual test initialization and setup code, and return
-# control to the test script that is sourcing us.
-. "$am_testauxdir/test-init.sh"
+# Source the actual code for test initialization and setup.
+. test-lib.sh
+. am-test-lib.sh
+
+# Run that setup, and return control to the test script sourcing us.
+am_test_setup
index 25da45c..21c26c4 100755 (executable)
@@ -31,6 +31,13 @@ my $me = File::Basename::basename $0;
 # For use in VPATH builds.
 my $srcdir = ".";
 
+# The testsuite subdirectory, relative to the top-lever source directory.
+my $testdir = "t";
+
+# Where testsuite-related helper scripts, data files and shell libraries
+# are placed.  Relative to the top-lever source directory.
+my $testauxdir = "$testdir/ax";
+
 #--------------------------------------------------------------------------
 
 sub unindent ($)
@@ -89,7 +96,7 @@ sub write_wrapper_script ($$$)
   print $file_handle unindent <<EOF;
     #! /bin/sh
     # This file has been automatically generated.  DO NOT EDIT BY HAND!
-    . ./defs-static || exit 1
+    . test-lib.sh
     $shell_setup_code
     # In the spirit of VPATH, we prefer a test in the build tree
     # over one in the source tree.
@@ -109,7 +116,7 @@ sub get_list_of_tests ()
   my $make = defined $ENV{MAKE} ? $ENV{MAKE} : "make";
   # Unset MAKEFLAGS, for when we are called from make itself.
   my $cmd = "MAKEFLAGS= && unset MAKEFLAGS && cd '$srcdir' && "
-            . "$make -s -f t/list-of-tests.mk print-list-of-tests";
+            . "$make -s -f $testdir/list-of-tests.mk print-list-of-tests";
   my @tests_list = split /\s+/, `$cmd`;
   die "$me: cannot get list of tests\n" unless $? == 0 && @tests_list;
   my $ok = 1;
@@ -135,52 +142,48 @@ sub parse_options (@)
 
 #--------------------------------------------------------------------------
 
-# Where testsuite-related helper scripts, data files and shell libraries
-# are placed.  Relative to the 't/' subdirectory.
-my $auxdir = "ax";
-
 my %deps_extractor =
   (
     libtool_macros =>
       {
         line_matcher => qr/^\s*required=.*\blibtool/,
-        nodist_prereqs => "t/libtool-macros.log",
+        nodist_prereqs => "$testdir/libtool-macros.log",
       },
     gettext_macros =>
       {
         line_matcher => qr/^\s*required=.*\bgettext/,
-        nodist_prereqs => "t/gettext-macros.log",
+        nodist_prereqs => "$testdir/gettext-macros.log",
       },
     use_trivial_test_driver =>
       {
         line_matcher => qr/\btrivial-test-driver\b/,
-        dist_prereqs => "t/$auxdir/trivial-test-driver",
+        dist_prereqs => "$testauxdir/trivial-test-driver",
       },
     check_testsuite_summary =>
       {
         line_matcher => qr/\btestsuite-summary-checks\.sh\b/,
-        dist_prereqs => "t/$auxdir/testsuite-summary-checks.sh",
+        dist_prereqs => "$testauxdir/testsuite-summary-checks.sh",
       },
     extract_testsuite_summary =>
       {
         line_matcher => qr/\bextract-testsuite-summary\.pl\b/,
-        dist_prereqs => "t/$auxdir/extract-testsuite-summary.pl",
+        dist_prereqs => "$testauxdir/extract-testsuite-summary.pl",
       },
     check_tap_testsuite_summary =>
       {
         line_matcher => qr/\btap-summary-aux\.sh\b/,
-        dist_prereqs => "t/$auxdir/tap-summary-aux.sh",
+        dist_prereqs => "$testauxdir/tap-summary-aux.sh",
       },
     on_tap_with_common_setup =>
       {
         line_matcher => qr/\btap-setup\.sh\b/,
-        dist_prereqs => "t/$auxdir/tap-setup.sh",
-        nodist_prereqs => "t/tap-common-setup.log",
+        dist_prereqs => "$testauxdir/tap-setup.sh",
+        nodist_prereqs => "$testdir/tap-common-setup.log",
       },
     depcomp =>
       {
         line_matcher => qr/\bdepcomp\.sh\b/,
-        dist_prereqs => "t/$auxdir/depcomp.sh",
+        dist_prereqs => "$testauxdir/depcomp.sh",
       },
   );
 
@@ -344,7 +347,7 @@ foreach my $lt (TRUE, FALSE)
             "depmode=$m",
             "depcomp_with_libtool=" . ($lt ? "yes" : "no"),
           );
-        my $test = "t/depcomp" . ($lt ? "-lt-" : "-") . $m . ".tap";
+        my $test = "$testdir/depcomp" . ($lt ? "-lt-" : "-") . "$m.tap";
         # Register wrapper test as "autogenerated" ...
         push @generated_tests, $test;
         # ... and create it.
index 31f8e01..c2c5d1f 100644 (file)
@@ -16,7 +16,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Run an Automake test from the command line.
-# Usage:
 
 set -e; set -u
 
@@ -24,28 +23,77 @@ set -e; set -u
 : ${AM_PROVE_CMD='prove'}
 : ${AM_PROVEFLAGS='--merge --verbose'}
 : ${srcdir='@srcdir@'}
+: ${abs_srcdir='@abs_srcdir@'}
+: ${abs_builddir='@abs_builddir@'}
+: ${PATH_SEPARATOR='@PATH_SEPARATOR@'}
+
+# For sourcing of extra "shell libraries" by our test scripts.  As per
+# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
+# in case it is given with a relative name containing no slashes.
+if test "$srcdir" != .; then
+  PATH=$abs_srcdir/t/ax$PATH_SEPARATOR$PATH
+fi
+PATH=$abs_builddir/t/ax$PATH_SEPARATOR$PATH
+export PATH
+
+# For use by the testsuite framework.  The Automake test harness
+# define this, so we better do the same.
+export srcdir
+
+# Some testsuite-influential variables should be overridable from the
+# test scripts, but not from the environment.
+# Keep this in sync with the 'Makefile.am:AM_TESTS_ENVIRONMENT'.
+for v in \
+  required \
+  am_test_protocol \
+  am_serial_tests \
+  am_test_prefer_config_shell \
+  am_original_AUTOMAKE \
+  am_original_ACLOCAL \
+  am_test_lib_sourced \
+  test_lib_sourced \
+; do
+  eval "$v= && unset $v" || exit 1
+done
+unset v
 
 error () { echo "$0: $*" >&2; exit 255; }
 
 # Some shell flags should be passed over to the test scripts.
-#while test $# -gt 0; do
-#  case $1 in
-#    --help) echo "Usage: $0 [SHELL-OPTIONS] TEST [TEST-OPTIONS]"; exit $?;;
-#    -*)
-#  esac
-#done
+shell_opts=
+while test $# -gt 0; do
+  case $1 in
+    --help)
+       echo "Usage: $0 [--shell=PATH] [SHELL-OPTIONS] TEST [TEST-OPTIONS]"
+       exit $?
+       ;;
+    --shell)
+       test $# -gt 1 || error "missing argument for option '$1'"
+       AM_TEST_RUNNER_SHELL=$2
+       shift
+       ;;
+    --shell=*)
+       AM_TEST_RUNNER_SHELL=${1#--shell=}
+       ;;
+    -o)
+       test $# -gt 1 || error "missing argument for option '$1'"
+       shell_opts="$shell_opts -o $2"
+       shift
+       ;;
+    -*)
+       # Assume it is an option to pass through to the shell.
+       shell_opts="$shell_opts $1";;
+     *)
+       break;;
+  esac
+  shift
+done
 
 test $# -gt 0 || error "missing argument"
 
 tst=$1; shift
 
 case $tst in
-   *.sh) wrapper () { exec "$@"; };;
-  *.tap) wrapper () { exec "$AM_PROVE_CMD" $AM_PROVEFLAGS -e "$@"; };;
-      *) error "test '$tst' has an unrecognized extension";;
-esac
-
-case $tst in
   /*) ;;
    *) if test -f ./$tst; then
         tst=./$tst
@@ -58,5 +106,14 @@ case $tst in
       ;;
 esac
 
-wrapper "$AM_TEST_RUNNER_SHELL" "$tst" "$@"
+case $tst in
+  *.sh)
+    exec $AM_TEST_RUNNER_SHELL $shell_opts "$tst" "$@" ;;
+  *.tap)
+    exec "$AM_PROVE_CMD" $AM_PROVEFLAGS -e \
+         "$AM_TEST_RUNNER_SHELL $shell_opts" "$tst" "$@" ;;
+  *)
+    error "test '$tst' has an unrecognized extension" ;;
+esac
+
 error "dead code reached"
index 6ebaf69..032e7be 100644 (file)
@@ -31,7 +31,11 @@ xtests := $(shell \
      done; \
    done | sort)
 
-xdefs = $(srcdir)/t/ax/test-init.sh $(srcdir)/defs $(srcdir)/defs-static.in
+xdefs = \
+  $(srcdir)/t/ax/am-test-lib.sh \
+  $(srcdir)/t/ax/test-lib.sh \
+  $(srcdir)/t/ax/test-defs.in \
+  $(srcdir)/defs
 
 ams := $(shell find $(srcdir) -name '*.dir' -prune -o -name '*.am' -print)
 
@@ -217,6 +221,7 @@ sc_tests_make_without_am_makeflags:
 sc_tests_obsolete_variables:
        @vars=" \
          using_tap \
+         am_using_tap \
          test_prefer_config_shell \
          original_AUTOMAKE \
          original_ACLOCAL \
index 60b4252..06f087f 100644 (file)
--- a/t/README
+++ b/t/README
@@ -234,7 +234,7 @@ Writing test cases
   example, if you need to copy or grep an automake-provided script,
   do not assume that they can be found in the '$top_srcdir/lib'
   directory, but use '$am_scriptdir' instead.  The complete list of
-  such "$am_...dir" variables can be found in the 'defs-static.in'
+  such "$am_...dir" variables can be found in the 't/ax/test-defs.in'
   file.
 
 * When writing input for lex, include the following in the definitions
similarity index 74%
rename from t/ax/test-init.sh
rename to t/ax/am-test-lib.sh
index c2c8d4d..e2723f3 100644 (file)
 ###  IMPORTANT NOTE: keep this file 'set -e' clean.  ###
 ########################################################
 
-# Enable the errexit shell flag early.
-set -e
-
-
-## --------------------- ##
-##  Early sanity checks. ##
-## --------------------- ##
-
-# Ensure $am_top_srcdir is set correctly.
-test -f "$am_top_srcdir/defs-static.in" || {
-   echo "$me: $am_top_srcdir/defs-static.in not found," \
-        "check \$am_top_srcdir" >&2
-   exit 99
-}
-
-# Ensure $am_top_builddir is set correctly.
-test -f "$am_top_builddir/defs-static" || {
-   echo "$me: $am_top_builddir/defs-static not found," \
-        "check \$am_top_builddir" >&2
-   exit 99
-}
-
-
-## ------------------ ##
-##  Early variables.  ##
-## ------------------ ##
+# Do not source several times.
+test ${am_test_lib_sourced-no} = yes && return 0
+am_test_lib_sourced=yes
 
-# A single whitespace character.
-sp=' '
-# A tabulation character.
-tab='  '
-# A newline character.
-nl='
-'
 # A literal escape character.  Used by test checking colored output.
 esc='\e'
 
-# As autoconf-generated configure scripts do, ensure that IFS
-# is defined initially, so that saving and restoring $IFS works.
-IFS=$sp$tab$nl
-
-
-## ----------------------- ##
-##  Early debugging info.  ##
-## ----------------------- ##
-
-echo "Running from installcheck: $am_running_installcheck"
-echo "Using TAP: $am_using_tap"
-echo "PATH = $PATH"
-
+# This might be used in testcases checking distribution-related features.
+# Test scripts are free to override this if they need to.
+distdir=$me-1.0
 
 ## ---------------------- ##
 ##  Environment cleanup.  ##
@@ -128,56 +88,6 @@ unset pfx
 # Re-enable, it had been temporarily disabled above.
 set -e
 
-## ---------------------------- ##
-##  Auxiliary shell functions.  ##
-## ---------------------------- ##
-
-# Tell whether we should keep the test directories around, even in
-# case of success.  By default, we don't.
-am_keeping_testdirs ()
-{
-  case $keep_testdirs in
-     ""|n|no|NO) return 1;;
-              *) return 0;;
-  esac
-}
-
-# This is used in '_am_exit' and in the exit trap.  See comments in
-# the latter for more information.
-am__test_skipped=no
-
-# We use a trap below for cleanup.  This requires us to go through
-# hoops to get the right exit status transported through the signal.
-# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
-# sh inside this function (FIXME: is this still relevant now that we
-# require a POSIX shell?).
-_am_exit ()
-{
-  set +e
-  # See comments in the exit trap for the reason we do this.
-  test 77 = $1 && am__test_skipped=yes
-  # Spurious escaping to ensure we do not call our 'exit' alias.
-  (\exit $1); \exit $1
-}
-alias exit=_am_exit
-
-if test $am_using_tap = yes; then
-  am_funcs_file=tap-functions.sh
-else
-  am_funcs_file=plain-functions.sh
-fi
-
-if test -f "$am_testauxdir/$am_funcs_file"; then
-  . "$am_testauxdir/$am_funcs_file" || {
-    echo "$me: error sourcing $am_testauxdir/$am_funcs_file" >&2
-    exit 99
-  }
-else
-  echo "$me: $am_testauxdir/$am_funcs_file not found" >&2
-  exit 99
-fi
-unset am_funcs_file
-
 # cross_compiling
 # ---------------
 # Tell whether we are cross-compiling.  This is especially useful to skip
@@ -245,7 +155,7 @@ AUTOMAKE_run ()
   $AUTOMAKE ${1+"$@"} >stdout 2>stderr || am__got_rc=$?
   cat stderr >&2
   cat stdout
-  if test $am_using_tap != yes; then
+  if test $am_test_protocol = none; then
     test $am__got_rc -eq $am__exp_rc || exit 1
     return
   fi
@@ -428,41 +338,6 @@ am__useless_vpath_rebuild=""
 
 yl_distcheck () { useless_vpath_rebuild || $MAKE distcheck ${1+"$@"}; }
 
-# seq_ - print a sequence of numbers
-# ----------------------------------
-# This function simulates GNU seq(1) portably.  Valid usages:
-#  - seq LAST
-#  - seq FIRST LAST
-#  - seq FIRST INCREMENT LAST
-seq_ ()
-{
-  case $# in
-    0) fatal_ "seq_: missing argument";;
-    1) seq_first=1  seq_incr=1  seq_last=$1;;
-    2) seq_first=$1 seq_incr=1  seq_last=$2;;
-    3) seq_first=$1 seq_incr=$2 seq_last=$3;;
-    *) fatal_ "seq_: too many arguments";;
-  esac
-  i=$seq_first
-  while test $i -le $seq_last; do
-    echo $i
-    i=$(($i + $seq_incr))
-  done
-}
-
-# rm_rf_ [FILES OR DIRECTORIES ...]
-# ---------------------------------
-# Recursively remove the given files or directory, also handling the case
-# of non-writable subdirectories.
-rm_rf_ ()
-{
-  test $# -gt 0 || return 0
-  # Ignore failures in find, we are only interested in failures of the
-  # final rm.
-  find "$@" -type d ! -perm -700 -exec chmod u+rwx {} \; || :
-  rm -rf "$@"
-}
-
 # count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N
 # -----------------------------------------------------------------------
 # Check that a testsuite run driven by the parallel-tests harness has
@@ -500,37 +375,6 @@ count_test_results ()
   )
 }
 
-commented_sed_unindent_prog='
-  /^$/b                    # Nothing to do for empty lines.
-  x                        # Get x<indent> into pattern space.
-  /^$/{                    # No prior x<indent>, go prepare it.
-    g                      # Copy this 1st non-blank line into pattern space.
-    s/^\(['"$tab"' ]*\).*/x\1/   # Prepare x<indent> in pattern space.
-  }                        # Now: x<indent> in pattern and <line> in hold.
-  G                        # Build x<indent>\n<line> in pattern space, and
-  h                        # duplicate it into hold space.
-  s/\n.*$//                # Restore x<indent> in pattern space, and
-  x                        # exchange with the above duplicate in hold space.
-  s/^x\(.*\)\n\1//         # Remove leading <indent> from <line>.
-  s/^x.*\n//               # Restore <line> when there is no leading <indent>.
-'
-
-# unindent [input files...]
-# -------------------------
-# Remove the "proper" amount of leading whitespace from the given files,
-# and output the result on stdout.  That amount is determined by looking
-# at the leading whitespace of the first non-blank line in the input
-# files.  If no input file is specified, standard input is implied.
-unindent ()
-{
-  if test x"$sed_unindent_prog" = x; then
-    sed_unindent_prog=$(printf '%s\n' "$commented_sed_unindent_prog" \
-                          | sed -e "s/  *# .*//")
-  fi
-  sed "$sed_unindent_prog" ${1+"$@"}
-}
-sed_unindent_prog="" # Avoid interferences from the environment.
-
 # get_shell_script SCRIPT-NAME
 # -----------------------------
 # Fetch an Automake-provided shell script from the 'lib/' directory into
@@ -654,25 +498,12 @@ require_compiler_ ()
 ##  required by them.                                          ##
 ## ----------------------------------------------------------- ##
 
-# Performance tests must be enabled explicitly.
-case $argv0 in
-  */perf/*)
-    case $AM_TESTSUITE_PERF in
-      [yY]|[yY]es|1) ;;
-      *) skip_ "performance tests not explicitly enabled" ;;
-    esac
-    ;;
-esac
-
-# Look for (and maybe set up) required tools and/or system features; skip
-# the current test if they are not found.
-for tool in : $required
-do
-  # Check that each required tool is present.
-  case $tool in
-    :) ;;
+require_tool ()
+{
+  am_tool=$1
+  case $1 in
     cc|c++|fortran|fortran77)
-      require_compiler_ $tool;;
+      require_compiler_ $1;;
     xsi-lib-shell)
       if test x"$am_test_prefer_config_shell" = x"yes"; then
         require_xsi "$SHELL"
@@ -878,94 +709,40 @@ do
       ;;
     *)
       # Generic case: the tool must support --version.
-      echo "$me: running $tool --version"
-      # It is not likely but possible that $tool is a special builtin,
-      # in which case the shell is allowed to exit after an error.  So
-      # we need the subshell here.  Also, some tools, like Sun cscope,
+      echo "$me: running $1 --version"
+      # It is not likely but possible that the required tool is a special
+      # builtin, in which case the shell is allowed to exit after an error.
+      # So we need the subshell here.  Also, some tools, like Sun cscope,
       # can be interactive without redirection.
-      ($tool --version) </dev/null \
-        || skip_all_ "required program '$tool' not available"
+      ($1 --version) </dev/null \
+        || skip_all_ "required program '$1' not available"
       ;;
   esac
-done
-
-# We might need extra macros, e.g., from Libtool or Gettext.
-case " $required " in *\ libtool*) . ./t/libtool-macros.dir/get.sh;; esac
-case " $required " in *\ gettext*) . ./t/gettext-macros.dir/get.sh;; esac
+}
 
+process_requirements ()
+{
+  # Look for (and maybe set up) required tools and/or system features;
+  # skip the current test if they are not found.
+  for am_tool in $*; do
+    require_tool $am_tool
+  done
+  unset am_tool
+  # We might need extra macros, e.g., from Libtool or Gettext.
+  case " $required " in
+    *\ libtool*) . ./t/libtool-macros.dir/get.sh;;
+  esac
+  case " $required " in
+    *\ gettext*) . ./t/gettext-macros.dir/get.sh;;
+  esac
+}
 
 ## ---------------------------------------------------------------- ##
 ##  Create and set up of the temporary directory used by the test.  ##
-##  Set up of the exit trap for cleanup of said directory.          ##
 ## ---------------------------------------------------------------- ##
 
-# This might be used in testcases checking distribution-related features.
-# Test scripts are free to override this if they need to.
-distdir=$me-1.0
-
-# Set up the exit trap.
-trap 'exit_status=$?
-  set +e
-  cd "$am_top_builddir"
-  if test $am_using_tap = yes; then
-    if test "$planned_" = later && test $exit_status -eq 0; then
-      plan_ "now"
-    fi
-    test $exit_status -eq 0 && test $tap_pass_count_ -eq $tap_count_ \
-      || keep_testdirs=yes
-  else
-    # This is to ensure that a test script does give a SKIP outcome just
-    # because a command in it happens to exit with status 77.  This
-    # behaviour, while from time to time useful to developers, is not
-    # meant to be enabled by default, as it could cause spurious failures
-    # in the wild.  Thus it will be enabled only when the variable
-    # "am_explicit_skips" is set to a "true" value.
-    case $am_explicit_skips in
-      [yY]|[yY]es|1)
-        if test $exit_status -eq 77 && test $am__test_skipped != yes; then
-          echo "$me: implicit skip turned into failure"
-          exit_status=78
-        fi;;
-    esac
-    test $exit_status -eq 0 || keep_testdirs=yes
-  fi
-  am_keeping_testdirs || rm_rf_ $am_test_subdir
-  set +x
-  echo "$me: exit $exit_status"
-  # Spurious escaping to ensure we do not call our "exit" alias.
-  \exit $exit_status
-' 0
-trap "fatal_ 'caught signal SIGHUP'" 1
-trap "fatal_ 'caught signal SIGINT'" 2
-trap "fatal_ 'caught signal SIGTERM'" 15
-# Various shells seems to just ignore SIGQUIT under some circumstances,
-# even if the signal is not blocked; however, if the signal it trapped,
-# the trap gets correctly executed.  So we also trap SIGQUIT.
-# Here is a list of some shells that have been verified to exhibit the
-# problematic behavior with SIGQUIT:
-#  - zsh 4.3.12 on Debian GNU/Linux
-#  - /bin/ksh and /usr/xpg4/bin/sh on Solaris 10
-#  - Bash 3.2.51 on Solaris 10 and bash 4.1.5 on Debian GNU/Linux
-#  - AT&T ksh on Debian Gnu/Linux (deb package ksh, version 93u-1)
-# OTOH, at least these shells that do *not* exhibit that behaviour:
-#  - modern version of the Almquist Shell (at least 0.5.5.1), on
-#    both Solaris and GNU/Linux
-#  - public domain Korn Shell, version 5.2.14, on Debian GNU/Linux
-trap "fatal_ 'caught signal SIGQUIT'" 3
-# Ignore further SIGPIPE in the trap code.  This is required to avoid
-# a very weird issue with some shells, at least when the execution of
-# the automake testsuite is driven by the 'prove' utility: if prove
-# (or the make process that has spawned it) gets interrupted with
-# Ctrl-C, the shell might go in a loop, continually getting a SIGPIPE,
-# sometimes finally dumping core, other times hanging indefinitely.
-# See also Test::Harness bug [rt.cpan.org #70855], archived at
-# <https://rt.cpan.org/Ticket/Display.html?id=70855>
-trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13
-
-# Create and populate the temporary directory, if and as required.
-if test x"$am_create_testdir" = x"no"; then
-  am_test_subdir=
-else
+am_setup_testdir ()
+{
   # The subdirectory where the current test script will run and write its
   # temporary/data files.  This will be created shortly, and will be removed
   # by the cleanup trap below if the test passes.  If the test doesn't pass,
@@ -1000,12 +777,11 @@ else
       echo "AC_CONFIG_FILES([Makefile])"
     } >configure.ac || framework_failure_ "creating configure.ac skeleton"
   fi
-fi
-
-
-## ---------------- ##
-##  Ready to go...  ##
-## ---------------- ##
+}
 
-set -x
-pwd
+am_extra_info ()
+{
+  echo "Running from installcheck: $am_running_installcheck"
+  echo "Test Protocol: $am_test_protocol"
+  echo "PATH = $PATH"
+}
diff --git a/t/ax/plain-functions.sh b/t/ax/plain-functions.sh
deleted file mode 100644 (file)
index 6c5fef8..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- shell-script -*-
-#
-# Copyright (C) 2011-2012 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/>.
-
-# Helper functions used by "plain" tests of the Automake testsuite
-# (i.e., tests that don't use any test protocol).
-
-# Print warnings (e.g., about skipped and failed tests) to this file
-# number.  Override by putting, say:
-#   AM_TESTS_ENVIRONMENT = stderr_fileno_=9; export stderr_fileno_;
-#   AM_TESTS_FD_REDIRECT = 9>&2
-# in your Makefile.am.
-# This is useful when using automake's parallel tests mode, to print the
-# reason for skip/failure to console, rather than to the *.log files.
-: ${stderr_fileno_=2}
-
-# Copied from Gnulib's 'tests/init.sh'.
-warn_ () { echo "$@" 1>&$stderr_fileno_; }
-fail_ () { warn_ "$me: failed test: $@"; exit 1; }
-skip_ () { warn_ "$me: skipped test: $@"; exit 77; }
-fatal_ () { warn_ "$me: hard error: $@"; exit 99; }
-framework_failure_ () { warn_ "$me: set-up failure: $@"; exit 99; }
-
-# For compatibility with TAP functions.
-skip_all_ () { skip_ "$@"; }
-
-:
index 70487c3..952a49d 100644 (file)
@@ -22,7 +22,7 @@
 
 # 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 && test -d ../../t \
+test -f ../../automake && test -f ../../defs && test -d ../../t \
   || fatal_ "running from a wrong directory"
 
 test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
similarity index 73%
rename from defs-static.in
rename to t/ax/test-defs.in
index 6901212..56b45e1 100644 (file)
 # IMPORTANT NOTES AND REQUIREMENTS
 #   - Multiple inclusions of this file should be idempotent.
 #   - This code has to be 'set -e' clean.
-#   - This file should execute correctly with any system's /bin/sh
-#     shell, not only with configure-time detected $SHELL and/or
-#     $AM_TEST_RUNNER_SHELL.
-
-# CDPATH is evil if exported in the environment.
-CDPATH=; unset CDPATH
-
-# Be more Bourne compatible.
-# (Snippet inspired to configure's initialization in Autoconf 2.64)
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  setopt NO_GLOB_SUBST
-  # If Zsh is not started directly in POSIX-compatibility mode, it has some
-  # incompatibilities in the handling of $0 that conflict with our usage;
-  # i.e., $0 inside a file sourced with the '.' builtin is temporarily set
-  # to the name of the sourced file.  Work around that.
-  # Note that a bug in some versions of Zsh prevents us from resetting $0
-  # in a sourced script, so the use of $argv0.  For more info see:
-  #   <http://www.zsh.org/mla/workers/2009/msg01140.html>
-  # The apparently useless 'eval' here is needed by at least dash 0.5.2,
-  # to prevent it from bailing out with an error like:
-  #   "Syntax error: Bad substitution".
-  eval 'argv0=${functrace[-1]%:*}' && test -f "$argv0" || {
-    echo "Cannot determine the path of running test script." >&2
-    echo "Your Zsh (version $ZSH_VERSION) is probably too old." >&2
-    exit 99
-  }
-else
-  argv0=$0
-  # Avoid command substitution failure, for Tru64 sh -e and instspc*.test.
-  case `(set -o) 2>/dev/null || :` in *posix*) set -o posix;; esac
-fi
-
-# The name of the current test (without the '.sh' or '.tap' suffix).
-me=${argv0##*/} # Strip all directory components.
-case $me in     # Strip test suffix.
-   *.tap) me=${me%.tap};;
-    *.sh) me=${me%.sh} ;;
- esac
-
-# Check that the environment is properly sanitized.
-# Having variables exported to the empty string is OK, since our code
-# treats such variables as if they were unset.
-for var in \
-  required \
-  am_using_tap \
-  am_serial_tests \
-  am_create_testdir \
-  am_tap_implementation \
-  am_test_prefer_config_shell \
-  am_original_AUTOMAKE \
-  am_original_ACLOCAL \
-; do
-  if eval "test x\"\$$var\" != x" && env | grep "^$var=" >/dev/null; then
-    echo "$me: variable '$var' is set in the environment:" \
-         "this is unsafe" >&2
-    exit 99
-  fi
-done
-unset var
 
 # See whether the current test script is expected to use TAP or not.
 # Use a sensible default, while allowing the scripts to override this
 # check.
-if test -z "$am_using_tap"; then
-  case $argv0 in *.tap) am_using_tap=yes;; *) am_using_tap=no;; esac
+if test -z "$am_test_protocol"; then
+  case $argv0 in
+    *.tap) am_test_protocol=tap;;
+        *) am_test_protocol=none;;
+  esac
 fi
 
 am_rel_srcdir='@srcdir@'
@@ -162,8 +103,8 @@ AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}}
 
 # Tests who want complete control over aclocal or automake command-line
 # options should use $am_original_ACLOCAL or $am_original_AUTOMAKE.  The
-# "test -z" tests take care not to re-initialize them if defs-static
-# is re-sourced, as we want defs-static to remain really idempotent.
+# "test -z" tests take care not to re-initialize them if 'test-defs.sh'
+# is re-sourced, as we want that file to remain really idempotent.
 if test -z "$am_original_AUTOMAKE"; then
   am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
 fi
@@ -240,7 +181,4 @@ case $PATH in
   *) PATH=$am_bindir$PATH_SEPARATOR$PATH;;
 esac
 
-# Make our helper script accessible by default.
-PATH=$am_testauxdir$PATH_SEPARATOR$PATH
-
 export PATH
diff --git a/t/ax/test-lib.sh b/t/ax/test-lib.sh
new file mode 100644 (file)
index 0000000..6048f81
--- /dev/null
@@ -0,0 +1,296 @@
+# -*- shell-script -*-
+#
+# Copyright (C) 1996-2012 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/>.
+
+########################################################
+###  IMPORTANT NOTE: keep this file 'set -e' clean.  ###
+########################################################
+
+# Do not source several times.
+test ${test_lib_sourced-no} = yes && return 0
+test_lib_sourced=yes
+
+# CDPATH is evil if used in non-interactive scripts (and even more
+# evil if exported in the environment).
+CDPATH=; unset CDPATH
+
+# Be more Bourne compatible.
+# (Snippet inspired to configure's initialization in Autoconf 2.64)
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  setopt NO_GLOB_SUBST
+  # If Zsh is not started directly in POSIX-compatibility mode, it has some
+  # incompatibilities in the handling of $0 that conflict with our usage;
+  # i.e., $0 inside a file sourced with the '.' builtin is temporarily set
+  # to the name of the sourced file.  Work around that.
+  # Note that a bug in some versions of Zsh prevents us from resetting $0
+  # in a sourced script, so the use of $argv0.  For more info see:
+  #   <http://www.zsh.org/mla/workers/2009/msg01140.html>
+  # The apparently useless 'eval' here is needed by at least dash 0.5.2,
+  # to prevent it from bailing out with an error like:
+  #   "Syntax error: Bad substitution".
+  eval 'argv0=${functrace[-1]%:*}' && test -f "$argv0" || {
+    echo "Cannot determine the path of running test script." >&2
+    echo "Your Zsh (version $ZSH_VERSION) is probably too old." >&2
+    exit 99
+  }
+else
+  argv0=$0
+  # Avoid command substitution failure, for it might cause problems with
+  # "set -e" on some shells.
+  case `(set -o) 2>/dev/null || :` in *posix*) set -o posix;; esac
+fi
+
+# A single whitespace character.
+sp=' '
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+
+# As autoconf-generated configure scripts do, ensure that IFS
+# is defined initially, so that saving and restoring $IFS works.
+IFS=$sp$tab$nl
+
+# The name of the current test (without the '.sh' or '.tap' suffix).
+me=${argv0##*/} # Strip all directory components.
+case $me in     # Strip test suffix.
+   *.tap) me=${me%.tap};;
+    *.sh) me=${me%.sh} ;;
+ esac
+
+# Source extra package-specific configuration.
+. test-defs.sh
+# And fail hard if something went wrong.
+test $? -eq 0 || exit 99
+
+# We use a trap below for cleanup.  This requires us to go through
+# hoops to get the right exit status transported through the signal.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function (FIXME: is this still relevant now that we
+# require a POSIX shell?).
+_am_exit ()
+{
+  set +e
+  # See comments in the exit trap for the reason we do this.
+  test 77 = $1 && am__test_skipped=yes
+  # Spurious escaping to ensure we do not call our 'exit' alias.
+  (\exit $1); \exit $1
+}
+# Avoid interferences from the environment
+am__test_skipped=no
+# This alias must actually be placed before any use if 'exit' -- even
+# just inside a function definition.  Weird, but real.
+alias exit=_am_exit
+
+## ------------------------------------ ##
+##  General testsuite shell functions.  ##
+## ------------------------------------ ##
+
+# Print warnings (e.g., about skipped and failed tests) to this file
+# number.  Override by putting, say:
+#   AM_TESTS_ENVIRONMENT = stderr_fileno_=9; export stderr_fileno_;
+#   AM_TESTS_FD_REDIRECT = 9>&2
+# in your Makefile.am.
+# This is useful when using automake's parallel tests mode, to print the
+# reason for skip/failure to console, rather than to the *.log files.
+: ${stderr_fileno_=2}
+
+# Helper functions used by "plain" tests of the Automake testsuite
+# (i.e., tests that don't use any test protocol).
+# TAP tests will override these functions with their TAP-enhanced
+# equivalents later  (see sourcing of 'tap-functions.sh' below).
+# These are copied from Gnulib's 'tests/init.sh'.
+warn_ () { echo "$@" 1>&$stderr_fileno_; }
+fail_ () { warn_ "$me: failed test: $@"; exit 1; }
+skip_ () { warn_ "$me: skipped test: $@"; exit 77; }
+fatal_ () { warn_ "$me: hard error: $@"; exit 99; }
+framework_failure_ () { warn_ "$me: set-up failure: $@"; exit 99; }
+# For compatibility with TAP functions.
+skip_all_ () { skip_ "$@"; }
+
+if test $am_test_protocol = tap; then
+  . tap-functions.sh
+fi
+
+## ---------------------------- ##
+##  Auxiliary shell functions.  ##
+## ---------------------------- ##
+
+# Tell whether we should keep the test directories around, even in
+# case of success.  By default, we don't.
+am_keeping_testdirs ()
+{
+  case $keep_testdirs in
+     ""|n|no|NO) return 1;;
+              *) return 0;;
+  esac
+}
+
+# seq_ - print a sequence of numbers
+# ----------------------------------
+# This function simulates GNU seq(1) portably.  Valid usages:
+#  - seq LAST
+#  - seq FIRST LAST
+#  - seq FIRST INCREMENT LAST
+seq_ ()
+{
+  case $# in
+    0) fatal_ "seq_: missing argument";;
+    1) seq_first=1  seq_incr=1  seq_last=$1;;
+    2) seq_first=$1 seq_incr=1  seq_last=$2;;
+    3) seq_first=$1 seq_incr=$2 seq_last=$3;;
+    *) fatal_ "seq_: too many arguments";;
+  esac
+  i=$seq_first
+  while test $i -le $seq_last; do
+    echo $i
+    i=$(($i + $seq_incr))
+  done
+}
+
+# rm_rf_ [FILES OR DIRECTORIES ...]
+# ---------------------------------
+# Recursively remove the given files or directory, also handling the case
+# of non-writable subdirectories.
+rm_rf_ ()
+{
+  test $# -gt 0 || return 0
+  # Ignore failures in find, we are only interested in failures of the
+  # final rm.
+  find "$@" -type d ! -perm -700 -exec chmod u+rwx {} \; || :
+  rm -rf "$@"
+}
+
+commented_sed_unindent_prog='
+  /^$/b                    # Nothing to do for empty lines.
+  x                        # Get x<indent> into pattern space.
+  /^$/{                    # No prior x<indent>, go prepare it.
+    g                      # Copy this 1st non-blank line into pattern space.
+    s/^\(['"$tab"' ]*\).*/x\1/   # Prepare x<indent> in pattern space.
+  }                        # Now: x<indent> in pattern and <line> in hold.
+  G                        # Build x<indent>\n<line> in pattern space, and
+  h                        # duplicate it into hold space.
+  s/\n.*$//                # Restore x<indent> in pattern space, and
+  x                        # exchange with the above duplicate in hold space.
+  s/^x\(.*\)\n\1//         # Remove leading <indent> from <line>.
+  s/^x.*\n//               # Restore <line> when there is no leading <indent>.
+'
+
+# unindent [input files...]
+# -------------------------
+# Remove the "proper" amount of leading whitespace from the given files,
+# and output the result on stdout.  That amount is determined by looking
+# at the leading whitespace of the first non-blank line in the input
+# files.  If no input file is specified, standard input is implied.
+unindent ()
+{
+  if test x"$sed_unindent_prog" = x; then
+    sed_unindent_prog=$(printf '%s\n' "$commented_sed_unindent_prog" \
+                          | sed -e "s/  *# .*//")
+  fi
+  sed "$sed_unindent_prog" ${1+"$@"}
+}
+sed_unindent_prog="" # Avoid interferences from the environment.
+
+## ---------------------------------------------------------------- ##
+##  Create and set up of the temporary directory used by the test.  ##
+##  Set up of the exit trap for cleanup of said directory.          ##
+## ---------------------------------------------------------------- ##
+
+# Set up the exit trap.
+am_exit_trap ()
+{
+  exit_status=$1
+  set +e
+  cd "$am_top_builddir"
+  if test $am_test_protocol = tap; then
+    if test "$planned_" = later && test $exit_status -eq 0; then
+      plan_ "now"
+    fi
+    test $exit_status -eq 0 && test $tap_pass_count_ -eq $tap_count_ \
+      || keep_testdirs=yes
+  else
+    # This is to ensure that a test script does give a SKIP outcome just
+    # because a command in it happens to exit with status 77.  This
+    # behaviour, while from time to time useful to developers, is not
+    # meant to be enabled by default, as it could cause spurious failures
+    # in the wild.  Thus it will be enabled only when the variable
+    # "am_explicit_skips" is set to a "true" value.
+    case $am_explicit_skips in
+      [yY]|[yY]es|1)
+        if test $exit_status -eq 77 && test $am__test_skipped != yes; then
+          echo "$me: implicit skip turned into failure"
+          exit_status=78
+        fi;;
+    esac
+    test $exit_status -eq 0 || keep_testdirs=yes
+  fi
+  am_keeping_testdirs || rm_rf_ $am_test_subdir
+  set +x
+  echo "$me: exit $exit_status"
+  # Spurious escaping to ensure we do not call our "exit" alias.
+  \exit $exit_status
+}
+
+am_set_exit_traps ()
+{
+  trap 'am_exit_trap $?' 0
+  trap "fatal_ 'caught signal SIGHUP'" 1
+  trap "fatal_ 'caught signal SIGINT'" 2
+  trap "fatal_ 'caught signal SIGTERM'" 15
+  # Various shells seems to just ignore SIGQUIT under some circumstances,
+  # even if the signal is not blocked; however, if the signal it trapped,
+  # the trap gets correctly executed.  So we also trap SIGQUIT.
+  # Here is a list of some shells that have been verified to exhibit the
+  # problematic behavior with SIGQUIT:
+  #  - zsh 4.3.12 on Debian GNU/Linux
+  #  - /bin/ksh and /usr/xpg4/bin/sh on Solaris 10
+  #  - Bash 3.2.51 on Solaris 10 and bash 4.1.5 on Debian GNU/Linux
+  #  - AT&T ksh on Debian Gnu/Linux (deb package ksh, version 93u-1)
+  # OTOH, at least these shells that do *not* exhibit that behaviour:
+  #  - modern version of the Almquist Shell (at least 0.5.5.1), on
+  #    both Solaris and GNU/Linux
+  #  - public domain Korn Shell, version 5.2.14, on Debian GNU/Linux
+  trap "fatal_ 'caught signal SIGQUIT'" 3
+  # Ignore further SIGPIPE in the trap code.  This is required to avoid
+  # a very weird issue with some shells, at least when the execution of
+  # the automake testsuite is driven by the 'prove' utility: if prove
+  # (or the make process that has spawned it) gets interrupted with
+  # Ctrl-C, the shell might go in a loop, continually getting a SIGPIPE,
+  # sometimes finally dumping core, other times hanging indefinitely.
+  # See also Test::Harness bug [rt.cpan.org #70855], archived at
+  # <https://rt.cpan.org/Ticket/Display.html?id=70855>
+  trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13
+}
+
+am_test_setup ()
+{
+  process_requirements $required
+  am_set_exit_traps
+  # Create and populate the temporary directory, if required.
+  if test x"$am_create_testdir" = x"no"; then
+    am_test_subdir=
+  else
+    am_setup_testdir
+  fi
+  am_extra_info
+  set -x
+  pwd
+}
index c31a658..6f1eeab 100644 (file)
@@ -70,7 +70,6 @@ t/perf/testsuite-summary.sh
 handwritten_TESTS = \
 t/get-sysconf.sh \
 $(perl_TESTS) \
-$(perf_TESTS) \
 t/instspc.tap \
 t/aclocal.sh \
 t/aclocal3.sh \
@@ -949,7 +948,6 @@ t/repeated-options.sh \
 t/rulepat.sh \
 t/self-check-configure-help.sh \
 t/self-check-dir.tap \
-t/self-check-env-sanitize.tap \
 t/self-check-exit.tap \
 t/self-check-explicit-skips.sh \
 t/self-check-is_newest.tap \
@@ -957,7 +955,6 @@ t/self-check-me.tap \
 t/self-check-report.sh \
 t/self-check-seq.tap \
 t/self-check-is-blocked-signal.tap \
-t/self-check-tap.sh \
 t/self-check-unindent.tap \
 t/sanity.sh \
 t/scripts.sh \
index 23b56c3..ac539a1 100755 (executable)
@@ -54,7 +54,12 @@ test:
        test -f '$(bindir)/libquux.a'
        ls -l '$(libexecdir)/bar.h'
        test -f '$(libexecdir)/bar.h'
-       test ! -x '$(libexecdir)/bar.h'
+## If this test is run as root, "test -x" could suceed also for
+## non-executable files, so we need to protect the next check.
+## See automake bug#12041.
+       if test -x Makefile; then echo SKIP THIS; else \
+         test ! -x '$(libexecdir)/bar.h'; \
+       fi;
 END
 
 cat > foo.c <<'END'
diff --git a/t/self-check-env-sanitize.tap b/t/self-check-env-sanitize.tap
deleted file mode 100755 (executable)
index 3e48d89..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011-2012 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/>.
-
-# Sanity check for the automake testsuite.
-# Make sure that the testsuite initialization code complains when
-# some testsuite-influential variables are set in the environment.
-
-am_create_testdir=no
-. ./defs || exit 1
-
-set -x
-exec 5>&1
-
-plan_ 16 # Two times the number of variable names in $vars.
-
-vars='
-  required
-  am_serial_tests
-  am_using_tap
-  am_create_testdir
-  am_tap_implementation
-  am_test_prefer_config_shell
-  am_original_AUTOMAKE
-  am_original_ACLOCAL
-'
-
-do_run ()
-{
-  env "$1=foo" $AM_TEST_RUNNER_SHELL -c '. ./defs' foo.test
-}
-
-do_grep ()
-{
-  env "$1=foo" $AM_TEST_RUNNER_SHELL -c '. ./defs' foo.test 2>&1 1>&5 \
-    | grep "foo\.test:.* variable '$1'.* in the environment.*unsafe"
-}
-
-for var in $vars; do
-  command_ok_ "$var [err status]" not do_run $var
-  command_ok_ "$var [err message]" do_grep $var
-done
-
-:
diff --git a/t/self-check-tap.sh b/t/self-check-tap.sh
deleted file mode 100755 (executable)
index d7f788c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011-2012 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/>.
-
-# Sanity check for the automake testsuite.
-# Make sure that $am_using_tap gets automatically defined by
-# './defs-static', but can be overridden by the individual tests.
-
-. ./defs-static || exit 1
-
-set -ex
-
-$AM_TEST_RUNNER_SHELL -c \
-  '. ./defs-static && test $am_using_tap = yes' foo.tap
-
-for name in foo.test tap tap.test foo-tap; do
-  $AM_TEST_RUNNER_SHELL -c \
-    '. ./defs-static && test $am_using_tap = no' $name
-done
-
-$AM_TEST_RUNNER_SHELL -c '
-  am_using_tap=no
-  . ./defs-static
-  test $am_using_tap = no
-' foo.tap
-
-$AM_TEST_RUNNER_SHELL -c '
-  am_using_tap=yes
-  . ./defs-static
-  test $am_using_tap = yes
-' foo.test
-
-:
index 74f258f..aaf2cd0 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 1..6
index abc4ec8..876245e 100755 (executable)
@@ -22,7 +22,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..14
index 5b49c33..f87ccb3 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 First line
index d0d3096..dfbadba 100755 (executable)
@@ -23,7 +23,7 @@
 am_tap_implementation=shell
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > a.test <<END
 1..1
index c83ba8a..7cd5458 100755 (executable)
@@ -26,7 +26,7 @@ cat > Makefile.am <<END
 TESTS = $tests
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > exit.test << 'END'
 #!/bin/sh
index 69ac88f..54e21fd 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 echo AM_TEST_LOG_DRIVER_FLAGS = --comments >> Makefile
 
index cd9aa14..bd90f8d 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 # Various errors that can all be squashed into a single test script.
 cat > foo.test << 'END'
index 91dfd24..08f12fd 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 : > exp
 
index 2fa45d1..a3fab2f 100755 (executable)
@@ -36,7 +36,7 @@ TESTS = all.test skip.test bail.test badplan.test noplan.test \
         few.test many.test order.test afterlate.test
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test << 'END'
 1..5
index ee76e93..8e84a63 100755 (executable)
@@ -26,7 +26,7 @@ b.log: a.log
 c.log: b.log
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > a.test << 'END'
 #!/bin/sh
index 10b4f5b..fc00af9 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 metacharacters=\''"\$!&()[]<>#;^?*'
 
index c92a152..ae0deef 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 sed 's/\$$//' > all.test <<END
 1..1$
index 976656d..e3d400c 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 # Empty TAP input.
 : > empty.test
index 3080663..49c6398 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..8
index 2fb1ad9..9b59c3d 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..2
index 0949384..c9a9823 100755 (executable)
@@ -34,7 +34,7 @@ done
 
 chmod a+x *.test
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 $MAKE check >stdout && { cat stdout; exit 1; }
 cat stdout
index f879cce..9ca5021 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 #
 # From manpage Test::Harness::TAP(3):
index 88ef412..d69cf50 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 #
 # From manpage Test::Harness::TAP(3):
index 85db2cb..31e1ccb 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > ok.test << 'END'
 1..5
index ba232c3..528c7bb 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > ok.test <<END
 1..3
index 32cb475..2e92f21 100755 (executable)
@@ -29,7 +29,7 @@ TESTS = pass.test skip.test xfail.test fail.test xpass.test error.test
 TEST_SUITE_LOG = global.log
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 # Custom markers, for use in grepping checks.
 cmarker=::: # comment marker
index 1fe4b85..b13d41d 100755 (executable)
@@ -27,7 +27,7 @@ AM_TEST_LOG_DRIVER_FLAGS = --comments --merge
 TESTS = all.test
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 #!/bin/sh
index ddd74c8..06a6f88 100755 (executable)
@@ -30,7 +30,7 @@ echo TESTS = foo.test > Makefile.am
 
 chmod a+x foo.test
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 $MAKE check >stdout && { cat stdout; exit 1; }
 cat stdout
index cf8918c..bdda865 100755 (executable)
@@ -21,7 +21,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 echo 'Bail out! 0' > a.test
 echo 'Bail out! 0.0' > b.test
index 9859e72..9be3816 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test << 'END'
 1..3
index 166b785..d7751d7 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test << 'END'
 1..14
index 7602aff..24e569c 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 echo '1..0 # SKIP 0' > a.test
 echo '1..0 # SKIP 0.0' > b.test
index a1174bc..f55b055 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test << 'END'
 1..10
index 765442a..fbf54be 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..7
index e9a1091..dc4cad3 100755 (executable)
@@ -26,7 +26,7 @@ TEST_LOG_COMPILER = cat
 TESTS = bail.test few.test noplan.test
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > bail.test <<END
 1..1
index e82b26b..f101315 100755 (executable)
@@ -25,7 +25,7 @@ TEST_LOG_DRIVER_FLAGS = --comments
 TESTS = all.test
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 #!/bin/sh
index 3f99498..81104af 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > prefixes <<'END'
 A
index 85e1bba..13c577c 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..1
index ebb58cf..bc98a09 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 echo 1..5 > all.test
 
index f73bb03..bbb9a03 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..4
index 219a159..2d15121 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..5
index fd1c3b6..620addf 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 do_checks ()
 {
index 60292a7..61bc252 100755 (executable)
@@ -18,7 +18,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. 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
index e884a1e..ff0e806 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > a.test <<END
 1..3
index 7b800d5..f6507e0 100755 (executable)
@@ -38,7 +38,7 @@ END
   echo TESTS += exit-$e.test >> Makefile.am
 done
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 st=0
 $MAKE check || st=$?
index 993e750..e2eae17 100755 (executable)
@@ -24,7 +24,7 @@
 
 weirdchars=\''"\$@!&()[]<>#;,:.^?*/'
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 #
 # Only successful tests.
index 86ba401..8fc0c7e 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 # -------------------------------------------------------------------------
 
index 21fd013..4b6a410 100755 (executable)
@@ -25,7 +25,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 my_check ()
 {
index 84047a6..dc1923c 100755 (executable)
@@ -21,7 +21,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > a.test <<END
 1..01
index 68a0f47..cf43d47 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > a.test <<END
 1..1 foo
index 77f16a7..971869b 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > top1.test <<END
 non-TAP line, ignored
index 106cad0..5cc198f 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 sed 's/\$$//' > foo.test <<END
 1..2 $
index 40fc8c3..d222870 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > top.test <<END
 1..3
index 7c1e017..33e5f7f 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 echo TEST_LOG_DRIVER_FLAGS = --comments >> Makefile
 
index 1b20864..0bcc7e3 100755 (executable)
@@ -22,7 +22,7 @@
 
 echo TESTS = one.test two.test > Makefile.am
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > one.test <<'END'
 #!/bin/sh
index 255443d..6558a69 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 1..0 # SKIP
index a67712b..ece3b25 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 # These nested loops below are clearer without indentation.
 i=0
index af33733..678bd19 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > foo.test <<END
 some non-TAP text, will be copied in the global log
index 3a403c7..c840044 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 1..0
index 2ce4686..ef9ab3c 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > foo.test <<END
 1..0 # SKIP
index 01e5895..5fa8ca5 100755 (executable)
@@ -21,7 +21,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 ok 1
index d9c5496..5ae9d3a 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > foo.test <<END
 1..0${tab}${tab}   #${tab}SKIP  ${tab}Strip leading & trailing ${tab}${tab}
index 9e6704b..76a7244 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 weirdchars=\''"$!&()[]<>#;^?*/@%=,.:'
 
index 97b035c..fcac95f 100755 (executable)
@@ -56,7 +56,7 @@ TESTS = all.test
 AM_COLOR_TESTS= no
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 #! /bin/sh
index e774f73..1b7597e 100755 (executable)
@@ -25,7 +25,7 @@ TESTS = foo.test bar.test baz.test
 baz.log: zardoz
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 : > zardoz
 
index 4290751..714f328 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 1..5
index a28512b..e9b516b 100755 (executable)
@@ -17,7 +17,7 @@
 # TAP support:
 #  - colorized testsuite summary
 
-. ./defs-static
+. test-lib.sh
 
 use_colors=yes
-. "$am_testauxdir"/tap-summary-aux.sh
+. tap-summary-aux.sh
index deee099..c4bd739 100755 (executable)
@@ -17,7 +17,7 @@
 # TAP support:
 #  - colorized testsuite summary
 
-. ./defs-static
+. test-lib.sh
 
 use_colors=no
-. "$am_testauxdir"/tap-summary-aux.sh
+. tap-summary-aux.sh
index c085da0..f360349 100755 (executable)
@@ -43,7 +43,7 @@ if test $am_tap_implementation = perl; then
   fi
 fi
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > a.test <<END
 1..1
index b54013a..dc9e160 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 1..2
index b9c8825..b979c8b 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > stub.tap <<END
 1 # TODO
index 81a8128..c4e47cf 100755 (executable)
@@ -25,7 +25,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 # ----------------------------------------------------- #
 #  Check all possible combinations of:                  #
index e00e4b8..75ad7bf 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<END
 1..1
index 2b1f627..0cbf90b 100755 (executable)
@@ -144,7 +144,7 @@ END
 
 chmod a+x *.test
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 # Don't care about exit status or number of test results, they should be
 # checked for in many other tests.
index c69a40a..6d69eb6 100755 (executable)
@@ -21,7 +21,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > all.test <<'END'
 1..7
index aa86dca..94ae1c9 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || exit 1
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 echo 'XFAIL_TESTS = $(TESTS)' >> Makefile
 
index c73ca45..7278a2f 100755 (executable)
 
 # Check coloring of the testsuite summary.
 
-. ./defs-static || exit 1
+. test-lib.sh
 
-use_colors=yes
-use_vpath=no
-
-. "$am_testauxdir"/testsuite-summary-checks.sh || exit 99
+use_colors=yes; use_vpath=no
+. testsuite-summary-checks.sh
 
 ./configure
 
index 265eebf..25ecf27 100755 (executable)
 
 # Check test counts in the testsuite summary.
 
-. ./defs-static || exit 1
+. test-lib.sh
 
-use_colors=no
-use_vpath=no
-
-. "$am_testauxdir"/testsuite-summary-checks.sh || exit 99
+use_colors=no; use_vpath=no
+. testsuite-summary-checks.sh
 
 ./configure