automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/5] tests: remove obsolete uses of $sh_errexit_works


From: Stefano Lattarini
Subject: [PATCH 3/5] tests: remove obsolete uses of $sh_errexit_works
Date: Tue, 1 May 2012 18:04:17 +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 <address@hidden>
---
 configure.ac                   |    3 ---
 defs                           |    3 +--
 defs-static.in                 |    3 ---
 t/self-check-cleanup.tap       |    4 ----
 t/self-check-exit.tap          |   13 +------------
 t/self-check-explicit-skips.sh |    2 --
 6 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3700c8f..1c91f18 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 dd1631a..4c1e40d 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
   # <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
diff --git a/defs-static.in b/defs-static.in
index 30e3253..44db309 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 215472a..21c6388 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 e8d96df..1342f07 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 2b64fe1..7a92671 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`'|" \
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]