-# $Id: IRSpy.pm,v 1.69 2007-02-26 14:49:23 mike Exp $
+# $Id: IRSpy.pm,v 1.72 2007-02-28 17:36:00 mike Exp $
package ZOOM::IRSpy;
$this->log("irspy_debug", "query '", $this->{query}, "'");
my $rs = $this->{conn}->search(new ZOOM::Query::CQL($this->{query}));
+ $this->log("irspy", "'", $this->{query}, "' found ",
+ $rs->size(), " target records");
delete $this->{query}; # No longer needed at all
- $this->log("irspy_debug", "found ", $rs->size(), " target records");
my $gatherTargets = !$this->{targets};
foreach my $i (1 .. $rs->size()) {
my $target = _render_record($rs, $i-1, "id");
if ($save_xml) {
unlink('/tmp/irspy_orig.xml');
- open FH, '>/tmp/irspy_orig.xml';
+ open FH, '>/tmp/irspy_orig.xml'
+ or die "can't write irspy_orig.xml: $!";
print FH $irspy_doc->toString();
close FH;
}
my $result = $this->{irspy_to_zeerex_style}->transform($irspy_doc, %params);
if ($save_xml) {
unlink('/tmp/irspy_transformed.xml');
- open FH, '>/tmp/irspy_transformed.xml';
+ open FH, '>/tmp/irspy_transformed.xml'
+ or die "can't write irspy_transformed.xml: $!";
print FH $result->toString();
close FH;
}
$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;
$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) {