automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1345-g4f797ab
Date: Tue, 13 Sep 2011 14:21:10 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=4f797ab76bdc21b4b9916c10f6fdce93c1c4b30c

The branch, testsuite-work has been updated
       via  4f797ab76bdc21b4b9916c10f6fdce93c1c4b30c (commit)
       via  8ba5dc71d28e5ceed0486f73c3e9f4c4c2470e1b (commit)
       via  2c27ce38dae5079afd8806cccae2463dc04f9f45 (commit)
       via  6321ad3100fc6a4af0c7c22463ce94bc5c76a493 (commit)
      from  f931b8204aaef964731a49c6b03350dfa9b6a52d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4f797ab76bdc21b4b9916c10f6fdce93c1c4b30c
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 13 15:49:32 2011 +0200

    self tests: work around 'unset' spurious non-zero return value
    
    * tests/self-check-exit.tap ($init): Unset the possibly     already
    unset variable `am_explicit_skips' when the `errexit' shell flag
    is not yet active, for the benefit of shell that return a non-zero
    status when unsetting an already-unset variable.

commit 8ba5dc71d28e5ceed0486f73c3e9f4c4c2470e1b
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 13 15:21:13 2011 +0200

    tests: an explicative comment on signal-related woes
    
    * tests/self-check-exit.tap: Add pointer to a bug-autoconf
    discussion explaining why this test needs to temporarily block
    SIGINT.

