]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
testsuite: do fd redirections with $(AM_TESTS_FD_REDIRECT)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 6 Aug 2011 08:51:07 +0000 (10:51 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 6 Aug 2011 08:59:23 +0000 (10:59 +0200)
* tests/Makefile.am: The redirections of file descriptors needed
by our test scripts is now done using the $(AM_TESTS_FD_REDIRECT)
variable (the new blessed way since commit `v1.11-906-gb9e9d54'),
not using an hack involving $(AM_TESTS_ENVIRONMENT).  This has
the further benefit of allowing the use of $(TESTS_ENVIRONMENT)
again on part of the users.
* tests/Makefile.am (AM_TESTS_ENVIRONMENT): Remove redirection of
file descriptors.
(AM_TESTS_FD_REDIRECT): Redirect file descriptor 9 to original
stderr.
Comments adjusted.
* tests/plain-functions.sh ($stderr_fileno_): Update comment.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/plain-functions.sh

index e8756c61b94a173ac1e15104bb1df7b059b9ace2..6f58794f852666bce78afd1ec3c0546f1e2371b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-08-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       testsuite: do fd redirections with $(AM_TESTS_FD_REDIRECT)
+       * tests/Makefile.am: The redirections of file descriptors needed
+       by our test scripts is now done using the $(AM_TESTS_FD_REDIRECT)
+       variable (the new blessed way since commit `v1.11-906-gb9e9d54'),
+       not using an hack involving $(AM_TESTS_ENVIRONMENT).  This has
+       the further benefit of allowing the use of $(TESTS_ENVIRONMENT)
+       again on part of the users.
+       * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Remove redirection of
+       file descriptors.
+       (AM_TESTS_FD_REDIRECT): Redirect file descriptor 9 to original
+       stderr.
+       Comments adjusted.
+       * tests/plain-functions.sh ($stderr_fileno_): Update comment.
+
 2011-08-05  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        testsuite: use custom TAP diagnostic in our own tests
index 425112b92fd7b864be6016b5f60af9120bfdb2c3..6a404c7f5cc2e576a906d9961f8f4eb287383f22 100644 (file)
@@ -127,19 +127,6 @@ $(config_shell_tests):
 
 # Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
-# 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; \
@@ -147,9 +134,16 @@ AM_TESTS_ENVIRONMENT = \
   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; \
-  stderr_fileno_=9; export stderr_fileno_; 9>&2
+  test x"$$original_ACLOCAL" = x || unset original_ACLOCAL;
+# 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).
+AM_TESTS_ENVIRONMENT += AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC;
+# We want warning messages and explanations for skipped tests to go to
+# the console if possible, so set up `stderr_fileno_' properly.
+AM_TESTS_FD_REDIRECT = 9>&2
+AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
 
 TESTS = \
   $(handwritten_tests) \
index d371452f2d4aa87c181e39ca81d6e8621d218443..c79e5232c26ca2a41a25a61963b5c4a41dfc9dc5 100644 (file)
@@ -401,26 +401,17 @@ SHTST_LOG_COMPILER = $(SHELL) $(srcdir)/config-shell-tests.sh
 # 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).
+AM_TESTS_ENVIRONMENT = test x"$$me" = x || unset me; test \
+       x"$$required" = x || unset required; test x"$$use_tap" = x || \
+       unset use_tap; 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; stderr_fileno_=9; export stderr_fileno_;
 # 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"$$use_tap" = x || unset use_tap; \
-  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; \
-  stderr_fileno_=9; export stderr_fileno_; 9>&2
-
+AM_TESTS_FD_REDIRECT = 9>&2
 TESTS = \
   $(handwritten_tests) \
   $(config_shell_tests) \
index c142f05b5161f10f2e71b1bb3e875d73a53ce0e6..c95ff1fab721596ff096dc716f9786266893647d 100644 (file)
@@ -20,8 +20,9 @@
 
 # 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.
+#   AM_TESTS_ENVIRONMENT = stderr_fileno_=9; export stderr_fileno_;
+#   AM_TESTS_FD_REDIRECT = 9>&2
+# in your Makefile.am.
 # 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}