git://git.exim.org
/
users
/
heiko
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Testsuite: Allow input lines starting with ":<cmd>:", like ":sleep:".
[users/heiko/exim.git]
/
test
/
runtest
diff --git
a/test/runtest
b/test/runtest
index 26a40471372a758c07c83d6899cfbd7f60903df9..5fb7cd737f8d29ce3d752801e75026d327ddd6fa 100755
(executable)
--- a/
test/runtest
+++ b/
test/runtest
@@
-2807,12
+2807,28
@@
print ">> |${cmd}${stderrsuffix}\n" if ($debug);
open CMD, "|${cmd}${stderrsuffix}" || tests_exit(1, "Failed to run $cmd");
CMD->autoflush(1);
open CMD, "|${cmd}${stderrsuffix}" || tests_exit(1, "Failed to run $cmd");
CMD->autoflush(1);
-while (<SCRIPT>)
+
LINE:
while (<SCRIPT>)
{
$lineno++;
last if /^\*{4}\s*$/;
do_substitute($testno);
{
$lineno++;
last if /^\*{4}\s*$/;
do_substitute($testno);
- s/^\\(>>>\s.*)/$1/ or s/^>>>\s(.*)\s*$/$1/ and $_ = eval "\"$1\"";
+ if (my ($cmd, $line) = /^(:\S+?:)(.*)/) {
+ $_ = $line;
+ {
+ $cmd eq ':eval:' and do {
+ $_ = eval "\"$_\"";
+ last;
+ };
+ $cmd eq ':noeol:' and do {
+ s/[\r\n]*$//;
+ last;
+ };
+ $cmd eq ':sleep:' and do {
+ sleep $_;
+ next LINE;
+ };
+ }
+ }
print CMD;
}
print CMD;
}