From 09a78b8e8d348d62681278705447c19070cbd6b1 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 28 Feb 2007 17:36:00 +0000 Subject: [PATCH] Use new $node->next()/address() to correctly skip tests. --- lib/ZOOM/IRSpy.pm | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 824c6e3..b3c0aeb 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.71 2007-02-27 14:51:10 mike Exp $ +# $Id: IRSpy.pm,v 1.72 2007-02-28 17:36:00 mike Exp $ package ZOOM::IRSpy; @@ -349,6 +349,7 @@ sub check { $tname = "Main" if !defined $tname; $this->{tree} = $this->_gather_tests($tname) or die "No tests defined for '$tname'"; + $this->{tree}->resolve(); #$this->{tree}->print(0); my $nskipped = 0; @@ -477,12 +478,22 @@ sub check { $conn->next_task(0); if ($res == ZOOM::IRSpy::Status::TEST_BAD) { my $address = $conn->option('current_test_address'); - ($address, my $n) = $this->_last_sibling_test($address); - if (defined $address) { - $conn->log("irspy_test", "skipped $n tests"); - $conn->option(current_test_address => $address); - $nskipped += $n; + $conn->log("irspy", "top-level test failed!") + if $address eq ""; + my $node = $this->{tree}->select($address); + my $skipcount = 0; + while (defined $node->next() && + length($node->next()->address()) >= length($address)) { + $conn->log("irspy_debug", "skipping from '", + $node->address(), "' to '", + $node->next()->address(), "'"); + $node = $node->next(); + $skipcount++; } + + $conn->option(current_test_address => $node->address()); + $conn->log("irspy_test", "skipped $skipcount tests"); + $nskipped += $skipcount; } } elsif ($res == ZOOM::IRSpy::Status::TEST_SKIPPED) { -- 1.7.10.4