1042 |
# This may cause spurious failures when the test suite is run with `-x'. |
# This may cause spurious failures when the test suite is run with `-x'. |
1043 |
# |
# |
1044 |
m4_define([AT_CHECK], |
m4_define([AT_CHECK], |
1045 |
[AT_CHECK_NOESCAPE([$1],[$2],AS_ESCAPE([$3]),AS_ESCAPE([$4]),[$5],[$6])]) |
[_AT_CHECK([$1],[$2],[$3],[$4],[$5],[$6],1)]) |
|
|
|
|
|
|
1046 |
|
|
1047 |
# AT_CHECK_NOESCAPE(COMMANDS, [STATUS = 0], STDOUT, STDERR, |
# AT_CHECK_NOESCAPE(COMMANDS, [STATUS = 0], STDOUT, STDERR, |
1048 |
# [RUN-IF-FAIL], [RUN-IF-PASS]) |
# [RUN-IF-FAIL], [RUN-IF-PASS]) |
1049 |
# --------------------------------------------------------- |
# --------------------------------------------------------- |
1050 |
# Like AT_CHECK, but do not AS_ESCAPE shell metacharacters in the STDOUT |
# Like AT_CHECK, but do not AS_ESCAPE shell metacharacters in the STDOUT |
1051 |
# and STDERR arguments before running the comparison. |
# and STDERR arguments before running the comparison. |
1052 |
|
m4_define([AT_CHECK_NOESCAPE], |
1053 |
|
[_AT_CHECK([$1],[$2],[$3],[$4],[$5],[$6])]) |
1054 |
|
|
1055 |
|
|
1056 |
|
|
1057 |
|
# _AT_CHECK(COMMANDS, [STATUS = 0], STDOUT, STDERR, |
1058 |
|
# [RUN-IF-FAIL], [RUN-IF-PASS], SHELL_ESCAPE_IO) |
1059 |
|
# --------------------------------------------------------- |
1060 |
|
# Worker for AT_CHECK & AT_CHECK_NOESCAPE. The final SHELL-ESCAPE-IO |
1061 |
|
# argument determines whether the STDOUT & STDERR arguments will be escaped or |
1062 |
|
# not. |
1063 |
# |
# |
1064 |
# |
# |
1065 |
# Implementation Details |
# Implementation Details |
1084 |
# |
# |
1085 |
# ( $at_traceon; $1 ) >at-stdout 2>at-stder1 |
# ( $at_traceon; $1 ) >at-stdout 2>at-stder1 |
1086 |
# |
# |
1087 |
m4_define([AT_CHECK_NOESCAPE], |
m4_define([_AT_CHECK], |
1088 |
[$at_traceoff |
[$at_traceoff |
1089 |
echo "AT_LINE: AS_ESCAPE([$1])" |
echo "AT_LINE: AS_ESCAPE([$1])" |
1090 |
echo AT_LINE >$at_check_line_file |
echo AT_LINE >$at_check_line_file |
1099 |
ignore, [echo stderr:; cat $at_stderr], |
ignore, [echo stderr:; cat $at_stderr], |
1100 |
experr, [$at_diff experr $at_stderr || at_failed=:], |
experr, [$at_diff experr $at_stderr || at_failed=:], |
1101 |
[], [$at_diff $at_devnull $at_stderr || at_failed=:], |
[], [$at_diff $at_devnull $at_stderr || at_failed=:], |
1102 |
[echo >>$at_stderr; echo "$4" | $at_diff - $at_stderr || at_failed=:]) |
[echo >>$at_stderr; echo "m4_ifval([$7],[AS_ESCAPE([$4])],[$4])" | $at_diff - $at_stderr || at_failed=:]) |
1103 |
dnl Check stdout. |
dnl Check stdout. |
1104 |
m4_case([$3], |
m4_case([$3], |
1105 |
stdout, [echo stdout:; tee stdout <$at_stdout], |
stdout, [echo stdout:; tee stdout <$at_stdout], |
1106 |
ignore, [echo stdout:; cat $at_stdout], |
ignore, [echo stdout:; cat $at_stdout], |
1107 |
expout, [$at_diff expout $at_stdout || at_failed=:], |
expout, [$at_diff expout $at_stdout || at_failed=:], |
1108 |
[], [$at_diff $at_devnull $at_stdout || at_failed=:], |
[], [$at_diff $at_devnull $at_stdout || at_failed=:], |
1109 |
[echo >>$at_stdout; echo "$3" | $at_diff - $at_stdout || at_failed=:]) |
[echo >>$at_stdout; echo "m4_ifval([$7],[AS_ESCAPE([$3])],[$3])" | $at_diff - $at_stdout || at_failed=:]) |
1110 |
dnl Check exit val. Don't `skip' if we are precisely checking $? = 77. |
dnl Check exit val. Don't `skip' if we are precisely checking $? = 77. |
1111 |
case $at_status in |
case $at_status in |
1112 |
m4_case([$2], |
m4_case([$2], |