commit 2c27ce38dae5079afd8806cccae2463dc04f9f45
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 13 14:37:02 2011 +0200

    tests: also trap SIGQUIT; other fixes
    
    Some shells seems to just ignore SIGQUIT under some circumstances,
    even when it is not blocked; however, if the signal it trapped,
    the trap gets correctly executed.
    
    * tests/defs [$sh_errexit_works = yes]: Also trap SIGQUIT. Add
    extensive explanation of why we do so.
    * tests/self-check-cleanup.tap: Improve and fix to ensure that an
    earlier failure does not prevent the rest of the test to execute.
    Problem revealed by a failure in `self-check-cleanup.tap'.

commit 6321ad3100fc6a4af0c7c22463ce94bc5c76a493
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 13 01:01:46 2011 +0200

    test defs: work around weird ksh behaviour w.r.t. signal handling
    
    * tests/defs (is_blocked_signal): Use perl to determine whether a
    signal is trapped, since trying to do it portably within the shell
    means opening a nasty can of worms.
    
    For more information and background, see:
     <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
     
<http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
     <http://www.cons.org/cracauer/sigint.html>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                    |   38 ++++++++++++++++++++++++++++++++++++++
 tests/defs                   |   33 ++++++++++++++++++++++++++++++++-
 tests/self-check-cleanup.tap |   22 ++++++++++++++++++----
 tests/self-check-exit.tap    |   11 ++++++++---
 4 files changed, 96 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9b98bfd..7b30dd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2011-09-13  Stefano Lattarini  <address@hidden>
+
+       self tests: work around 'unset' spurious non-zero return value
+       * tests/self-check-exit.tap ($init): Unset the possibly already
+       unset variable `am_explicit_skips' when the `errexit' shell flag
+       is not yet active, for the benefit of shell that return a non-zero
+       status when unsetting an already-unset variable.
+
+2011-09-13  Stefano Lattarini  <address@hidden>
+
+       tests: an explicative comment on signal-related woes
+       * tests/self-check-exit.tap: Add pointer to a bug-autoconf
+       discussion explaining why this test needs to temporarily block
+       SIGINT.
+
+2011-09-13  Stefano Lattarini  <address@hidden>
+
+       tests: also trap SIGQUIT; other fixes
+       Some shells seems to just ignore SIGQUIT under some circumstances,
+       even when it is not blocked; however, if the signal it trapped,
+       the trap gets correctly executed.
+       * tests/defs [$sh_errexit_works = yes]: Also trap SIGQUIT. Add
+       extensive explanation of why we do so.
+       * tests/self-check-cleanup.tap: Improve and fix to ensure that an
+       earlier failure does not prevent the rest of the test to execute.
+       Problem revealed by a failure in `self-check-cleanup.tap'.
+
+2011-09-13  Stefano Lattarini  <address@hidden>
+
+       test defs: work around weird ksh behaviour w.r.t. signal handling
+       * tests/defs (is_blocked_signal): Use perl to determine whether a
+       signal is trapped, since trying to do it portably within the shell
+       means opening a nasty can of worms.
+       For more information and background, see:
+        <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
+        
<http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
+        <http://www.cons.org/cracauer/sigint.html>
+
 2011-09-12  Stefano Lattarini  <address@hidden>
 
        tests: remove redundant line from a test script
diff --git a/tests/defs b/tests/defs
index cbeccb9..f1822c8 100644
--- a/tests/defs
+++ b/tests/defs
@@ -247,7 +247,23 @@ is_newest ()
 # return a non-zero exit status and print a proper diagnostic otherwise.
 is_blocked_signal ()
 {
-  $SHELL -c "kill -$1 \$\$; echo '$me: signal $1 seems blocked'"
+  # Use perl, since trying to do this portably in the shell can be
+  # very tricky, if not downright impossible.  For reference, see:
+  # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
+  if $PERL -w -e '
+    use strict;
+    use warnings FATAL => "all";
+    use POSIX;
+    my %oldsigaction = ();
+    sigaction('"$1"', 0, \%oldsigaction);
+    exit ($oldsigaction{"HANDLER"} eq "IGNORE" ? 0 : 77);
+  '; then
+    return 0
+  elif test $? -eq 77; then
+    return 1
+  else
+    fatal_ "couldn't determine whether signal $1 is blocked"
+  fi
 }
 
 # AUTOMAKE_run [-e STATUS] [-d DESCRIPTION] [--] [AUTOMAKE-ARGS...]
@@ -947,6 +963,21 @@ if test "$sh_errexit_works" = yes; then
   trap "fatal_ 'caught signal SIGHUP'" 1
   trap "fatal_ 'caught signal SIGINIT'" 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
+  #  - Solaris 10 /bin/sh
+  #  - 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
diff --git a/tests/self-check-cleanup.tap b/tests/self-check-cleanup.tap
index c9d0bc9..d369c9f 100755
--- a/tests/self-check-cleanup.tap
+++ b/tests/self-check-cleanup.tap
@@ -42,6 +42,14 @@ export have_symlinks # Is used also by spawned shells.
 
 dir=dummy.dir
 
+# Don't let a failure poison all subsequent tests.
+do_clean ()
+{
+  test -d $dir || return 0
+  find $dir -type d -exec chmod u+rwx '{}' ';' || :
+  rm -rf $dir
+}
+
 # Check that pre-test cleanup works also with directories with
 # "null" permissions, and containing broken symlinks.
 mkdir $dir $dir/sub
@@ -56,9 +64,11 @@ chmod 000 $dir/sub/* $dir/file $dir/symlink
 chmod 000 $dir/sub $dir
 command_ok_ "pre-cleanup can deal with null-perms testdir" \
             $SHELL -c  '. ./defs' dummy.test
-command_ok_ "pre-cleanup removed null-perms testdir"
+command_ok_ "pre-cleanup removed null-perms testdir" \
             eval 'test ! -f $dir && test ! -d $dir && test ! -r $dir'
 
+do_clean
+
 # Check that post-test cleanup works also with directories with
 # "null" permissions, and containing broken symlinks.
 command_ok_ "post-cleanup can deal with null-perms testdir" \
@@ -78,9 +88,11 @@ command_ok_ "post-cleanup can deal with null-perms testdir" \
   chmod 000 dir/sub dir
   :
 ' dummy.test
-command_ok_ "post-cleanup removed null-perms testdir"
+command_ok_ "post-cleanup removed null-perms testdir" \
             eval 'test ! -f $dir && test ! -d $dir && test ! -r $dir'
 
+do_clean
+
 # Check that pre-test cleanup does not unduly change the permissions of
 # files to which symlinks in the temporary test directory point to.
 if test $have_symlinks = yes; then
@@ -123,6 +135,8 @@ else # $have_symlinks = no
   skip_row_ 6 "symlinks not supported"
 fi
 
+do_clean
+
 # Check that the cleanup trap does not remove the temporary
 # test directory in case of test failure, skip, hard-error,
 # or when receiving a signal.
@@ -136,7 +150,7 @@ for st in 1 2 3 10 77 99 126 127 130 255; do
   " dummy.test
   command_ok_ "testdir not removed if exiting with status $st" \
               test -f dummy.dir/foo
-  rm -rf dummy.dir
+  do_clean
 done
 
 for sig in 1 2 3 9 13 15; do
@@ -152,7 +166,7 @@ for sig in 1 2 3 9 13 15; do
   " dummy.test
   command_ok_ "testdir not removed if getting signal $sig" \
               test -f dummy.dir/foo
-  rm -rf dummy.dir
+  do_clean
 done
 
 :
diff --git a/tests/self-check-exit.tap b/tests/self-check-exit.tap
index 563500b..9fe2905 100755
--- a/tests/self-check-exit.tap
+++ b/tests/self-check-exit.tap
@@ -31,7 +31,11 @@ set +e
 
 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 
-init='. ./defs; stderr_fileno_=2; unset am_explicit_skips'
+# It's especially important that the `unset' is done before sourcing
+# ./defs, i.e., when `set -e' is not active yet, for the benefit of shells
+# (like Bash 2.05 and Solaris 10 /bin/ksh) that returns a non-zero status
+# when unsetting an already-unset variable.
+init='stderr_fileno_=2; unset am_explicit_skips; . ./defs'
 
 for st in 1 2 3 4 5 77 99 126 127 128 129 130 255; do
   for exit_cmd in "Exit $st" "sh -c 'exit $st'"; do
@@ -46,8 +50,9 @@ for sig in 1 2 13 15; do
     continue
   fi
   if test $sig -eq 2; then
-    # Some Korn shells might otherwise get a spurious SIGINT
-    # signal when one is sent to the child $SHELL.
+    # Some Korn shells might otherwise get a spurious SIGINT signal when
+    # one is sent to the child $SHELL.  For more details, see:
+    # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
     trap : 2
   fi
   $SHELL -c  "$init; kill -$sig \$\$; :"


hooks/post-receive
-- 
GNU Automake



reply via email to

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