diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-07-26 19:01:49 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-07-26 19:58:46 +0200 |
commit | 94bde9aab7efff7650222e317ef97295c8cfcaed (patch) | |
tree | 2fb4ea77e5d48f79b29f1d1cb322a638f1b398e4 | |
parent | 40d140a6569ff4ec9b8619cb9d1cbefbc13e59b8 (diff) | |
parent | 11927353c180858e7d7f4e775f8de68781ce4d71 (diff) | |
download | automake-94bde9aab7efff7650222e317ef97295c8cfcaed.tar.gz |
Merge branch 'master' into ng/master
* master: (39 commits)
typofix: in a comment in Makefile.am
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'
...
+ Extra non-trivial edits:
* Makefile.am (perf_TESTS): Define here, as 't/list-of-tests.mk' is gone
in the 'ng/master' branch.
(all_TESTS): Don't list tests in 't/perf'; this reflects the removal of
$(perf_TESTS) from $(handwritten_TESTS) done in 't/list-of-tests.mk' on
the 'master' branch.
* t/depcomp-shuffle.sh: Source 'test-lib.sh', not './defs-static'.
Also, simply use:
. depcomp-shuffle.sh
instead of:
. "$am_testauxdir"/depcomp-shuffle.sh
to source the helper shell script 'depcomp-shuffle.sh'. See recent
commit 'v1.12.2-49-g42fb45b' for a rationale.
* t/depcomp-shuffle-sub-vpath.sh: Likewise.
* t/depcomp-shuffle-sub.sh: Likewise.
* t/depcomp-shuffle-vpath.sh: Likewise.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
92 files changed, 607 insertions, 627 deletions
diff --git a/.gitignore b/.gitignore index 51a8b82a4..8fee6b76f 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ /test-suite.log /t/wrap/aclocal-1.* /t/wrap/automake-1.* -/defs-static +/t/ax/test-defs.sh /testsuite-autodeps.am /t/*-w.tap /t/*-w.sh diff --git a/Makefile.am b/Makefile.am index 51258ccfb..362be992b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -305,8 +305,7 @@ include $(srcdir)/contrib/t/local.am all_TESTS = \ $(wildcard $(srcdir)/t/*.sh) \ $(wildcard $(srcdir)/t/*.tap) \ - $(wildcard $(srcdir)/t/pm/*.pl) \ - $(wildcard $(srcdir)/t/perf/*.sh) + $(wildcard $(srcdir)/t/pm/*.pl) # This is to ensure longer-running tests will be run earlier, which is # useful when running the testsuite in parallel on multicore machines. @@ -360,14 +359,17 @@ XFAIL_TESTS = \ # 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; @@ -376,6 +378,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; + # Automatically-computed dependencies for tests. include $(srcdir)/testsuite-autodeps.am @@ -388,32 +400,38 @@ $(srcdir)/testsuite-autodeps.am: $(srcdir)/gen-testsuite-part $(AM_V_at)chmod a-w $(@F)-t && mv -f $(@F)-t $@ EXTRA_DIST += gen-testsuite-part -# 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)$(do_subst) $(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 - $(AM_V_GEN)in=runtest.in \ - && $(MKDIR_P) t/ax \ - && $(do_subst) <$(srcdir)/runtest.in >$@-t \ - && chmod a+x $@-t + $(AM_V_GEN)$(do_subst) + $(AM_V_at)chmod a+x $@-t $(generated_file_finalize) EXTRA_DIST += runtest.in CLEANFILES += runtest @@ -474,10 +492,21 @@ installcheck-local: installcheck-testsuite installcheck-testsuite: am_running_installcheck=yes $(MAKE) check +# Performance tests. +perf_TESTS = $(wildcard $(srcdir)/t/perf/*.sh) \ + $(wildcard $(srcdir)/t/perf/*.tap) +.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: -## Directries candidate to be test directories match this wildcard. +## Directories candidate to be test directories match this wildcard. @globs='t/*.dir t/*/*.dir */t/*.dir */t/*/*.dir'; \ ## The 'nullglob' bash option is not portable, so use perl. dirs=`$(PERL) -e "print join(' ', glob('$$globs'));"` || exit 1; \ @@ -538,7 +567,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 diff --git a/configure.ac b/configure.ac index be050f918..775eae38d 100644 --- a/configure.ac +++ b/configure.ac @@ -321,10 +321,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], @@ -15,9 +15,11 @@ # 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 diff --git a/gen-testsuite-part b/gen-testsuite-part index a67ce55e8..50f8a7049 100755 --- a/gen-testsuite-part +++ b/gen-testsuite-part @@ -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 w="\$am_top_srcdir/$wrapped_test" if test -f "\$w"; then @@ -104,7 +111,8 @@ EOF sub get_list_of_tests () { - my @tests_list = split /\s+/, `cd '$srcdir' && ls t/*.sh t/*.tap`; + my @tests_list = split /\s+/, + `cd '$srcdir' && echo $testdir/*.sh $testdir/*.tap`; # Tests whose names matches this pattern are already autogenerated, # so we shouldn't re-process them. @tests_list = grep { !/-w[0-9]*\.(sh|tap)$/ } @tests_list; @@ -132,57 +140,53 @@ 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", }, depcomp_shuffle => { line_matcher => qr/\bdepcomp-shuffle\.sh\b/, - dist_prereqs => "t/$auxdir/depcomp-shuffle.sh", + dist_prereqs => "$testauxdir/depcomp-shuffle.sh", }, 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", }, ); @@ -345,7 +349,7 @@ foreach my $lt (TRUE, FALSE) ); my $testname = "depcomp" . ($lt ? "-lt-" : "-") . $m . ".tap"; # Create wrapper test. - atomic_write ("$srcdir/t/$testname", sub + atomic_write ("$srcdir/$testdir/$testname", sub { my $file_handle = shift; print $file_handle unindent <<EOF; diff --git a/runtest.in b/runtest.in index 31f8e012c..c2c5d1f9d 100644 --- a/runtest.in +++ b/runtest.in @@ -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" diff --git a/syntax-checks.mk b/syntax-checks.mk index b1e1203fc..67a68a8b4 100644 --- a/syntax-checks.mk +++ b/syntax-checks.mk @@ -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' -a -print) pms := $(dist_perllib_DATA) @@ -421,6 +425,7 @@ sc_docs_no_make_e: sc_tests_obsolete_variables: @vars=" \ using_tap \ + am_using_tap \ test_prefer_config_shell \ original_AUTOMAKE \ original_ACLOCAL \ @@ -232,7 +232,7 @@ Writing test cases example, if you need to copy or grep an Automake-NG 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 diff --git a/t/ax/test-init.sh b/t/ax/am-test-lib.sh index fa479afdd..43585dc09 100644 --- a/t/ax/test-init.sh +++ b/t/ax/am-test-lib.sh @@ -19,56 +19,16 @@ ### 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='' -# 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. ## @@ -126,56 +86,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 @@ -243,7 +153,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 @@ -316,41 +226,6 @@ grep_configure_help () $EGREP "$2" am--our-help || exit 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 @@ -388,37 +263,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 @@ -542,25 +386,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" @@ -754,94 +585,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, @@ -876,12 +653,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 index 6c5fef82a..000000000 --- a/t/ax/plain-functions.sh +++ /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_ "$@"; } - -: diff --git a/t/ax/tap-setup.sh b/t/ax/tap-setup.sh index 70487c3e5..952a49dfa 100644 --- a/t/ax/tap-setup.sh +++ b/t/ax/tap-setup.sh @@ -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~ \ diff --git a/defs-static.in b/t/ax/test-defs.in index 69012128a..56b45e1ca 100644 --- a/defs-static.in +++ b/t/ax/test-defs.in @@ -21,74 +21,15 @@ # 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 index 000000000..6048f8112 --- /dev/null +++ b/t/ax/test-lib.sh @@ -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 +} diff --git a/t/depcomp-shuffle-sub-vpath.sh b/t/depcomp-shuffle-sub-vpath.sh index 18fde7e29..0eee3a8cf 100755 --- a/t/depcomp-shuffle-sub-vpath.sh +++ b/t/depcomp-shuffle-sub-vpath.sh @@ -18,6 +18,6 @@ # - VPATH build # - use of subdir objects -. ./defs-static || exit '99' +. test-lib.sh xdir='sub' vpath='yes' -. "$am_testauxdir"/depcomp-shuffle.sh +. depcomp-shuffle.sh diff --git a/t/depcomp-shuffle-sub.sh b/t/depcomp-shuffle-sub.sh index 21f703baa..8bf843d98 100755 --- a/t/depcomp-shuffle-sub.sh +++ b/t/depcomp-shuffle-sub.sh @@ -18,6 +18,6 @@ # - in-tree build # - use of subdir objects -. ./defs-static || exit 99 +. test-lib.sh xdir='sub' vpath='no' -. "$am_testauxdir"/depcomp-shuffle.sh +. depcomp-shuffle.sh diff --git a/t/depcomp-shuffle-vpath.sh b/t/depcomp-shuffle-vpath.sh index 4baf20fa6..11d4a7ed7 100755 --- a/t/depcomp-shuffle-vpath.sh +++ b/t/depcomp-shuffle-vpath.sh @@ -18,6 +18,6 @@ # - VPATH build # - no use of subdir objects -. ./defs-static || exit 99 +. test-lib.sh xdir='' vpath='yes' -. "$am_testauxdir"/depcomp-shuffle.sh +. depcomp-shuffle.sh diff --git a/t/depcomp-shuffle.sh b/t/depcomp-shuffle.sh index 23ce20c64..70b64ac33 100755 --- a/t/depcomp-shuffle.sh +++ b/t/depcomp-shuffle.sh @@ -18,6 +18,6 @@ # - in-tree build # - no use of subdir objects -. ./defs-static || exit 99 +. test-lib.sh xdir='' vpath='no' -. "$am_testauxdir"/depcomp-shuffle.sh +. depcomp-shuffle.sh diff --git a/t/primary-prefix-couples-force-valid.sh b/t/primary-prefix-couples-force-valid.sh index bf4d39fee..f99f29a8d 100755 --- a/t/primary-prefix-couples-force-valid.sh +++ b/t/primary-prefix-couples-force-valid.sh @@ -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 index 3e48d895f..000000000 --- a/t/self-check-env-sanitize.tap +++ /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 index d7f788c6b..000000000 --- a/t/self-check-tap.sh +++ /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 - -: diff --git a/t/tap-ambiguous-directive.sh b/t/tap-ambiguous-directive.sh index 74f258fb7..aaf2cd06d 100755 --- a/t/tap-ambiguous-directive.sh +++ b/t/tap-ambiguous-directive.sh @@ -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 diff --git a/t/tap-autonumber.sh b/t/tap-autonumber.sh index 74f7facbb..3fab0aab8 100755 --- a/t/tap-autonumber.sh +++ b/t/tap-autonumber.sh @@ -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 diff --git a/t/tap-bailout-and-logging.sh b/t/tap-bailout-and-logging.sh index 5b49c33cf..f87ccb361 100755 --- a/t/tap-bailout-and-logging.sh +++ b/t/tap-bailout-and-logging.sh @@ -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 diff --git a/t/tap-bailout-leading-space.sh b/t/tap-bailout-leading-space.sh index 2612cd24a..0addf0e5a 100755 --- a/t/tap-bailout-leading-space.sh +++ b/t/tap-bailout-leading-space.sh @@ -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 diff --git a/t/tap-bailout-suppress-badexit.sh b/t/tap-bailout-suppress-badexit.sh index c83ba8a81..7cd5458b7 100755 --- a/t/tap-bailout-suppress-badexit.sh +++ b/t/tap-bailout-suppress-badexit.sh @@ -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 diff --git a/t/tap-bailout-suppress-later-diagnostic.sh b/t/tap-bailout-suppress-later-diagnostic.sh index 69ac88f59..54e21fdc4 100755 --- a/t/tap-bailout-suppress-later-diagnostic.sh +++ b/t/tap-bailout-suppress-later-diagnostic.sh @@ -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 diff --git a/t/tap-bailout-suppress-later-errors.sh b/t/tap-bailout-suppress-later-errors.sh index 50739590c..44e28cacf 100755 --- a/t/tap-bailout-suppress-later-errors.sh +++ b/t/tap-bailout-suppress-later-errors.sh @@ -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' diff --git a/t/tap-bailout.sh b/t/tap-bailout.sh index d8c606507..cb051a830 100755 --- a/t/tap-bailout.sh +++ b/t/tap-bailout.sh @@ -19,7 +19,7 @@ . ./defs || exit 1 -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh : > exp diff --git a/t/tap-color.sh b/t/tap-color.sh index f60cc57b8..6b79f39ee 100755 --- a/t/tap-color.sh +++ b/t/tap-color.sh @@ -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 diff --git a/t/tap-deps.sh b/t/tap-deps.sh index 60997b466..472ae3d4f 100755 --- a/t/tap-deps.sh +++ b/t/tap-deps.sh @@ -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 diff --git a/t/tap-diagnostic.sh b/t/tap-diagnostic.sh index 340d69a33..a45b044f1 100755 --- a/t/tap-diagnostic.sh +++ b/t/tap-diagnostic.sh @@ -20,7 +20,7 @@ . ./defs || exit 1 -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh metacharacters=\''"\$!&()[]<>#;^?*' diff --git a/t/tap-empty-diagnostic.sh b/t/tap-empty-diagnostic.sh index c92a152aa..ae0deef3c 100755 --- a/t/tap-empty-diagnostic.sh +++ b/t/tap-empty-diagnostic.sh @@ -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$ diff --git a/t/tap-empty.sh b/t/tap-empty.sh index 976656d25..e3d400c57 100755 --- a/t/tap-empty.sh +++ b/t/tap-empty.sh @@ -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 diff --git a/t/tap-escape-directive-2.sh b/t/tap-escape-directive-2.sh index 30806635d..49c63981c 100755 --- a/t/tap-escape-directive-2.sh +++ b/t/tap-escape-directive-2.sh @@ -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 diff --git a/t/tap-escape-directive.sh b/t/tap-escape-directive.sh index 2fb1ad9fb..9b59c3d8b 100755 --- a/t/tap-escape-directive.sh +++ b/t/tap-escape-directive.sh @@ -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 diff --git a/t/tap-exit.sh b/t/tap-exit.sh index 09493841f..c9a9823b9 100755 --- a/t/tap-exit.sh +++ b/t/tap-exit.sh @@ -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 diff --git a/t/tap-fancy.sh b/t/tap-fancy.sh index f879cceab..9ca50217a 100755 --- a/t/tap-fancy.sh +++ b/t/tap-fancy.sh @@ -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): diff --git a/t/tap-fancy2.sh b/t/tap-fancy2.sh index 88ef41209..d69cf5035 100755 --- a/t/tap-fancy2.sh +++ b/t/tap-fancy2.sh @@ -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): diff --git a/t/tap-global-log.sh b/t/tap-global-log.sh index 9fd851e20..ee3f1b54f 100755 --- a/t/tap-global-log.sh +++ b/t/tap-global-log.sh @@ -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 diff --git a/t/tap-global-result.sh b/t/tap-global-result.sh index 9d695648e..6a91880be 100755 --- a/t/tap-global-result.sh +++ b/t/tap-global-result.sh @@ -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 diff --git a/t/tap-lazy-check.sh b/t/tap-lazy-check.sh index 44befac01..7d3e93ac5 100755 --- a/t/tap-lazy-check.sh +++ b/t/tap-lazy-check.sh @@ -24,7 +24,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 diff --git a/t/tap-log.sh b/t/tap-log.sh index d39965a03..6e0c80de1 100755 --- a/t/tap-log.sh +++ b/t/tap-log.sh @@ -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 diff --git a/t/tap-merge-stdout-stderr.sh b/t/tap-merge-stdout-stderr.sh index 38a5f74b8..6d029c801 100755 --- a/t/tap-merge-stdout-stderr.sh +++ b/t/tap-merge-stdout-stderr.sh @@ -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 diff --git a/t/tap-missing-plan-and-bad-exit.sh b/t/tap-missing-plan-and-bad-exit.sh index ddd74c8a7..06a6f8880 100755 --- a/t/tap-missing-plan-and-bad-exit.sh +++ b/t/tap-missing-plan-and-bad-exit.sh @@ -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 diff --git a/t/tap-msg0-bailout.sh b/t/tap-msg0-bailout.sh index 2faf679f5..e54debd7f 100755 --- a/t/tap-msg0-bailout.sh +++ b/t/tap-msg0-bailout.sh @@ -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 diff --git a/t/tap-msg0-directive.sh b/t/tap-msg0-directive.sh index 9859e7290..9be3816d0 100755 --- a/t/tap-msg0-directive.sh +++ b/t/tap-msg0-directive.sh @@ -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 diff --git a/t/tap-msg0-misc.sh b/t/tap-msg0-misc.sh index 166b78534..d7751d7d2 100755 --- a/t/tap-msg0-misc.sh +++ b/t/tap-msg0-misc.sh @@ -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 diff --git a/t/tap-msg0-planskip.sh b/t/tap-msg0-planskip.sh index 7502a462a..cb905b6a8 100755 --- a/t/tap-msg0-planskip.sh +++ b/t/tap-msg0-planskip.sh @@ -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 diff --git a/t/tap-msg0-result.sh b/t/tap-msg0-result.sh index a1174bcde..f55b0559e 100755 --- a/t/tap-msg0-result.sh +++ b/t/tap-msg0-result.sh @@ -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 diff --git a/t/tap-negative-numbers.sh b/t/tap-negative-numbers.sh index 765442a5e..fbf54be53 100755 --- a/t/tap-negative-numbers.sh +++ b/t/tap-negative-numbers.sh @@ -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 diff --git a/t/tap-no-disable-hard-error.sh b/t/tap-no-disable-hard-error.sh index e9a109151..dc4cad34a 100755 --- a/t/tap-no-disable-hard-error.sh +++ b/t/tap-no-disable-hard-error.sh @@ -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 diff --git a/t/tap-no-merge-stdout-stderr.sh b/t/tap-no-merge-stdout-stderr.sh index e82b26b99..f1013156b 100755 --- a/t/tap-no-merge-stdout-stderr.sh +++ b/t/tap-no-merge-stdout-stderr.sh @@ -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 diff --git a/t/tap-no-spurious-numbers.sh b/t/tap-no-spurious-numbers.sh index 3f994980f..81104afbc 100755 --- a/t/tap-no-spurious-numbers.sh +++ b/t/tap-no-spurious-numbers.sh @@ -20,7 +20,7 @@ . ./defs || exit 1 -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh cat > prefixes <<'END' A diff --git a/t/tap-no-spurious.sh b/t/tap-no-spurious.sh index ebb58cf87..bc98a0900 100755 --- a/t/tap-no-spurious.sh +++ b/t/tap-no-spurious.sh @@ -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 diff --git a/t/tap-not-ok-skip.sh b/t/tap-not-ok-skip.sh index f73bb0395..bbb9a032a 100755 --- a/t/tap-not-ok-skip.sh +++ b/t/tap-not-ok-skip.sh @@ -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 diff --git a/t/tap-number-wordboundary.sh b/t/tap-number-wordboundary.sh index 219a15918..2d15121c3 100755 --- a/t/tap-number-wordboundary.sh +++ b/t/tap-number-wordboundary.sh @@ -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 diff --git a/t/tap-numbers-leading-zero.sh b/t/tap-numbers-leading-zero.sh index fd1c3b62d..620addfb5 100755 --- a/t/tap-numbers-leading-zero.sh +++ b/t/tap-numbers-leading-zero.sh @@ -19,7 +19,7 @@ . ./defs || exit 1 -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh do_checks () { diff --git a/t/tap-numeric-description.sh b/t/tap-numeric-description.sh index 60292a76c..61bc25241 100755 --- a/t/tap-numeric-description.sh +++ b/t/tap-numeric-description.sh @@ -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 diff --git a/t/tap-out-of-order.sh b/t/tap-out-of-order.sh index 0e3ffb203..edcf00696 100755 --- a/t/tap-out-of-order.sh +++ b/t/tap-out-of-order.sh @@ -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 diff --git a/t/tap-passthrough-exit.sh b/t/tap-passthrough-exit.sh index 617f89cdd..1e93115ec 100755 --- a/t/tap-passthrough-exit.sh +++ b/t/tap-passthrough-exit.sh @@ -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=$? diff --git a/t/tap-passthrough.sh b/t/tap-passthrough.sh index 380548f27..8363d974f 100755 --- a/t/tap-passthrough.sh +++ b/t/tap-passthrough.sh @@ -24,7 +24,7 @@ weirdchars=\''"\$@!&()[]<>#;,:.^?*/' -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh # # Only successful tests. diff --git a/t/tap-plan-corner.sh b/t/tap-plan-corner.sh index 044258e38..9b060ad87 100755 --- a/t/tap-plan-corner.sh +++ b/t/tap-plan-corner.sh @@ -19,7 +19,7 @@ . ./defs || exit 1 -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh # ------------------------------------------------------------------------- diff --git a/t/tap-plan-errors.sh b/t/tap-plan-errors.sh index 21fd01312..4b6a4105f 100755 --- a/t/tap-plan-errors.sh +++ b/t/tap-plan-errors.sh @@ -25,7 +25,7 @@ . ./defs || exit 1 -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh my_check () { diff --git a/t/tap-plan-leading-zero.sh b/t/tap-plan-leading-zero.sh index ce6477db1..b6bb507de 100755 --- a/t/tap-plan-leading-zero.sh +++ b/t/tap-plan-leading-zero.sh @@ -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 diff --git a/t/tap-plan-malformed.sh b/t/tap-plan-malformed.sh index b89aa9409..551ccd435 100755 --- a/t/tap-plan-malformed.sh +++ b/t/tap-plan-malformed.sh @@ -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 diff --git a/t/tap-plan-middle.sh b/t/tap-plan-middle.sh index 253862340..63f31c561 100755 --- a/t/tap-plan-middle.sh +++ b/t/tap-plan-middle.sh @@ -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 diff --git a/t/tap-plan-whitespace.sh b/t/tap-plan-whitespace.sh index 122ff2f08..e0fdf3eeb 100755 --- a/t/tap-plan-whitespace.sh +++ b/t/tap-plan-whitespace.sh @@ -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 $ diff --git a/t/tap-plan.sh b/t/tap-plan.sh index 810625191..d80dd517b 100755 --- a/t/tap-plan.sh +++ b/t/tap-plan.sh @@ -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 diff --git a/t/tap-planskip-and-logging.sh b/t/tap-planskip-and-logging.sh index 3b999d1b6..8cd3d50ed 100755 --- a/t/tap-planskip-and-logging.sh +++ b/t/tap-planskip-and-logging.sh @@ -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 diff --git a/t/tap-planskip-badexit.sh b/t/tap-planskip-badexit.sh index 1b208648f..0bcc7e315 100755 --- a/t/tap-planskip-badexit.sh +++ b/t/tap-planskip-badexit.sh @@ -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 diff --git a/t/tap-planskip-bailout.sh b/t/tap-planskip-bailout.sh index 255443d7b..6558a6970 100755 --- a/t/tap-planskip-bailout.sh +++ b/t/tap-planskip-bailout.sh @@ -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 diff --git a/t/tap-planskip-case-insensitive.sh b/t/tap-planskip-case-insensitive.sh index 61f1ea0c4..f086a684d 100755 --- a/t/tap-planskip-case-insensitive.sh +++ b/t/tap-planskip-case-insensitive.sh @@ -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 diff --git a/t/tap-planskip-late.sh b/t/tap-planskip-late.sh index 50d74a925..942d0b620 100755 --- a/t/tap-planskip-late.sh +++ b/t/tap-planskip-late.sh @@ -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 diff --git a/t/tap-planskip-later-errors.sh b/t/tap-planskip-later-errors.sh index 3a403c729..c8400446e 100755 --- a/t/tap-planskip-later-errors.sh +++ b/t/tap-planskip-later-errors.sh @@ -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 diff --git a/t/tap-planskip-unplanned-corner.sh b/t/tap-planskip-unplanned-corner.sh index 98dd349be..9db7d2205 100755 --- a/t/tap-planskip-unplanned-corner.sh +++ b/t/tap-planskip-unplanned-corner.sh @@ -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 diff --git a/t/tap-planskip-unplanned.sh b/t/tap-planskip-unplanned.sh index 01e5895fb..5fa8ca52d 100755 --- a/t/tap-planskip-unplanned.sh +++ b/t/tap-planskip-unplanned.sh @@ -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 diff --git a/t/tap-planskip-whitespace.sh b/t/tap-planskip-whitespace.sh index ca29d1ab3..5a1fccf8e 100755 --- a/t/tap-planskip-whitespace.sh +++ b/t/tap-planskip-whitespace.sh @@ -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} diff --git a/t/tap-planskip.sh b/t/tap-planskip.sh index b160e4858..361dc5db7 100755 --- a/t/tap-planskip.sh +++ b/t/tap-planskip.sh @@ -19,7 +19,7 @@ . ./defs || exit 1 -. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh" +. tap-setup.sh weirdchars=\''"$!&()[]<>#;^?*/@%=,.:' diff --git a/t/tap-realtime.sh b/t/tap-realtime.sh index 662105386..0655e0f36 100755 --- a/t/tap-realtime.sh +++ b/t/tap-realtime.sh @@ -39,7 +39,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 diff --git a/t/tap-result-comment.sh b/t/tap-result-comment.sh index 42907518e..714f328fd 100755 --- a/t/tap-result-comment.sh +++ b/t/tap-result-comment.sh @@ -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 diff --git a/t/tap-summary-color.sh b/t/tap-summary-color.sh index a28512b69..e9b516bbc 100755 --- a/t/tap-summary-color.sh +++ b/t/tap-summary-color.sh @@ -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 diff --git a/t/tap-summary.sh b/t/tap-summary.sh index deee09984..c4bd73937 100755 --- a/t/tap-summary.sh +++ b/t/tap-summary.sh @@ -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 diff --git a/t/tap-test-number-0.sh b/t/tap-test-number-0.sh index e611edcc1..8412f12ca 100755 --- a/t/tap-test-number-0.sh +++ b/t/tap-test-number-0.sh @@ -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 diff --git a/t/tap-todo-skip-together.sh b/t/tap-todo-skip-together.sh index b54013a32..dc9e160b3 100755 --- a/t/tap-todo-skip-together.sh +++ b/t/tap-todo-skip-together.sh @@ -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 diff --git a/t/tap-todo-skip-whitespace.sh b/t/tap-todo-skip-whitespace.sh index b9c882589..b979c8be5 100755 --- a/t/tap-todo-skip-whitespace.sh +++ b/t/tap-todo-skip-whitespace.sh @@ -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 diff --git a/t/tap-todo-skip.sh b/t/tap-todo-skip.sh index 368bd8ed8..ffe2aac7d 100755 --- a/t/tap-todo-skip.sh +++ b/t/tap-todo-skip.sh @@ -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: # diff --git a/t/tap-unplanned.sh b/t/tap-unplanned.sh index 262c8012f..bfd0d3172 100755 --- a/t/tap-unplanned.sh +++ b/t/tap-unplanned.sh @@ -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 diff --git a/t/tap-whitespace-normalization.sh b/t/tap-whitespace-normalization.sh index 2b1f627b8..0cbf90bc4 100755 --- a/t/tap-whitespace-normalization.sh +++ b/t/tap-whitespace-normalization.sh @@ -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. diff --git a/t/tap-with-and-without-number.sh b/t/tap-with-and-without-number.sh index c69a40ad6..6d69eb6f3 100755 --- a/t/tap-with-and-without-number.sh +++ b/t/tap-with-and-without-number.sh @@ -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 diff --git a/t/tap-xfail-tests.sh b/t/tap-xfail-tests.sh index aa86dca5d..94ae1c906 100755 --- a/t/tap-xfail-tests.sh +++ b/t/tap-xfail-tests.sh @@ -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 diff --git a/t/testsuite-summary-color.sh b/t/testsuite-summary-color.sh index c73ca45f8..7278a2f8c 100755 --- a/t/testsuite-summary-color.sh +++ b/t/testsuite-summary-color.sh @@ -16,12 +16,10 @@ # 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 diff --git a/t/testsuite-summary-count.sh b/t/testsuite-summary-count.sh index 265eebfa4..25ecf2750 100755 --- a/t/testsuite-summary-count.sh +++ b/t/testsuite-summary-count.sh @@ -16,12 +16,10 @@ # 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 |