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) <AT_CHECK>: 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 <ebb9@byu.net>
This commit is contained in:
Eric Blake 2009-04-22 17:14:13 -06:00
parent f4e756e351
commit bcb6b3180d
6 changed files with 41 additions and 16 deletions

View File

@ -1,3 +1,17 @@
2009-04-24 Eric Blake <ebb9@byu.net>
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) <AT_CHECK>: 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 <Ralf.Wildenhues@gmx.de>
New test to ensure autom4te cache file locking works.

3
NEWS
View File

@ -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

View File

@ -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

View File

@ -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)
# ------------------------------

View File

@ -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])

View File

@ -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])