summaryrefslogtreecommitdiff
path: root/test/runtest
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2020-10-05 08:59:25 +0200
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2020-10-05 10:34:45 +0200
commitd0de84b2d250e2f066286db3a3f5400a0f931b67 (patch)
treecf6fa33a6feac7cd60166010d1ab64af8b8e6419 /test/runtest
parent78fb059f567b933e3e8c1898f6f51b1e6c3b5396 (diff)
Testsuite: Allow input lines starting with ":<cmd>:", like ":sleep:".
This somehow mimics the behaviour of the client tool, but works for *any* input line that is sent to the application. This reverts the unfortunate take abusing the client's special notation '>>> '. Currently implemented: - :eval: - :neol: - :sleep:
Diffstat (limited to 'test/runtest')
-rwxr-xr-xtest/runtest20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/runtest b/test/runtest
index 26a404713..5fb7cd737 100755
--- 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);
-while (<SCRIPT>)
+LINE: while (<SCRIPT>)
{
$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;
}