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-935-ga65acce
Date: Thu, 16 Jun 2011 09:12:57 +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=a65acce263dd789f004567857ff56d43d2975a35

The branch, testsuite-work has been updated
       via  a65acce263dd789f004567857ff56d43d2975a35 (commit)
       via  b78d98ffcd397aaca323a5b1314e03395391bfeb (commit)
       via  f4057070950a5991a9adbe2e8bc8e78aa16d1895 (commit)
       via  29ca903b799b0a319f881701788f9b350ac50cc8 (commit)
      from  fef8ee88b48851569de5b05768c892914a72b16d (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 a65acce263dd789f004567857ff56d43d2975a35
Merge: b78d98f 29ca903
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 16 10:41:49 2011 +0200

    Merge branch 'tests-defs-fix-stderr-redirect-bug' into testsuite-work

commit b78d98ffcd397aaca323a5b1314e03395391bfeb
Merge: fef8ee8 f405707
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 16 10:26:10 2011 +0200

    Merge branch 'tests-more-shells' into testsuite-work

commit f4057070950a5991a9adbe2e8bc8e78aa16d1895
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 16 10:25:59 2011 +0200

    regenerate tests/Makefile.in

commit 29ca903b799b0a319f881701788f9b350ac50cc8
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jun 13 22:42:25 2011 +0200

    test defs: fix ksh-related portability bug in warning messages
    
    Running "make check" normally prints a diagnostic to the outermost
    stderr (usually a tty) to explain why a test is skipped, thus
    giving better and faster feedback to the user.  It used to do
    so by redirecting file descriptor 9 to stderr (via "exec 9>&2")
    before invoking the test scripts, which then would write any skip
    explanation to file descriptor 9 via the `skip_' function defined
    in `tests/defs'.
    
    However, various Korn Shells (at least Solaris 10's /bin/ksh and
    Debian GNU/Linux's /bin/ksh) and the HP-UX's /bin/sh close open
    file descriptors > 2 upon an `exec' system call; thus the effects
    of "exec 9>&2" are cancelled upon fork-and-exec, so we would get
    a "Bad file number" diagnostic and no skip explanation with those
    shells.
    
    The present change remedies this situation.
    
    * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Redirect more portably,
    via a trailing "9>&2", rather than the prior "exec 9>&2; ...".  Add
    explanatory comments.
    * tests/defs (stderr_fileno_): Update the advice in comments.
    
    Based on commit v8.12-82-g6b68745 "tests: accommodate HP-UX and
    ksh-derived shells" in GNU coreutils.
    
    Further references, with lots of discussion:
     <http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00002.html>
     <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488>
     <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8846>

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

Summary of changes:
 ChangeLog         |   29 +++++++++++++++++++++++++++++
 tests/Makefile.am |   13 ++++++++++---
 tests/Makefile.in |   14 +++++++++++---
 tests/defs        |    5 +++--
 4 files changed, 53 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2029e92..cce35e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2011-06-14  Stefano Lattarini  <address@hidden>
+           Jim Meyering  <address@hidden>
+
+       test defs: fix ksh-related portability bug in warning messages
+       Running "make check" normally prints a diagnostic to the outermost
+       stderr (usually a tty) to explain why a test is skipped, thus
+       giving better and faster feedback to the user.  It used to do
+       so by redirecting file descriptor 9 to stderr (via "exec 9>&2")
+       before invoking the test scripts, which then would write any skip
+       explanation to file descriptor 9 via the `skip_' function defined
+       in `tests/defs'.
+       However, various Korn Shells (at least Solaris 10's /bin/ksh and
+       Debian GNU/Linux's /bin/ksh) and the HP-UX's /bin/sh close open
+       file descriptors > 2 upon an `exec' system call; thus the effects
+       of "exec 9>&2" are cancelled upon fork-and-exec, so we would get
+       a "Bad file number" diagnostic and no skip explanation with those
+       shells.
+       The present change remedies this situation.
+       * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Redirect more portably,
+       via a trailing "9>&2", rather than the prior "exec 9>&2; ...".  Add
+       explanatory comments.
+       * tests/defs (stderr_fileno_): Update the advice in comments.
+       Based on commit v8.12-82-g6b68745 "tests: accommodate HP-UX and
+       ksh-derived shells" in GNU coreutils.
+       Further references, with lots of discussion:
+        <http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00002.html>
+        <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488>
+        <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8846>
+
 2011-06-13  Stefano Lattarini  <address@hidden>
 
        tests: remove 'test_prefer_config_shell' from the environment
diff --git a/tests/Makefile.am b/tests/Makefile.am
index af3b291..eacee84 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -112,12 +112,19 @@ $(config_shell_tests):
 
 # Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
-# We want warning messages and explanations for skipped tests to go to
-# the console if possible, so set up `stderr_fileno_' properly.
 # The `AM_TESTS_REEXEC=no' setting tells the tests not to needlessly
 # re-execute themselves with the shell detected at configure time, since
 # we are already running them under it explicitly in our setup (see e.g.
 # the definition of TEST_LOG_COMPILER above).
+# We want warning messages and explanations for skipped tests to go to
+# the console if possible, so set up `stderr_fileno_' properly.
+# The `9>&2' redirection *must* be placed at the end, and without a
+# following semicolon, because some shells (e.g., various Korn Shells
+# or HP-HX /bin/sh) close any file descriptor > 2 upon `exec' sycall.
+# For more references, with lots of discussion, see:
+#  - http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00002.html
+#  - http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488
+#  - http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8846
 AM_TESTS_ENVIRONMENT = \
   test x"$$me" = x || unset me; \
   test x"$$required" = x || unset required; \
@@ -126,7 +133,7 @@ AM_TESTS_ENVIRONMENT = \
   test x"$$original_AUTOMAKE" = x || unset original_AUTOMAKE; \
   test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
   AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC; \
-  exec 9>&2; stderr_fileno_=9; export stderr_fileno_;
+  stderr_fileno_=9; export stderr_fileno_; 9>&2
 
 TESTS = \
   $(handwritten_tests) \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index cdca4ff..54c917f 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -396,20 +396,28 @@ SHTST_LOG_COMPILER = $(SHELL) 
$(srcdir)/config-shell-tests.sh
 
 # Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
-# We want warning messages and explanations for skipped tests to go to
-# the console if possible, so set up `stderr_fileno_' properly.
 # The `AM_TESTS_REEXEC=no' setting tells the tests not to needlessly
 # re-execute themselves with the shell detected at configure time, since
 # we are already running them under it explicitly in our setup (see e.g.
 # the definition of TEST_LOG_COMPILER above).
+# We want warning messages and explanations for skipped tests to go to
+# the console if possible, so set up `stderr_fileno_' properly.
+# The `9>&2' redirection *must* be placed at the end, and without a
+# following semicolon, because some shells (e.g., various Korn Shells
+# or HP-HX /bin/sh) close any file descriptor > 2 upon `exec' sycall.
+# For more references, with lots of discussion, see:
+#  - http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00002.html
+#  - http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488
+#  - http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8846
 AM_TESTS_ENVIRONMENT = \
   test x"$$me" = x || unset me; \
   test x"$$required" = x || unset required; \
   test x"$$parallel_tests" = x || unset parallel_tests; \
+  test x"$$test_prefer_config_shell" || unset test_prefer_config_shell; \
   test x"$$original_AUTOMAKE" = x || unset original_AUTOMAKE; \
   test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
   AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC; \
-  exec 9>&2; stderr_fileno_=9; export stderr_fileno_;
+  stderr_fileno_=9; export stderr_fileno_; 9>&2
 
 TESTS = \
   $(handwritten_tests) \
diff --git a/tests/defs b/tests/defs
index df62751..4f6f3b2 100644
--- a/tests/defs
+++ b/tests/defs
@@ -169,8 +169,9 @@ Exit ()
 
 # Print warnings (e.g., about skipped and failed tests) to this file
 # number.  Override by putting, say:
-#   stderr_fileno_=9; export stderr_fileno_; exec 9>&2;
-# in the definition of AM_TESTS_ENVIRONMENT.
+#   stderr_fileno_=9; export stderr_fileno_; 9>&2
+# at the *end* (yes, this is mandatory; see comments in Makefile.am) of
+# the definition of AM_TESTS_ENVIRONMENT.
 # 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}


hooks/post-receive
-- 
GNU Automake



reply via email to

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