]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Remove some XFAILs, and make AT_SETUP output line up.
authorEric Blake <ebb9@byu.net>
Wed, 26 Sep 2007 23:23:00 +0000 (17:23 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 3 Oct 2007 22:20:45 +0000 (16:20 -0600)
* lib/autotest/general.m4 (AT_SETUP): Only expand description
once; thereafter, use its expansion, properly quoted.
* tests/autotest.at (AT_CHECK_AT_TITLE): Also check macro
expansion with arguments, and check for aligned output.
(AT_CHECK_AT_TITLE_CHAR): Remove XFAILs for tests that now pass.
Add a test for macros with parameters.
* NEWS: Document the semantics change.
* tests/base.at: Fix test titles containing commas.
* tests/compile.at: Likewise.
* tests/tools.at: Likewise.
* tests/torture.at: Likewise.

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

index b15f8cce333cdf7aa014dcee6b94bea4f61e79de..2b4d535306c00571c35c3df2c2e4c0e2a95c1567 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2007-10-03  Eric Blake  <ebb9@byu.net>
 
+       Remove some XFAILs, and make AT_SETUP output line up.
+       * lib/autotest/general.m4 (AT_SETUP): Only expand description
+       once; thereafter, use its expansion, properly quoted.
+       * tests/autotest.at (AT_CHECK_AT_TITLE): Also check macro
+       expansion with arguments, and check for aligned output.
+       (AT_CHECK_AT_TITLE_CHAR): Remove XFAILs for tests that now pass.
+       Add a test for macros with parameters.
+       * NEWS: Document the semantics change.
+       * tests/base.at: Fix test titles containing commas.
+       * tests/compile.at: Likewise.
+       * tests/tools.at: Likewise.
+       * tests/torture.at: Likewise.
+
        Another round of regex avoidance.
        * lib/m4sugar/m4sugar.m4 (m4_cr_alnum, m4_cr_all)
        (_m4_define_cr_not, m4_cr_not_letters, m4_cr_not_LETTERS)
diff --git a/NEWS b/NEWS
index 73dc8f75a6c980c6393f35d4add477cbd6928fd0..1bd5f5ab4e9402414e8e2aa1b7cf156f81083669 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,12 @@ GNU Autoconf NEWS - User visible changes.
 
 ** The command 'autoconf -' now correctly processes a file from stdin.
 
+** AT_SETUP now handles macro expansions properly when calculating line
+   length.  However, as a side effect, any whitespace immediately
+   following a single-quoted comma is lost.  If you previously used
+   AT_SETUP([a, b]), you could change to AT_SETUP([a,[] b]) to keep
+   the space.
+
 ** Autotest now determines $srcdir correctly.
 
 ** Autoconf now requires GNU M4 1.4.5 or later.  Earlier versions of M4 have
index 4be59a6a62736e3730fe6f9a7b7e02e77a4d60a0..a0de28530cb1e821c28ff7be12bf6e833c3d56dd 100644 (file)
@@ -1171,15 +1171,15 @@ m4_define([AT_SETUP],
 m4_ifdef([AT_capture_files], [m4_undefine([AT_capture_files])])
 m4_define([AT_line], AT_LINE)
 m4_define([AT_xfail], [at_xfail=no])
-m4_define([AT_description], [$1])
+m4_define([AT_description], m4_quote($1))
 m4_define([AT_ordinal], m4_incr(AT_ordinal))
 m4_append([AT_groups_all], [ ]m4_defn([AT_ordinal]))
 m4_divert_push([TESTS])dnl
-  AT_ordinal ) @%:@ AT_ordinal. m4_defn([AT_line]): $1
+  AT_ordinal ) @%:@ AT_ordinal. m4_defn([AT_line]): m4_defn([AT_description])
     at_setup_line='m4_defn([AT_line])'
-    at_desc="AS_ESCAPE([$1])"
-    $at_quiet AS_ECHO_N(["m4_format([%3d: %-]m4_eval(47 - m4_qdelta([$1]))[s],
-                      AT_ordinal, AS_ESCAPE([[$1]]))[]"])
+    at_desc="AS_ESCAPE(m4_defn([AT_description]))"
+    $at_quiet AS_ECHO_N(["m4_format([%3d: ], AT_ordinal)$at_desc"]dnl
+["m4_format(%m4_eval(47 - m4_qlen(m4_defn([AT_description])))[s])"])
 m4_divert_push([TEST_SCRIPT])dnl
 ])
 
