From bcb6b3180d18993a286b12585d890e3bea6e8c37 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 22 Apr 2009 17:14:13 -0600 Subject: [PATCH] Rename AT_CHECK_NOESCAPE to AT_CHECK_UNQUOTED. * lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Deprecate, in favor of new spelling... (AT_CHECK_UNQUOTED): ...for consistency with AC_DEFINE_UNQUOTED. * doc/autoconf.texi (Writing Testsuites) : Document the rename. * NEWS: Likewise. * tests/autotest.at (Binary output, Cleanup): Adjust tests. * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS): Likewise. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake --- ChangeLog | 14 ++++++++++++++ NEWS | 3 ++- doc/autoconf.texi | 12 +++++++----- lib/autotest/general.m4 | 16 ++++++++++++---- tests/autotest.at | 8 ++++---- tests/torture.at | 4 ++-- 6 files changed, 41 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93cf5f22a..1307b0c6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-04-24 Eric Blake + + Rename AT_CHECK_NOESCAPE to AT_CHECK_UNQUOTED. + * lib/autotest/general.m4 (AT_CHECK_NOESCAPE): Deprecate, in favor + of new spelling... + (AT_CHECK_UNQUOTED): ...for consistency with AC_DEFINE_UNQUOTED. + * doc/autoconf.texi (Writing Testsuites) : Document the + rename. + * NEWS: Likewise. + * tests/autotest.at (Binary output, Cleanup): Adjust tests. + * tests/torture.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS): + Likewise. + Reported by Ralf Wildenhues. + 2009-04-22 Ralf Wildenhues New test to ensure autom4te cache file locking works. diff --git a/NEWS b/NEWS index 107a10c0c..2831d664d 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,8 @@ GNU Autoconf NEWS - User visible changes. of AT_XFAIL_IF. It also understands the new directives ignore-nolog, stdout-nolog, and stderr-nolog. -** The autotest macro AT_CHECK_NOESCAPE is now documented. +** The following documented autotest macros are new: + AT_CHECK_UNQUOTED ** The following documented m4sugar macros are new: m4_argn m4_default_nblank m4_default_nblank_quoted m4_ifblank diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 15798a490..d1a77fa68 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -22403,11 +22403,12 @@ be a single shell word that expands into a single file name. @defmac AT_CHECK (@var{commands}, @dvar{status, 0}, @ovar{stdout}, @ @ovar{stderr}, @ovar{run-if-fail}, @ovar{run-if-pass}) -@defmacx AT_CHECK_NOESCAPE (@var{commands}, @dvar{status, 0}, @ovar{stdout}, @ +@defmacx AT_CHECK_UNQUOTED (@var{commands}, @dvar{status, 0}, @ovar{stdout}, @ @ovar{stderr}, @ovar{run-if-fail}, @ovar{run-if-pass}) @atindex{CHECK} -@atindex{CHECK_NOESCAPE} -Execute a test by performing given shell @var{commands}. These commands +@atindex{CHECK_UNQUOTED} +Execute a test by performing given shell @var{commands}. @var{commands} +is output as-is, so shell expansions are honored. These commands should normally exit with @var{status}, while producing expected @var{stdout} and @var{stderr} contents. If @var{commands} exit with unexpected status 77, then the rest of the test group is skipped. If @@ -22433,9 +22434,10 @@ parameter is treated as text that must exactly match the output given by @var{commands} on standard out and standard error (including an empty parameter for no output); any differences are captured in the testsuite log and the test is failed. The difference between @code{AT_CHECK} and -@code{AT_CHECK_NOESCAPE} is that only the latter performs shell +@code{AT_CHECK_UNQUOTED} is that only the latter performs shell expansions on comparison text given in the @var{stdout} and @var{stderr} -arguments. +arguments (however, there is no difference in the interpretation of +@var{commands}). @table @samp @item ignore diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 2e622a5b3..f959a4189 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -332,7 +332,7 @@ at_fn_check_skip () { case $[1] in 99) echo 99 > "$at_status_file"; at_failed=: - AS_ECHO(["$[2]: hard failure"]); exit 99;; + AS_ECHO(["$[2]: hard failure"]); exit 99;; 77) echo 77 > "$at_status_file"; exit 77;; esac } @@ -350,7 +350,7 @@ dnl $? = 77 or $? = 99. $[1] ) ;; 77) echo 77 > "$at_status_file"; exit 77;; 99) echo 99 > "$at_status_file"; at_failed=: - AS_ECHO(["$[3]: hard failure"]); exit 99;; + AS_ECHO(["$[3]: hard failure"]); exit 99;; *) AS_ECHO(["$[3]: exit code was $[2], expected $[1]"]) at_failed=:;; esac @@ -1904,15 +1904,23 @@ _AT_DEFINE_SETUP([AT_CHECK], [_AT_CHECK(m4_expand([$1]), [$2], m4_expand([AS_ESCAPE([$3])]), m4_expand([AS_ESCAPE([$4])]), [$5], [$6])]) -# AT_CHECK_NOESCAPE(COMMANDS, [STATUS = 0], STDOUT, STDERR, +# AT_CHECK_UNQUOTED(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_DEFINE_SETUP([AT_CHECK_UNQUOTED], [_AT_CHECK(m4_expand([$1]), [$2], m4_expand([$3]), m4_expand([$4]), [$5], [$6])]) +# AT_CHECK_NOESCAPE(COMMANDS, [STATUS = 0], STDOUT, STDERR, +# [RUN-IF-FAIL], [RUN-IF-PASS]) +# --------------------------------------------------------- +# Obsolete spelling of AT_CHECK_UNQUOTED. +m4_define([AT_CHECK_NOESCAPE], +[m4_warn([obsolete], [use AT_CHECK_UNQUOTED instead of $0])]dnl +[AT_CHECK_UNQUOTED($@)]) + # _AT_DECIDE_TRACEABLE(COMMANDS) # ------------------------------ diff --git a/tests/autotest.at b/tests/autotest.at index 721925c21..827808cd0 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -349,7 +349,7 @@ AT_CHECK_AT([Binary output], str=$str$str$str$str$str$str$str$str$str$str str=$str$str$str$str$str$str$str$str$str$str str=$str$str$str$str$str - AT_CHECK_NOESCAPE([echo $str], [0], [[$str]m4_newline]) + AT_CHECK_UNQUOTED([echo $str], [0], [[$str]m4_newline]) AT_CLEANUP AT_SETUP([fail: no trailing newline]) AT_CHECK([printf short], [0], [stdout-nolog]) @@ -366,7 +366,7 @@ AT_CHECK_AT([Binary output], str=$str$str$str$str$str$str$str$str$str$str str=$str$str$str$str$str$str$str$str$str$str str=$str$str$str$str$str - AT_CHECK_NOESCAPE([echo x$str], [0], [[${str}x]m4_newline]) + AT_CHECK_UNQUOTED([echo x$str], [0], [[${str}x]m4_newline]) AT_CLEANUP ]], [], [0], [], [], [], [AT_CHECK([$CONFIG_SHELL ./micro-suite 4], [1], [ignore], [ignore]) @@ -376,10 +376,10 @@ AT_CHECK_AT([Binary output], AT_CHECK_AT_TEST([Cleanup], [AT_CHECK([test ! -f cleanup.success && test ! -f cleanup.failure]) - AT_CHECK_NOESCAPE([exit $value], [ignore], [$output], + AT_CHECK_UNQUOTED([exit $value], [ignore], [$output], [], [touch cleanup.failure], [touch cleanup.success])], [], [], [], [], - [AT_KEYWORDS([AT@&t@_CHECK_NOESCAPE]) + [AT_KEYWORDS([AT@&t@_CHECK_UNQUOTED]) output=; export output], [AT_CHECK([test -d micro-suite.dir/1]) AT_CHECK([test -f micro-suite.dir/1/cleanup.success]) diff --git a/tests/torture.at b/tests/torture.at index 9d58e51f6..11cd05ae4 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -326,11 +326,11 @@ END [0], [ignore]) # Run the same test a 2nd time to see that config.status does not recreate # the header (regression test) - AT_CHECK_NOESCAPE([./config.status "--header=$file:$file.in"], + AT_CHECK_UNQUOTED([./config.status "--header=$file:$file.in"], [0], [config.status: creating $file config.status: $file is unchanged ]) - AT_CHECK_NOESCAPE([grep ' & ' "$file"], [], + AT_CHECK_UNQUOTED([grep ' & ' "$file"], [], [/* $file. Generated from $file.in by configure. */ ]) AT_CHECK([$FGREP "$file" "$file"], [0], [ignore]) -- 2.47.3