]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix XFAIL related to AT_CHECK.
authorEric Blake <ebb9@byu.net>
Fri, 21 Nov 2008 00:23:52 +0000 (17:23 -0700)
committerEric Blake <ebb9@byu.net>
Fri, 21 Nov 2008 01:27:35 +0000 (18:27 -0700)
* lib/autotest/general.m4 (AT_CHECK, AT_CHECK_UNQUOTED): Expand
first argument once.
(_AT_CHECK): Don't re-expand commands.
* tests/autotest.at (Multiline command from M4 expansion): Remove
XFAIL.
* tests/tools.at (autoupdating AU_ALIAS): Quote unbalanced paren.
* NEWS: Document the fallout.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
NEWS
lib/autotest/general.m4
tests/autotest.at
tests/tools.at

index 8b2986de71f02d4b26aad2e64049159d801d1cd3..0d0ce659e3266ff0acfcef323ee8c00d6086ed3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-11-20  Eric Blake  <ebb9@byu.net>
+
+       Fix XFAIL related to AT_CHECK.
+       * lib/autotest/general.m4 (AT_CHECK, AT_CHECK_UNQUOTED): Expand
+       first argument once.
+       (_AT_CHECK): Don't re-expand commands.
+       * tests/autotest.at (Multiline command from M4 expansion): Remove
+       XFAIL.
+       * tests/tools.at (autoupdating AU_ALIAS): Quote unbalanced paren.
+       * NEWS: Document the fallout.
+
 2008-11-20  Eric Blake  <ebb9@byu.net>
 
        Reduce forks in AC_DEFINE.
diff --git a/NEWS b/NEWS
index 297b3ea5b6cac9d3339d721a62b9915b765d0d57..01dbd3e2486af7499925c9a958bedd836e1612c3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,13 @@ GNU Autoconf NEWS - User visible changes.
 ** The following m4sugar macros are documented now:
    m4_copy  m4_dumpdefs  m4_rename
 
+** The m4sugar macro m4_expand has been taught to handle unterminated
+   comments and shell case statements.  As a result, it is used in
+   more places, such as AC_DEFINE and AT_CHECK.  Most uses should not
+   behave any differently; however, it may be necessary to add
+   double-quoting around unbalanced `(' where single-quoting used to
+   be sufficient.
+
 ** The following documented m4sh macros are new:
    AS_LINENO_PREPARE  AS_ME_PREPARE  AS_SET_STATUS  AS_VAR_APPEND
    AS_VAR_ARITH  AS_VAR_COPY
index ebde0b30ddf87f4bee7491d2753e7e6946793c30..fc48c1f8c33ad528d816c078c41ea84c95384e3a 100644 (file)
@@ -1743,7 +1743,7 @@ $2[]_ATEOF
 # This may cause spurious failures when the test suite is run with `-x'.
 #
 _AT_DEFINE_SETUP([AT_CHECK],
-[_AT_CHECK([$1],[$2],[$3],[$4],[$5],[$6],1)])
+[_AT_CHECK(m4_expand([$1]),[$2],[$3],[$4],[$5],[$6],1)])
 
 # AT_CHECK_NOESCAPE(COMMANDS, [STATUS = 0], STDOUT, STDERR,
 #                   [RUN-IF-FAIL], [RUN-IF-PASS])
@@ -1751,7 +1751,7 @@ _AT_DEFINE_SETUP([AT_CHECK],
 # Like AT_CHECK, but do not AS_ESCAPE shell metacharacters in the STDOUT
 # and STDERR arguments before running the comparison.
 _AT_DEFINE_SETUP([AT_CHECK_NOESCAPE],
-[_AT_CHECK([$1],[$2],[$3],[$4],[$5],[$6])])
+[_AT_CHECK(m4_expand([$1]),[$2],[$3],[$4],[$5],[$6])])
 
 
 # _AT_DECIDE_TRACEABLE(COMMANDS)
@@ -1827,10 +1827,6 @@ _AT_DEFINE_SETUP([AT_CHECK_NOESCAPE],
 # just described, the test suite preemptively disables tracing for 31 of those,
 # and 268 contain parameter expansions that require runtime evaluation.  The
 # balance are always safe to trace.
-#
-# _AT_CHECK expands COMMANDS, but the Autoconf language does not provide a way
-# to safely expand arbitrary COMMANDS in an argument list, so the below tests
-# examine COMMANDS unexpanded.
 m4_define([_AT_DECIDE_TRACEABLE],
 dnl Utility macro.
 dnl
@@ -1919,17 +1915,17 @@ m4_define([AT_DIFF_STDOUT()],
 # with parallel jobs.
 m4_define([_AT_CHECK],
 [{ $at_traceoff
-AS_ECHO(["$at_srcdir/AT_LINE: AS_ESCAPE([$1])"])
+AS_ECHO(["$at_srcdir/AT_LINE: AS_ESCAPE([[$1]])"])
 echo AT_LINE >"$at_check_line_file"
 
 : >"$at_stdout"
 if _AT_DECIDE_TRACEABLE([$1]); then
   : >"$at_stder1"
-  ( $at_traceon; $1 ) >>"$at_stdout" 2>>"$at_stder1"
+  ( $at_traceon; [$1] ) >>"$at_stdout" 2>>"$at_stder1"
   at_fn_filter_trace $?
 else
   : >"$at_stderr"
-  ( :; $1 ) >>"$at_stdout" 2>>"$at_stderr"
+  ( :; [$1] ) >>"$at_stdout" 2>>"$at_stderr"
 fi
 at_status=$?
 at_failed=false
index 631c0c8052725877d7bc4c2ffe78f7b5dc1af5b5..820e7e3ab7a0144158da880d2ba0516b3003aea8 100644 (file)
@@ -310,15 +310,12 @@ AT_CHECK_AT_TEST([Invalid brace-enclosed parameter expansion],
 ## M4 macros in test commands.  ##
 ## ---------------------------- ##
 
-# The last paragaph in the comment above _AT_DECIDE_TRACEABLE illustrates why
-# this test fails (except with Korn shell-style quoting $'foo\nbar').
 AT_CHECK_AT_TEST([Multiline command from M4 expansion],
   [m4_define([GNU], ['foo
 bar'])
    AT_CHECK([echo GNU], 0, [foo
 bar
-], [])], [case `( set -x; echo 'foo
-bar') 2>&1` in *\$\'foo\\nbar\'*) false;; *) :;; esac])
+], [])])
 
 AT_CHECK_AT_TEST([Double-M4-quoted command],
   [m4_define([GNU], ['foo
index 5cd64cf4fd93c5f816ec2f68ae6bb5cf5ed3a220..3fa0fdb8a1590cbbfbc95c42fbee8b9a982d1f33 100644 (file)
@@ -786,7 +786,7 @@ AC_OUTPUT
 AT_CHECK_AUTOUPDATE
 AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE
-AT_CHECK([grep 'AC_HEADER_STDC(' configure.ac], 1, [ignore], [ignore])
+AT_CHECK([grep 'AC_HEADER_STDC[(]' configure.ac], 1, [ignore], [ignore])
 AT_CHECK([grep 'AC_HEADER_STDC' configure.ac], 0, [ignore], [ignore])
 
 AT_CLEANUP