]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Autotest no longer caters to Ultrix redirection limitation.
authorStepan Kasal <kasal@ucw.cz>
Fri, 28 Sep 2007 03:09:18 +0000 (21:09 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 28 Sep 2007 03:09:18 +0000 (21:09 -0600)
* doc/autoconf.texi (Writing testsuite.at): Remove the
limitation that the first parameter of AT_CHECK cannot
contain redirection.
(File Descriptors): Mention that Ultrix limitation is no longer a
show-stopper in modern code.
* tests/local.at (AT_CHECK_M4): Fix for cases when the fourth
parameter is `stderr' or `experr'.  Optimize if it was `ignore'.
* lib/autotest/general.m4 (AT_CHECK): Update comment.

ChangeLog
doc/autoconf.texi
lib/autotest/general.m4
tests/local.at

index 8b443b0e3e45c54f602d65c3f5b011dade7db28c..ea29d1bd5dc01cdf3585f3e64000748f56b38549 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2007-09-27  Stepan Kasal  <kasal@ucw.cz>
+       and Eric Blake  <ebb9@byu.net>
+
+       Autotest no longer caters to Ultrix redirection limitation.
+       * doc/autoconf.texi (Writing testsuite.at): Remove the
+       limitation that the first parameter of AT_CHECK cannot
+       contain redirection.
+       (File Descriptors): Mention that Ultrix limitation is no longer a
+       show-stopper in modern code.
+       * tests/local.at (AT_CHECK_M4): Fix for cases when the fourth
+       parameter is `stderr' or `experr'.  Optimize if it was `ignore'.
+       * lib/autotest/general.m4 (AT_CHECK): Update comment.
+
 2007-09-27  Eric Blake  <ebb9@byu.net>
 
        Squelch changeword in m4sugar.
index 8d41f477c7ddbbff75248d8952fe166a44b2bc08..bd67ab19ac3c5e9cff955c54ec03a4bdcc017315 100644 (file)
@@ -11609,8 +11609,8 @@ escape, while @samp{: `cd /zorglub 2>/dev/null`} works properly.
 It is worth noting that Zsh (but not Ash nor Bash) makes it possible
 in assignments though: @samp{foo=`cd /zorglub` 2>/dev/null}.
 
-Don't redirect the same file descriptor several times, as you are doomed
-to failure under Ultrix.
+When catering to old systems, don't redirect the same file descriptor
+several times, as you are doomed to failure under Ultrix.
 
 @example
 ULTRIX V4.4 (Rev. 69) System #31: Thu Aug 10 19:42:23 GMT 1995
@@ -11625,7 +11625,8 @@ Ambiguous output redirect.
 
 @noindent
 In each case the expected result is of course @file{fullness} containing
-@samp{matter} and @file{void} being empty.
+@samp{matter} and @file{void} being empty.  However, this bug is
+probably not of practical concern to modern platforms.
 
 Don't rely on file descriptors 0, 1, and 2 remaining closed in a
 subsidiary program.  If any of these descriptors is closed, the
@@ -11647,8 +11648,8 @@ echo hello >&5
 $ @kbd{exec 5>t}
 $ @kbd{./descrips}
 $ @kbd{cat t}
-$
 hello
+$
 @end example
 
 @noindent
@@ -19107,8 +19108,13 @@ status 77, then the whole test group is skipped.  Otherwise, if this test
 fails, run shell commands @var{run-if-fail} or, if this test passes, run shell
 commands @var{run-if-pass}.
 
-The @var{commands} @emph{must not} redirect the standard output, nor the
-standard error.
+@c Previously, we had this:
+@c  The @var{commands} @emph{must not} redirect the standard output, nor the
+@c  standard error.
+@c to prevent trigerring the double redirect bug on Ultrix, see
+@c `File Descriptors'.  This was too restricting, and Ultrix is pretty
+@c much dead, so we dropped the limitation; the obvious workaround on
+@c Ultrix is to use a working shell there.
 
 If @var{status}, or @var{stdout}, or @var{stderr} is @samp{ignore}, then
 the corresponding value is not checked.
index b067d9f5eff72593cf50d01f8aa02fafa95ff6ec..4be59a6a62736e3730fe6f9a7b7e02e77a4d60a0 100644 (file)
@@ -1295,21 +1295,17 @@ $2[]_ATEOF
 #    AT_CHECK([command], [], [stdout])
 #    # Some checks on `stdout'
 #
-# This is an unfortunate limitation inherited from Ultrix which will not
-# let you redirect several times the same FD (see the Autoconf documentation).
-# If you use the `AT_CHECK([command >out])' be sure to get a test suite
-# that will show spurious failures.
-#
-# You might wonder why not just use `ignore' and directly use stdout and
-# stderr left by the test suite.  Firstly because the names of these files
-# is an internal detail, and secondly, because
+# You might wonder why you can't just use `ignore', then directly use stdout
+# and stderr left by the test suite:
 #
 #    AT_CHECK([command], [], [ignore])
 #    AT_CHECK([check stdout])
 #
-# will use `stdout' both in input and output: undefined behavior would
-# certainly result.  That's why the test suite will save them in `at-stdout'
-# and `at-stderr', and will provide you with `stdout' and `stderr'.
+# If the test suite always captured data in the file `stdout', then the
+# second command would be trying to read and write from the same file, with
+# undefined behavior.  Therefore, the test suite actually captures data in
+# an internal file of a different name, and only creates `stdout' when
+# explicitly requested.
 #
 # Any line of stderr starting with leading blanks and a `+' are filtered
 # out, since most shells when tracing include subshell traces in stderr.
index 8f419fec13ded84f7b21e258570dfb0334b166ba..8a6bffde63a6dabfd73b241dacff5c24b95725a5 100644 (file)
@@ -1,6 +1,6 @@
 # M4 macros used in building Autoconf test suites.        -*- Autotest -*-
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
 # Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
@@ -96,15 +96,15 @@ m4_define([AT_CHECK_PERL_SYNTAX],
 # remove the error code during normalization.
 #
 m4_define([AT_CHECK_M4],
-[AT_CHECK([$1], [$2], [$3], m4_ifval([$4], [stderr]))
-m4_ifval([$4],
+[AT_CHECK([$1], [$2], [$3], m4_if([$4], [], [], [ignore], [ignore], [stderr]))
+m4_if([$4], [], [], [ignore], [],
 [AT_CHECK([[sed 's/^[^:]*m4: *\([^:]*:\) *\([0-9][0-9]*: \)/m4:\1\2/
        s/^\([^:]*:\) *\([0-9][0-9]*:\)[^:]*m4: /m4:\1\2 /
        s/^\(m4:[^:]*:[0-9][0-9]*: \)C\(annot open \)\([^`:]*\):/\1c\2`\3'\'':/
        s/^autom4te: [^ ]*m4 /autom4te: m4 /
        s/^autom4te: [^ ]*m4\.exe /autom4te: m4 /
        s/ (E[A-Z]*)$//
-    ' stderr]], [0],[$4])])
+    ' stderr >&2]], [0], [], [$4])])
 ])
 
 # AT_CHECK_AUTOM4TE(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)