index b9384f8a23c93b61ea948b49b32544b68024ec53..adef6ced9a80b786ece1a8361cbe543884048533 100644 (file)
@@ -245,20 +245,29 @@ m4_define([AT_CHECK_AT_TITLE],
 [AT_CHECK_AT([$1],
 [[
 m4@&t@_define([macro_name],         [[macro_expanded]])
-m4@&t@_define([macro_expanded], [[macro_overexpanded]])
+m4@&t@_define([macro_expanded],     [[macro_overexpanded]])
 m4@&t@_define([macro_backquote],    [`])
 m4@&t@_define([macro_single_quote], ['])
 m4@&t@_define([macro_double_quote], ["])
 ]]dnl restore font-lock: "
-[[m4@&t@_define([macro_backslash],   [\\])
+[[m4@&t@_define([macro_backslash],  [\])
+m4@&t@_define([macro_echo],         [$][1])
 AT_INIT([artificial test suite])
 AT_SETUP([$2])
 AT_CHECK([:])
 AT_CLEANUP
 ]], [$4], [], [], [],
+dnl This sed script checks for two things - that the output is properly
+dnl expanded, and that the 'ok' starts on column 53.
 [AT_CHECK([[$CONFIG_SHELL ./micro-suite |
-           sed -n 's/[^:]*: \(.*[^      ]\)[    ]*ok.*/\1/p']],,
+           sed -n '/^  1:/{
+h
+s/[^:]*: \(.*[^         ]\)[    ]*ok.*/\1/p
+x
+s/^.\{53\}ok.*/ok/p
+}']],,
 [[$3
+ok
 ]])
 AT_CHECK([[$CONFIG_SHELL ./micro-suite -l |
           sed -n 's/.*[0-9]: [^         ][^     ]*[     ][      ]*\(.*[^        ]\)[    ]*/\1/p']],,
@@ -273,28 +282,26 @@ m4_define([AT_CHECK_AT_TITLE_CHAR],
 [AT_CHECK_AT_TITLE([$1 in a test title], [A $2 in my name],
                    [A ]m4_ifval([$3], [[$3]], [[$2]])[ in my name], $4)])
 
-AT_CHECK_AT_TITLE_CHAR([Backquote],    [`])
-AT_CHECK_AT_TITLE_CHAR([Single-quote], ['])
-AT_CHECK_AT_TITLE_CHAR([Double-quote], ["])
+AT_CHECK_AT_TITLE_CHAR([Backquote],     [`])
+AT_CHECK_AT_TITLE_CHAR([Single-quote],  ['])
+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([Pound],      [[#]], [#])
-AT_CHECK_AT_TITLE_CHAR([Comma],        [,])
-
-AT_CHECK_AT_TITLE_CHAR([Quoted Macro],                  [[macro_name]],
-                                                          [macro_name])
-AT_CHECK_AT_TITLE_CHAR([Macro],                           [macro_name],
-                                                      [macro_expanded])
-AT_CHECK_AT_TITLE_CHAR([Macro with backquote],       [macro_backquote],
-                                                                   [`], [:])
+AT_CHECK_AT_TITLE_CHAR([Backslash],     [\])
+AT_CHECK_AT_TITLE_CHAR([Brackets],   [[[]]], [[]])
+AT_CHECK_AT_TITLE_CHAR([Pound],       [[#]], [#])
+AT_CHECK_AT_TITLE_CHAR([Quoted comma],[[,]], [,])
+AT_CHECK_AT_TITLE_CHAR([Comma],       [,[]], [,])
+
+AT_CHECK_AT_TITLE_CHAR([Quoted Macro], [[macro_name]], [macro_name])
+AT_CHECK_AT_TITLE_CHAR([Macro],        [macro_name],   [macro_expanded])
+AT_CHECK_AT_TITLE_CHAR([Macro with backquote],       [macro_backquote], [`])
 AT_CHECK_AT_TITLE_CHAR([Macro with single-quote], [macro_single_quote], ['])
-AT_CHECK_AT_TITLE_CHAR([Macro with double-quote], [macro_double_quote],
-                                                                   ["], [:])
+AT_CHECK_AT_TITLE_CHAR([Macro with double-quote], [macro_double_quote], ["])
 dnl restore font-lock: "
-# This test neither fails nor passes reliably.
-# AT_CHECK_AT_TITLE_CHAR([Macro with backslash],       [macro_backslash],
-#                                                                  [\\], [:])
+AT_CHECK_AT_TITLE_CHAR([Macro with backslash],       [macro_backslash], [\])
+AT_CHECK_AT_TITLE_CHAR([Macro echoing macro], [macro_echo([macro_name])],
+                       [macro_expanded])
+AT_CHECK_AT_TITLE_CHAR([Macro echoing single-quote], [macro_echo(['])], ['])
 
 
 ## ----------------- ##
index f7e9ecf65dde9e4b83d3b4aecebe07a03a1fc3fb..afbe88446a9c391042a29cc29299fcc733f4a4f8 100644 (file)
@@ -85,7 +85,7 @@ AT_CLEANUP
 ## AC_REQUIRE and AC_DEFUN_ONCE: Require, expand.  ##
 ## ----------------------------------------------- ##
 
-AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: Require, expand])
+AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: [Require, expand]])
 
 AT_DATA([configure.ac],
 [[AC_DEFUN([TEST],
@@ -129,7 +129,7 @@ AT_CLEANUP
 ## AC_REQUIRE and AC_DEFUN_ONCE: Expand, require.  ##
 ## ----------------------------------------------- ##
 
-AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: Expand, require])
+AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: [Expand, require]])
 
 AT_DATA([configure.ac],
 [[AC_DEFUN([TEST],
index e46ace3cbc60694148e1cd3ffa93d391ae96db67..8863c60ab57d4783fd8f7c0d2c2b6b61cf3a77ec 100644 (file)
@@ -2,7 +2,8 @@
 
 AT_BANNER([Low level compiling/preprocessing macros.])
 
-# Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007 Free Software
+# Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,7 +28,7 @@ AT_BANNER([Low level compiling/preprocessing macros.])
 ## AC_LANG, AC_LANG_PUSH & AC_LANG_POP.  ##
 ## ------------------------------------- ##
 
-AT_SETUP([AC_LANG, AC_LANG_PUSH & AC_LANG_POP])
+AT_SETUP([[AC_LANG, AC_LANG_PUSH & AC_LANG_POP]])
 
 AT_DATA([configure.ac],
 [[AC_INIT
index f5a21e028366b76679548c875099eca92e8fe07b..e13a737c1b425cceb46e6bdf1279b487c837e2f4 100644 (file)
@@ -264,7 +264,7 @@ AT_CLEANUP
 
 # autoconf: forbidden tokens, basic
 # ---------------------------------
-AT_SETUP([autoconf: forbidden tokens, basic])
+AT_SETUP([autoconf: forbidden tokens,[] basic])
 
 AT_DATA_M4SH([configure.ac],
 [[AS_INIT
@@ -292,7 +292,7 @@ AT_CLEANUP
 
 # autoconf: forbidden tokens, exceptions
 # --------------------------------------
-AT_SETUP([autoconf: forbidden tokens, exceptions])
+AT_SETUP([autoconf: forbidden tokens,[] exceptions])
 
 AT_DATA_M4SH([configure.ac],
 [[AS_INIT
index 268c15b7995503eb295a59d1f325ba1a1f884f9c..a55834c52522d8e216a86bca5509be225ebd594d 100644 (file)
@@ -119,6 +119,7 @@ AT_CHECK_AC_ARG_VAR([apple of my {eye}], [orange of my eye])
 
 # Change a precious variable that contains all kinds of fun
 AT_CHECK_AC_ARG_VAR(['p  r     ec"iou$], [orange of my eye])
+dnl restore font-lock: "
 
 AT_CLEANUP
 
@@ -129,7 +130,7 @@ AT_CLEANUP
 ## AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS.  ##
 ## ---------------------------------------------- ##
 
-AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
+AT_SETUP([[AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS]])
 
 AT_DATA([configure.ac],
 [[AC_INIT
@@ -305,6 +306,7 @@ AT_CHECK_CONFIGURE([one="\"'$ " --enable-two="\" '  $" --with-three="       \"'$"|
 AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
         ["'$ " '  $    "'$
 ])
+dnl restore font-lock: "
 
 AT_CLEANUP