From: Stefano Lattarini Date: Wed, 28 Dec 2011 12:23:31 +0000 (+0100) Subject: tests: remove obsolete uses of $sh_errexit_works X-Git-Tag: v1.12.0b~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b641de5fc4ecf679d77a7542f83b1d04402c798;p=thirdparty%2Fautomake.git tests: remove obsolete uses of $sh_errexit_works After the last changes, configure will ensure that the shell selected to run the test scripts can correctly propagate exit status to the exit trap when 'set -e' is in effect. * configure.ac (sh_errexit_works): Do not AC_SUBST it anymore. * defs-static.in (sh_errexit_works): Do not initialize from the AC_SUBST value anymore. * defs (trap): Trap the EXIT signal unconditionally. * t/self-check-explicit-skips.sh: Do not skip the test if '$sh_errexit_works' is != "yes", this check doesn't make sense anymore. * t/self-check-cleanup.tap: Likewise. * t/self-check-exit.tap: Assume the exit trap is always installed by ./defs. Signed-off-by: Stefano Lattarini --- diff --git a/configure.ac b/configure.ac index ecca49b2a..7be255469 100644 --- a/configure.ac +++ b/configure.ac @@ -378,9 +378,6 @@ fi AC_ARG_VAR([AM_TEST_RUNNER_SHELL], [a sturdy POSIX shell for our testsuite]) -# FIXME: remove soon -AC_SUBST([sh_errexit_works], [yes]) - ## ---------------------- ## ## Create output files. ## ## ---------------------- ## diff --git a/defs b/defs index dd1631a74..4c1e40d85 100644 --- a/defs +++ b/defs @@ -1001,7 +1001,7 @@ case " $required " in *\ gettext*) . ./t/gettext-macros.dir/get.sh;; esac distdir=$me-1.0 # Set up the exit trap. -if test "$sh_errexit_works" = yes; then +# FIXME: adjust indentation, here and below. trap 'exit_status=$? set +e cd "$am_top_builddir" @@ -1059,7 +1059,6 @@ if test "$sh_errexit_works" = yes; then # See also Test::Harness bug [rt.cpan.org #70855], archived at # trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13 -fi # Create and populate the temporary directory, if and as required. if test x"$am_create_testdir" = x"no"; then diff --git a/defs-static.in b/defs-static.in index 30e3253ab..44db30953 100644 --- a/defs-static.in +++ b/defs-static.in @@ -222,9 +222,6 @@ GNU_GCJFLAGS=${AM_TESTSUITE_GNU_GCJFLAGS-${GNU_GCJFLAGS-'@GNU_GCJFLAGS@'}} # this variable. TEX=${AM_TESTSUITE_TEX-'@TEX@'} -# Whether $SHELL has working 'set -e' with exit trap. -sh_errexit_works='@sh_errexit_works@' - # The amount we should wait after modifying files depends on the platform. # For instance, Windows '95, '98 and ME have 2-second granularity # and can be up to 3 seconds in the future w.r.t. the system clock. diff --git a/t/self-check-cleanup.tap b/t/self-check-cleanup.tap index 215472ae1..21c638891 100755 --- a/t/self-check-cleanup.tap +++ b/t/self-check-cleanup.tap @@ -19,10 +19,6 @@ . ./defs || Exit 1 -if test x"$sh_errexit_works" != x"yes"; then - skip_all_ "$me: no working exit trap with 'set -e'" -fi - plan_ 43 # We still need a little hack to make ./defs work outside automake's diff --git a/t/self-check-exit.tap b/t/self-check-exit.tap index 029b17424..1d3c0202b 100755 --- a/t/self-check-exit.tap +++ b/t/self-check-exit.tap @@ -65,18 +65,7 @@ for sig in 1 2 13 15; do # Reset default SIGINT handler as portably as possible. trap 2 || trap - 2 fi - if test x"$sh_errexit_works" = x"yes"; then - # The exit trap should turn into an hard errors any failure - # caused by signals. - command_ok_ "kill -$sig" test $rc -eq 99 - else - # The exit trap is not installed, so that the shell should exit - # with status 128+n when receiving signal number n. But don't - # be too strict in the check, as POSIX only says that "The exit - # status of a command that terminated because it received a - # signal shall be reported as greater than 128". - command_ok_ "kill -$sig" test $rc -gt 128 - fi + command_ok_ "kill -$sig" test $rc -eq 99 unset rc done diff --git a/t/self-check-explicit-skips.sh b/t/self-check-explicit-skips.sh index 2b64fe156..7a92671de 100755 --- a/t/self-check-explicit-skips.sh +++ b/t/self-check-explicit-skips.sh @@ -20,8 +20,6 @@ am_create_testdir=empty . ./defs || Exit 1 -test x"$sh_errexit_works" = x"yes" || skip_ "no working shell exit trap" - # We still need a little hack to make ./defs work outside automake's # tree 'tests' subdirectory. Not a big deal. sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \