]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: remove obsolete uses of $sh_errexit_works
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 28 Dec 2011 12:23:31 +0000 (13:23 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 7 May 2012 20:08:37 +0000 (22:08 +0200)
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 <stefano.lattarini@gmail.com>
configure.ac
defs
defs-static.in
t/self-check-cleanup.tap
t/self-check-exit.tap
t/self-check-explicit-skips.sh

index ecca49b2aa1a722bdcdc889f06c14eb023271537..7be2554693e8c9ae58957a2c4f22c2fb969d1a39 100644 (file)
@@ -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 dd1631a74e48d761ac929dfd44ccf7fc51ebfbdf..4c1e40d85b41fd6a169bf3907955d5304c0854e1 100644 (file)
--- 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
   # <https://rt.cpan.org/Ticket/Display.html?id=70855>
   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
index 30e3253abe0a38ff465f5a7e56fe1357aea2f75c..44db30953bb8acb4aa0447df73e18d3e1aa70983 100644 (file)
@@ -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.
index 215472ae190a506c8ea051653ffe68e261d79e9e..21c638891cfaa437cbcdf3fafed915cf09144de9 100755 (executable)
 
 . ./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
index 029b1742422f2d8d0af1f642b2f032e6824dc467..1d3c0202b7e7b642bc818f008772493bdccc7115 100755 (executable)
@@ -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
 
index 2b64fe15673f303a28336eb499026b5d4a208de9..7a92671de38396713df6caab6466d0033e413107 100755 (executable)
@@ -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`'|" \