]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autotest/general.m4 (_AT_CHECK) [--trace]: Do not enable shell
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Dec 2004 01:04:25 +0000 (01:04 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Dec 2004 01:04:25 +0000 (01:04 +0000)
tracing on commands with possibly-escaped newlines.
* doc/autoconf.texi (Writing testsuite.at): Delete documentation of the
discontinued behavior and its implications.
* tests/autotest.at (BS-newline in command, ^BS-newline in command)
(BSx641-newline in command, BS-BS-newline in command)
(BSx640-newline in command, Newline-CODE-BS-newline in command)
(Single-quote-BS-newline in command)
(Single-quote-newline-BS-newline in command): New tests.

ChangeLog
doc/autoconf.texi
lib/autotest/general.m4
tests/autotest.at

index f32306ddf9de63cdd132ffd2b560c677f61d8ee3..f1309dca88d21598d296b4050beef2c541e90f16 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-12-13  Noah Misch  <noah@cs.caltech.edu>
+
+       * lib/autotest/general.m4 (_AT_CHECK) [--trace]: Do not enable shell
+       tracing on commands with possibly-escaped newlines.
+       * doc/autoconf.texi (Writing testsuite.at): Delete documentation of the
+       discontinued behavior and its implications.
+       * tests/autotest.at (BS-newline in command, ^BS-newline in command)
+       (BSx641-newline in command, BS-BS-newline in command)
+       (BSx640-newline in command, Newline-CODE-BS-newline in command)
+       (Single-quote-BS-newline in command)
+       (Single-quote-newline-BS-newline in command): New tests.
+
 2004-12-13  Stepan Kasal  <kasal@ucw.cz>
 
        * lib/m4sugar/m4sh.m4 (AS_EXECUTABLE_P): Use test -f && test -x
index 9cad5a4f688254a34581a5cac189d1b188a7c303..76055c27f435abedddb1216fcb3122743b87792c 100644 (file)
@@ -15442,29 +15442,6 @@ commands @var{run-if-pass}.
 The @var{commands} @emph{must not} redirect the standard output, nor the
 standard error.
 
-If the @var{commands} may contain a newline, @command{testsuite} will
-not enable shell tracing for them when the user passes @option{-x}.
-Since unquoted, unescaped literal newlines are never necessary to
-achieve particular semantics, escape them.  For example, avoid this:
-
-@display
-cat LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG |
-  grep fairly-long-in-its-own-right
-echo "A sentence."
-@end display
-
-Write this instead:
-
-@display
-cat LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG | \
-  grep fairly-long-in-its-own-right ; \
-echo "A sentence."
-@end display
-
-The presence in @var{commands} of any command substitution or a
-parameter expansion yielding multiple lines also inhibits shell tracing,
-but those constructs are rarely so easy to remove.
-
 If @var{status}, or @var{stdout}, or @var{stderr} is @samp{ignore}, then
 the corresponding value is not checked.
 
index 00a52f5e47b87c342511fbd78c5565c374df059c..045be5b49caefe0fc6824ffd4f9dc693ab4052fa 100644 (file)
@@ -1234,7 +1234,6 @@ if test -n "$at_traceon"; then
     case "$at_cmd_expanded" in
         *\$\(*\)*)         at_reason='a $(...) command substitution' ;;
         *\`*\`*)           at_reason='a `...` command substitution' ;;
-        *\\"$at_lf"*)      at_reason= ;;
         *"$at_lf"*)        at_reason='an embedded newline' ;;
         *)                 at_reason= ;;
     esac
index 2498f171eefd23eea6a42d351312ac60977197b1..5d51f19290b0aa31891352229ffca435eedf679c 100644 (file)
@@ -111,6 +111,58 @@ bar
 bar
 ], [])])
 
+AT_CHECK_AT_TEST([BS-newline in command],
+  [AT_CHECK([echo Auto"\
+"conf], 0, [Autoconf
+], [])])
+
+AT_CHECK_AT_TEST([^BS-newline in command],
+  [AT_CHECK([\
+echo GNU], 0, [GNU
+], [])])
+
+AT_CHECK_AT_TEST([BSx641-newline in command],
+  [AT_CHECK([echo Auto"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+"conf], 0, [Auto\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\conf
+], [])])
+
+AT_CHECK_AT_TEST([BS-BS-newline in command],
+  [AT_CHECK([echo Auto"\\
+"conf], 0, [Auto\
+conf
+], [])])
+
+# A `^BS-BS-newline in command' test will run a command named `\'.  No, thanks.
+
+AT_CHECK_AT_TEST([BSx640-newline in command],
+  [AT_CHECK([echo Auto"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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+nf], 0, [Auto
+conf
+], [])])
+
+AT_CHECK_AT_TEST([Single-quote-BS-newline in command],
+  [AT_CHECK([echo Auto'\
+'conf], 0, [Auto\
+conf
+], [])])
+
+AT_CHECK_AT_TEST([Single-quote-newline-BS-newline in command],
+  [AT_CHECK([echo Auto'
+\
+'conf], 0, [Auto
+\
+conf
+], [])])
+
+
 ## ------------------------------- ##
 ## Funny characters in test names. ##
 ## ------------------------------- ##