[Perlunit-devel] compile errors and Loader
Status: Beta
Brought to you by:
mca1001
|
From: Adam S. <ad...@sp...> - 2001-11-15 17:44:38
|
Test::Unit::Loader is doing all the work of compiling in suites and
cases etc., and mostly works very nicely. However, the load() method
has an oddity:
} elsif ($@ !~ /^Can\'t locate .* in \@INC \(\@INC contains/) {
die $@;
} else {
print "Debug: ".$@ if DEBUG;
}
which means that if your test case tries to use another module
unsuccessfully (e.g. if the module name has a typo), then it falls
through the above block without doing anything (except outputting some
debugging if DEBUG is on). That means the user sees:
>> Tests::GGconfig
(This error is expected) Suite class Tests::GGconfig not found: Can't
locate GGconfg.pm in @INC (@INC contains: .....
which is misleading. Changing that code to
} else {
die $@;
}
yields:
>> Tests::GGconfig
Can't locate GGconfg.pm in @INC (@INC contains: .....
which is exactly what the user needs to see. What was the reasoning
behind hiding those "Can't locate" errors?
|