On Fri, Oct 03, 2003 at 10:44:24AM -0700, Ovid wrote:

> Hi all,
> 
> I was running some test code with Devel::Cover and I've had no problem
> using it or generating pretty reports that make coworkers "ooh" and
> "ahh".  Unfortunately, I started running my test suite on a different
> set of tests and started getting some strange errors (formatted for
> clarity):
> 
>   Devel::Cover: Can't find file "blib/lib/Text/CSV.pm": ignored.
>   Can't locate object method "find_cv" via package "B::SPECIAL" 
>     (perhaps you forgot to load "B::SPECIAL"?) at 
>     /usr/local/stow/ASperl-5.6.1-629/lib/5.6.1/i686-linux/B.pm line 213.
> 
> To narrow down the problem, I tried running this on a smaller set of
> tests, only to get the above output, but with the following line
> prepended:
> 
>   Devel::Cover: Can't find file "blib/lib/Storable.pm": ignored.
> 
> I'm not sure how running fewer tests is generating more errors, but in
> digging through Devel::Cover, I can't even find a reference to
> Text::CSV

The message here is trying to say that Devel::Cover is wanting to
provide coverage information about Text::CSV and Storable, but is unable
to locate these modules.  That it is looking in blib/lib would suggest
when you ran the test perl picked up those modules from a blib
directory.  That seems a little strange to me, but I'm sure you have
your reasons.

It is likely that when this message is given you are in a different
directory and since the path is relative the module cannot be found.

Do you actually want coverage on these modules?  Normally you would not,
unless you were running their own test suites.  If you do not want the
coverage information you can simply ignore the warning, or better, use
-ignore +-inc and -select to narrow down the list of modules for which
you want coverage information.  This has the bonus of speeding up
runtime by not collecting data you don't want.

>            nor has digging through B.pm shed any light (though I may
> require therapy now).

The find_cv error is a real bug.  It will be caused either my me using
the core B modules incorrectly (not handling the op tree correctly), or
by me using B::Deparse in a way it was not expecting.

> Googling has also been fruitless for me.
> 
> Has anyone seen any errors like this before and can you give me some
> guidance on what I can do to alleviate them?  I'm trying to create a
> small test case, but this has been pesky to narrow down.  In the
> meantime, I'm going to try to add signal handlers to dump stack traces
> and maybe even symlink a 'blib/lib' to the appropriate libraries (what
> a nasty hack!).

Right.  I don't think the blib problem is related to the find_cv one, so
either ignore it or deal with it as I mentioned above.  If you are able
to narrow the bug down at all I'd be very grateful for a test case.  And
a patch if you fancy.  Otherwise I'm slowly working through CPAN modules
using cpancover and trying to fix bugs like this as I go.  CPAN is my
test suite ;-)

If you just want to get some results from the thing, you could try
determining which of the coverage criteria is causing the problem,
though it may well be common to all the criteria.  You could also try
putting an eval around the deparse calls at the end of get_cover() in
Devel::Cover.pm, though this will likely reduce the reported coverage
where the error has occurred.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to