+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.
** 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
# 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])
# 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)
# 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
# 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
## 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