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 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
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.
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
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"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+"conf], 0, [Auto\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+conf
+], [])])
+
+# This command has both escaped and unescaped newlines.
+AT_CHECK_AT_TEST([Newline-CODE-BS-newline in command],
+ [AT_CHECK([echo Auto'
+'co\
+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. ##
## ------------------------------- ##