[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Faster AT_CHECK, one less XFAIL
From: |
Eric Blake |
Subject: |
Re: Faster AT_CHECK, one less XFAIL |
Date: |
Fri, 21 Nov 2008 12:39:52 -0800 (PST) |
> > +** 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.
>
> If you haven't committed, maybe you can add "of AC_DEFINE and AT_CHECK"
> after "Most uses". Otherwise, not a big deal.
Done, and Ralf's typo fix, and more importantly, a testsuite fix:
my test for strange filename support in autotest was a no-op,
because the wrong quadrigraphs were in use such that the
here-docs to build the sample testsuite ended up not using
the strange filenames.
>From a8a9b2148de0afc053ded2b3f9edc232a0d1aa96 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Fri, 21 Nov 2008 12:28:36 -0700
Subject: [PATCH] Fix typos in recent testsuite improvements.
* lib/autotest/general.m4 (AT_INIT) <at_fn_check_prepare_dynamic>:
Fix typo.
* NEWS: Clarify the potential impact to users.
* tests/autotest.at (AT_DATA_AUTOTEST): New macro, patterned after
AT_DATA_M4SUGAR.
(AT_CHECK_AT_PREP, AT_CHECK_AT_TITLE): Use it.
(unusual file names): Test that the recent echo fix does not
regress. Fix quoting bug that made the test a no-op.
Reported by Paolo Bonzini and Ralf Wildenhues.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 13 +++++++++
NEWS | 10 +++---
lib/autotest/general.m4 | 2 +-
tests/autotest.at | 67
+++++++++++++++++++++++++++-------------------
4 files changed, 58 insertions(+), 34 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 37ecf00..81d9dcf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2008-11-21 Eric Blake <address@hidden>
+ Fix typos in recent testsuite improvements.
+ * lib/autotest/general.m4 (AT_INIT) <at_fn_check_prepare_dynamic>:
+ Fix typo.
+ * NEWS: Clarify the potential impact to users.
+ * tests/autotest.at (AT_DATA_AUTOTEST): New macro, patterned after
+ AT_DATA_M4SUGAR.
+ (AT_CHECK_AT_PREP, AT_CHECK_AT_TITLE): Use it.
+ (unusual file names): Test that the recent echo fix does not
+ regress. Fix quoting bug that made the test a no-op.
+ Reported by Paolo Bonzini and Ralf Wildenhues.
+
+2008-11-21 Eric Blake <address@hidden>
+
Use modern m4sh constructs in autoconf.
* bin/autoconf.as (exit_missing_arg, getopt): Use AS_ERROR, rather
than AS_EXIT.
diff --git a/NEWS b/NEWS
index 01dbd3e..3edc6bc 100644
--- a/NEWS
+++ b/NEWS
@@ -30,11 +30,11 @@ GNU Autoconf NEWS - User visible changes.
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.
+ comments and shell case statements. As a result, it is used
+ internally in more places, such as AC_DEFINE and AT_CHECK. Most
+ uses of AC_DEFINE and AT_CHECK 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
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 4800701..ff2f8ca 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -287,7 +287,7 @@ at_fn_check_prepare_trace ()
AS_FUNCTION_DESCRIBE([at_fn_check_prepare_dynamic], [COMMAND LINE],
[Decide if COMMAND at LINE is traceable at runtime, and call the
-appropriate prepation function.])
+appropriate preparation function.])
at_fn_check_prepare_dynamic ()
{
case "$at_traceon:$[1]" in
diff --git a/tests/autotest.at b/tests/autotest.at
index 820e7e3..14a430a 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -20,6 +20,16 @@ AT_BANNER([Autotest.])
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
+
+# AT_DATA_AUTOTEST(FILE-NAME, CONTENTS)
+# -------------------------------------
+# Escape the invalid tokens with @&address@hidden
+m4_define([AT_DATA_AUTOTEST],
+[AT_DATA([$1],
+[m4_bpatsubst([$2],
[\(@.\)\(address@hidden)\|\(m4\|AS\|AT\)\(_\)\|\(d\)\(nl\)],
+ [\1\3\5@&address@hidden)])])
+
+
# AT_CHECK_AT_PREP(NAME, SUITE-CODE, [STATUS = 0], [STDOUT], [STDERR],
# [DIR = .])
# --------------------------------------------------------------------
@@ -36,15 +46,15 @@ m4_pushdef([AT_dir], m4_ifval([$6], [[[$6]]], [.]))dnl
dnl
AT_CAPTURE_FILE([$1.log])dnl
dnl
-AT_DATA(AT_dir[/package.m4],
-[[m4_define([AT@&address@hidden, [GNU Nonsense])
-m4_define([AT@&address@hidden, [nonsense])
-m4_define([AT@&address@hidden, [1.0])
-m4_define([AT@&address@hidden, [GNU Nonsense 1.0])
-m4_define([AT@&address@hidden, address@hidden)
+AT_DATA_AUTOTEST(AT_dir[/package.m4],
+[[m4_define([AT_PACKAGE_NAME], [GNU Nonsense])
+m4_define([AT_PACKAGE_TARNAME], [nonsense])
+m4_define([AT_PACKAGE_VERSION], [1.0])
+m4_define([AT_PACKAGE_STRING], [GNU Nonsense 1.0])
+m4_define([AT_PACKAGE_BUGREPORT], address@hidden)
]])
dnl
-AT_DATA(AT_dir[/$1.at], m4_bpatsubst([[$2]], [AT_], [AT@&address@hidden))
+AT_DATA_AUTOTEST(AT_dir[/$1.at], [$2])
m4_ifval([$6], [(cd AT_dir])
AT_CHECK_AUTOM4TE([--language=autotest -o $1 $1.at], [$3], [$4], [$5])
m4_ifval([$6], [)])
@@ -414,14 +424,14 @@ AT_CLEANUP
m4_define([AT_CHECK_AT_TITLE],
[AT_CHECK_AT([$1],
[[
-m4@&address@hidden([macro_name], [[macro_expanded]])
-m4@&address@hidden([macro_expanded], [[macro_overexpanded]])
-m4@&address@hidden([macro_backquote], [`])
-m4@&address@hidden([macro_single_quote], ['])
-m4@&address@hidden([macro_double_quote], ["])
+m4_define([macro_name], [[macro_expanded]])
+m4_define([macro_expanded], [[macro_overexpanded]])
+m4_define([macro_backquote], [`])
+m4_define([macro_single_quote], ['])
+m4_define([macro_double_quote], ["])
]]dnl restore font-lock: "
-[[m4@&address@hidden([macro_backslash], [\])
-m4@&address@hidden([macro_echo], [$][1])
+[[m4_define([macro_backslash], [\])
+m4_define([macro_echo], [$][1])
AT_INIT([artificial test suite])
AT_SETUP([$2])
AT_CHECK([:])
@@ -459,8 +469,8 @@ AT_CHECK_AT_TITLE_CHAR([Double-quote], ["])
dnl restore font-lock: "
AT_CHECK_AT_TITLE_CHAR([Backslash], [\])
AT_CHECK_AT_TITLE_CHAR([Brackets], [[[]]], [[]])
-AT_CHECK_AT_TITLE_CHAR([Left bracket], [@<@&t@:@], [@<:@])
-AT_CHECK_AT_TITLE_CHAR([Right bracket], [@:@&t@>@], [@:>@])
+AT_CHECK_AT_TITLE_CHAR([Left bracket], [@<:@], [@<:@])
+AT_CHECK_AT_TITLE_CHAR([Right bracket], [@:>@], [@:>@])
AT_CHECK_AT_TITLE_CHAR([Quoted pound], [[#]], [#])
AT_CHECK_AT_TITLE_CHAR([Pound], [#])
AT_CHECK_AT_TITLE_CHAR([Quoted comma], [[,]], [,])
@@ -696,7 +706,7 @@ AT_CHECK(:)
AT_CLEANUP
AT_SETUP(both) # 04
AT_KEYWORDS([key1 key2])
-AT_KEYWORDS([m4@&address@hidden([Key1])])
+AT_KEYWORDS([m4_echo([Key1])])
AT_CHECK(:)
AT_CLEANUP
AT_SETUP(test5) # 05
@@ -1027,24 +1037,25 @@ AT_CLEANUP
AT_SETUP([unusual file names])
-AT_DATA_M4SUGAR([d@&address@hidden,
-[[AT@&address@hidden([test one])
+AT_DATA_AUTOTEST([d@&address@hidden,
+[[AT_SETUP([test one])
m4_pattern_allow([^dnl$])
-AT@&address@hidden([test "]m4_dquote(AT@&address@hidden)[" = dn[]l.at:3])
-AT@&address@hidden
+AT_CHECK([test "]m4_dquote(AT_LINE)[" = dn[]l.at:3])
+AT_CLEANUP
]])
mkdir sub
-AT_DATA_M4SUGAR([sub/"two spaces".at],
-[[AT@&address@hidden([test two])
-AT@&address@hidden([test "]m4_dquote(AT@&address@hidden)[" = "two
spaces.at:2"])
-AT@&address@hidden
+AT_DATA_AUTOTEST([sub/"two spaces".at],
+[[AT_SETUP([test two])
+AT_CHECK([test "]m4_dquote(AT_LINE)[" = "two spaces.at:2"])
+AT_CLEANUP
]])
AT_CHECK_AT_PREP([suite],
[[AT_INIT([suite to check included file names])
-m4@&address@hidden([d][nl.at])
-m4@&address@hidden([sub/two spaces.at])
+m4_include([d][nl.at])
+m4_include([sub/two spaces.at])
]])
-AT_CHECK([$CONFIG_SHELL ./suite], [0], [ignore])
+AT_CHECK([$CONFIG_SHELL ./suite], [0], [stdout])
+AT_CHECK([grep 'two spaces' suite.log], [1])
AT_CLEANUP
--
1.6.0.4
--
View this message in context:
http://www.nabble.com/Faster-AT_CHECK%2C-one-less-XFAIL-tp20614096p20629113.html
Sent from the Gnu - Autoconf - Patches mailing list archive at Nabble.com.