esac
}
-AS_FUNCTION_DESCRIBE([at_fn_filter_trace], [EXIT-CODE],
-[Split the contents of file "$at_stder1" into the "set -x" trace (on
-stderr) and the other lines (on file "$at_stderr"). Return the exit
-code EXIT-CODE.])
+AS_FUNCTION_DESCRIBE([at_fn_filter_trace], [],
+[Remove the lines in the file "$at_stderr" generated by "set -x" and print
+them to stderr.])
at_fn_filter_trace ()
{
+ mv "$at_stderr" "$at_stder1"
grep '^ *+' "$at_stder1" >&2
grep -v '^ *+' "$at_stder1" >"$at_stderr"
- return $[1]
}
AS_FUNCTION_DESCRIBE([at_fn_log_failure], [FILE-LIST],
# This may cause spurious failures when the test suite is run with `-x'.
#
_AT_DEFINE_SETUP([AT_CHECK],
-[_AT_CHECK(m4_expand([$1]),[$2],[$3],[$4],[$5],[$6],1)])
+[_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,
# [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_CHECK(m4_expand([$1]),[$2],[$3],[$4],[$5],[$6])])
+[_AT_CHECK(m4_expand([$1]), [$2], m4_expand([$3]),
+ m4_expand([$4]), [$5], [$6])])
# _AT_DECIDE_TRACEABLE(COMMANDS)
[at_fn_diff_devnull "$at_stdout" || at_failed=:])
# _AT_CHECK(COMMANDS, [STATUS = 0], STDOUT, STDERR,
-# [RUN-IF-FAIL], [RUN-IF-PASS], SHELL_ESCAPE_IO)
-# ---------------------------------------------------------
-# Worker for AT_CHECK & AT_CHECK_NOESCAPE. The final SHELL-ESCAPE-IO
-# argument determines whether the STDOUT & STDERR arguments will be escaped or
-# not.
-#
+# [RUN-IF-FAIL], [RUN-IF-PASS])
+# -------------------------------------------------
+# Worker for AT_CHECK and AT_CHECK_UNQUOTED, with COMMANDS, STDOUT, and
+# STDERR pre-expanded.
#
# Implementation Details
# ----------------------
AS_ECHO(["$at_srcdir/AT_LINE: AS_ESCAPE([[$1]])"])
echo AT_LINE >"$at_check_line_file"
-: >"$at_stdout"
if _AT_DECIDE_TRACEABLE([$1]); then
- : >"$at_stder1"
- ( $at_traceon; [$1] ) >>"$at_stdout" 2>>"$at_stder1"
- at_fn_filter_trace $?
+ at_check_trace=$at_traceon at_check_filter=at_fn_filter_trace
else
- : >"$at_stderr"
- ( :; [$1] ) >>"$at_stdout" 2>>"$at_stderr"
+ at_check_trace=: at_check_filter=:
fi
-at_status=$?
-at_failed=false
+: >"$at_stdout"; : >"$at_stderr"
+( $at_check_trace; [$1]
+) >>"$at_stdout" 2>>"$at_stderr"
+at_status=$? at_failed=false
+$at_check_filter
m4_ifdef([AT_DIFF_STDERR($4)], [m4_indir([AT_DIFF_STDERR($4)])],
- [echo >>"$at_stderr"; AS_ECHO(["m4_ifval([$7],[AS_ESCAPE([$4])],[$4])"]) | \
+ [echo >>"$at_stderr"; AS_ECHO([["$4"]]) | \
$at_diff - "$at_stderr" || at_failed=:])
m4_ifdef([AT_DIFF_STDOUT($3)], [m4_indir([AT_DIFF_STDOUT($3)])],
- [echo >>"$at_stdout"; AS_ECHO(["m4_ifval([$7],[AS_ESCAPE([$3])],[$3])"]) | \
+ [echo >>"$at_stdout"; AS_ECHO([["$3"]]) | \
$at_diff - "$at_stdout" || at_failed=:])
m4_if([$2], [ignore], [at_fn_check_skip],
[at_fn_check_status m4_default([$2], [0])]) $at_status "$at_srcdir/AT_LINE"
-AS_IF($at_failed, [$5], [$6])
-$at_failed && at_fn_log_failure AT_capture_files
+m4_ifvaln([$5$6], [AS_IF($at_failed, [$5], [$6])])]dnl
+[$at_failed && at_fn_log_failure AT_capture_files
$at_traceon; }
])# _AT_CHECK