From: Eric Blake Date: Wed, 26 Sep 2007 23:23:00 +0000 (-0600) Subject: Remove some XFAILs, and make AT_SETUP output line up. X-Git-Tag: v2.62~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b299b6d82819468d0427c0ae6332a02ec569915;p=thirdparty%2Fautoconf.git 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. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index b15f8cce..2b4d5353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2007-10-03 Eric Blake + 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 73dc8f75..1bd5f5ab 100644 --- 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 diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 4be59a6a..a0de2853 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -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 ]) diff --git a/tests/autotest.at b/tests/autotest.at index b9384f8a..adef6ced 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -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(['])], [']) ## ----------------- ## diff --git a/tests/base.at b/tests/base.at index f7e9ecf6..afbe8844 100644 --- a/tests/base.at +++ b/tests/base.at @@ -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], diff --git a/tests/compile.at b/tests/compile.at index e46ace3c..8863c60a 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -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 diff --git a/tests/tools.at b/tests/tools.at index f5a21e02..e13a737c 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -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 diff --git a/tests/torture.at b/tests/torture.at index 268c15b7..a55834c5 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -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