X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=tests%2Ftest-driver.pl;h=8ba77a280cad873a0c4a557619421fa4e0af9a4e;hb=0c7218df03ccb43d5e594e69eb03c250330283b5;hp=e20745cda33a58400bc513a0a7171c10c7cfd1a3;hpb=5e1a5f7f6091e4f1eb80e9c50bc6f7e8df3a0243;p=ircu2.10.12-pk.git diff --git a/tests/test-driver.pl b/tests/test-driver.pl index e20745c..8ba77a2 100755 --- a/tests/test-driver.pl +++ b/tests/test-driver.pl @@ -164,7 +164,7 @@ sub drv_heartbeat { # expand any macros in the line $line =~ s/(?<=[^\\])%(\S+?)%/$heap->{macros}->{$1} - or die "Use of undefined macro $1 at $heap->{lineno}\n"/eg; + or die "Use of undefined macro $1 at line $heap->{lineno}\n"/eg; # remove any \-escapes $line =~ s/\\(.)/$1/g; # figure out the type of line @@ -235,7 +235,7 @@ sub drv_heartbeat { my $client = $heap->{clients}->{$c}; if (not $client) { print "ERROR: Unknown session name $c (line $heap->{lineno}; ignoring)\n"; - } elsif (($used->{$c} and not $zero_time->{$cmd}) or not $client->{ready}) { + } elsif (($used->{$c} and not $zero_time->{$cmd}) or ($cmd ne 'expect' and not $client->{ready})) { push @unavail, $c; } else { push @avail, $c; @@ -276,8 +276,8 @@ sub drv_heartbeat { } sub drv_timeout_expect { - my ($kernel, $session, $client) = @_[KERNEL, SESSION, ARG0]; - print "ERROR: Dropping timed-out expectation by $client->{name}: ".join(',', @{$client->{expect}->[0]})."\n"; + my ($kernel, $session, $client, $heap) = @_[KERNEL, SESSION, ARG0, HEAP]; + print "\nERROR: Dropping timed-out expectation by $client->{name} (line $heap->{expect_lineno}): ".join(',', @{$client->{expect}->[0]})."\n"; $client->{expect_alarms}->[0] = undef; unexpect($kernel, $session, $client); } @@ -370,6 +370,7 @@ sub cmd_wait { sub cmd_expect { my ($kernel, $session, $heap, $client, $args) = @_[KERNEL, SESSION, HEAP, ARG0, ARG1]; die "Missing argument" unless $#$args >= 0; + $heap->{expect_lineno} = $heap->{lineno}; push @{$client->{expect}}, $args; push @{$client->{expect_alarms}}, $kernel->delay_set('timeout_expect', EXPECT_TIMEOUT, $client); $kernel->call($session, 'disable_client', $client);