Subject: | blib.pm != testing |
clkao pointed out this code in Module::Pluggable::Object.
# check to see if we're running under test
my @SEARCHDIR = exists $INC{"blib.pm"} && $filename =~
m!(^|/)blib/! ? grep {/blib/} @INC : @INC;
I'm not sure what the above is for or why its there but it doesn't
really do what the comment says. MakeMaker doesn't use blib.pm. clkao
reports the above code causes problems when he uses -Mblib or Devel::Cover.
More importantly, testing code shouldn't be in the production code. It
should be in the tests. Not coincidentally the best way to determine if
you're running under test is to be part of the test suite. :)
If that's not possible (and it looks like it might be a bit tricky),
just have your tests set their own PERL_MODULE_PLUGGABLE_TESTING env
flag and look for that. Assuming the purpose of that code is to
determine you're running your own tests, not someone else's.