autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: 12AT_CHECK_NOESCAPE.diff (was 12AT_CHECK_NOESCAPE.diff)


From: Derek Robert Price
Subject: FYI: 12AT_CHECK_NOESCAPE.diff (was 12AT_CHECK_NOESCAPE.diff)
Date: Thu, 07 Aug 2003 13:50:00 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

Come to think of it, Akim already approved the concept behind this one, if not the actual patch: <http://mail.gnu.org/archive/html/autoconf-patches/2003-04/msg00019.html>. It's small enough that I doubt I committed any gross errors, so I've committed it.

Derek

address@hidden wrote:

Here's the other patch I've been waiting four months on.  This one simply adds
an AT_CHECK like macro called AT_CHECK_NOESCAPE that does not escape shell
metacharacters in its STDOUT & STDERR arguments.

----- Original Message -----

I implemented AT_CHECK_NOESCAPE slightly differently than I originally
suggested to Akim since it is less overhead.  AT_CHECK simply calls
AT_CHECK_NOESCAPE with args 3 & 4 AS_ESCAPED and AT_CHECK_NOESCAPE contains
all the original functionality of AT_CHECK except for the AS_ESCAPE of args
3 & 4.

The entire autoconf test suite now passes without changes with this patch
applied and AT_CHECK_NOESCAPE does what it is supposed to in the baby CVS
autotest suite.

Index: ChangeLog
2003-04-09  Derek Price  <address@hidden>

        * lib/autotest/general.m4 (AT_CHECK): Move core functionality...
        (AT_CHECK_NOESCAPE): ...to this new macro.

Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.141
diff -u -r1.141 general.m4
--- lib/autotest/general.m4     31 Mar 2003 20:25:52 -0000      1.141
+++ lib/autotest/general.m4     8 Apr 2003 15:53:11 -0000
@@ -853,11 +853,13 @@
])


-# AT_CHECK(COMMANDS, [STATUS = 0], STDOUT, STDERR)
+# AT_CHECK(COMMANDS, [STATUS = 0], STDOUT, STDERR,
+#          [RUN-IF-FAIL], [RUN-IF-PASS])
# ------------------------------------------------
# Execute a test by performing given shell COMMANDS.  These commands
# should normally exit with STATUS, while producing expected STDOUT and
-# STDERR contents.
+# STDERR contents.  Shell metacharacters in STDOUT and STDERR are
+# _not_ processed by the shell, but are treated as string literals.
#
# STATUS, STDOUT, and STDERR are not checked if equal to `ignore'.
#
@@ -919,6 +921,16 @@
#  ( $at_traceon; $1 ) >at-stdout 2>at-stder1
#
m4_define([AT_CHECK],
+[AT_CHECK_NOESCAPE([$1],[$2],AS_ESCAPE([$3]),AS_ESCAPE([$4]),[$5],[$6])])
+
+
+
+# AT_CHECK_NOESCAPE(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.
+m4_define([AT_CHECK_NOESCAPE],
[$at_traceoff
$at_verbose "AT_LINE: AS_ESCAPE([$1])"
echo AT_LINE >$at_check_line_file
@@ -933,14 +945,14 @@
        ignore, [(echo stderr:; cat $at_stderr) >&5],
        experr, [$at_diff experr $at_stderr >&5 || at_failed=:],
        [],     [$at_diff $at_devnull $at_stderr >&5 || at_failed=:],
-        [echo >>$at_stderr; echo "AS_ESCAPE([$4])" | $at_diff - $at_stderr >&5 
|| at_failed=:])
+        [echo >>$at_stderr; echo "[$4]" | $at_diff - $at_stderr >&5 || 
at_failed=:])
dnl Check stdout.
m4_case([$3],
        stdout, [(echo stdout:; tee stdout <$at_stdout) >&5],
        ignore, [(echo stdout:; cat $at_stdout) >&5],
        expout, [$at_diff expout $at_stdout >&5 || at_failed=:],
        [],     [$at_diff $at_devnull $at_stdout >&5 || at_failed=:],
-        [echo >>$at_stdout; echo "AS_ESCAPE([$3])" | $at_diff - $at_stdout >&5 
|| at_failed=:])
+        [echo >>$at_stdout; echo "[$3]" | $at_diff - $at_stdout >&5 || 
at_failed=:])
dnl Check exit val.  Don't `skip' if we are precisely checking $? = 77.
case $at_status in
m4_case([$2],
@@ -958,4 +970,4 @@
AS_IF($at_failed, [$5], [$6])
$at_failed && exit 1
$at_traceon
-])# AT_CHECK
+])# AT_CHECK_NOESCAPE



--
               *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
--
I used to think people were crazy to get tatoos.  Nowadays, I envy
them that clarity of thought.  There was at least one point in their lives when they 
thought they knew what they were doing.  They could walk into a tatoo parlor and say, 
"I want a big old pig, in red and black, with flames shooting out of its nose!  And 
I want it right there!  That's who I am!"






reply via email to

[Prev in Thread] Current Thread [Next in Thread]