X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy.pm;h=83d417c8184fb13aff1beaad51f1beb4b72bd094;hp=8160dd65dd8d813f4b6cea5324830be419e84c59;hb=2d9c2ad92984b793c0088c0138dfc7c72735f862;hpb=4ce8a6de47b49d36c8da1bdfbbd27f9f5373b1c6 diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 8160dd6..83d417c 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.39 2006-10-26 17:46:41 mike Exp $ +# $Id: IRSpy.pm,v 1.40 2006-10-26 18:02:59 mike Exp $ package ZOOM::IRSpy; @@ -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;