From: Eric Blake Date: Fri, 21 Nov 2008 00:23:52 +0000 (-0700) Subject: Fix XFAIL related to AT_CHECK. X-Git-Tag: v2.63b~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79042ea34671407b95a40feb4ba0963f5aad9ff7;p=thirdparty%2Fautoconf.git 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. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 8b2986de7..0d0ce659e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-11-20 Eric Blake + + 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 Reduce forks in AC_DEFINE. diff --git a/NEWS b/NEWS index 297b3ea5b..01dbd3e24 100644 --- 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 diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index ebde0b30d..fc48c1f8c 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -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 diff --git a/tests/autotest.at b/tests/autotest.at index 631c0c805..820e7e3ab 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -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 diff --git a/tests/tools.at b/tests/tools.at index 5cd64cf4f..3fa0fdb8a 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -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