-# $Id: IRSpy.pm,v 1.38 2006-10-26 17:21:35 mike Exp $
+# $Id: IRSpy.pm,v 1.41 2006-10-27 00:45:12 mike Exp $
package ZOOM::IRSpy;
$tname = "Main" if !defined $tname;
$this->{tree} = $this->_gather_tests($tname)
- or die "No tests defined";
+ or die "No tests defined for '$tname'";
#$this->{tree}->print(0);
my $nskipped = 0;
join(" -> ", @ancestors, $tname))
if grep { $_ eq $tname } @ancestors;
+ my $slashSeperatedTname = $tname;
+ $slashSeperatedTname =~ s/::/\//g;
+ my $fullName = "ZOOM/IRSpy/Test/$slashSeperatedTname.pm";
+
eval {
- my $slashSeperatedTname = $tname;
- $slashSeperatedTname =~ s/::/\//g;
- require "ZOOM/IRSpy/Test/$slashSeperatedTname.pm";
+ ### This next line shouldn't be necessary, as we should
+ # already be running in an environment where the test
+ # modules are available -- otherwise, how did _this_ module
+ # get loaded? But it seems that for reasons I don't
+ # understand we do sometimes (not always!) need this when
+ # running under Apache.
+ use lib '/usr/local/src/cvs/irspy/lib';
+ require $fullName;
+ $this->log("irspy", "successfully required '$fullName'");
}; if ($@) {
+ $this->log("irspy", "couldn't require '$fullName': $@");
$this->log("warn", "can't load test '$tname': skipping",
$@ =~ /^Can.t locate/ ? () : " ($@)");
return undef;
my $root = $doc->getDocumentElement();
my $xc = XML::LibXML::XPathContext->new($root);
$xc->registerNs(e => 'http://explain.z3950.org/dtd/2.0/');
+ $xc->registerNs(i => $irspy_ns);
return $xc;
}