X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy.pm;h=83d417c8184fb13aff1beaad51f1beb4b72bd094;hp=de60a7a564cfba41f9bda3eaba6e2fca575609a0;hb=1e89c4ad970cfd7a8268d9174186b65038f9b36a;hpb=1dde7c1ea1f9ca072b39feb396137336bee705b6 diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index de60a7a..83d417c 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.38 2006-10-26 17:21:35 mike Exp $ +# $Id: IRSpy.pm,v 1.40 2006-10-26 18:02:59 mike Exp $ package ZOOM::IRSpy; @@ -309,7 +309,7 @@ sub check { $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; @@ -460,11 +460,22 @@ sub _gather_tests { 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;