> Thanks a lot for the test cases.  I think there are two separate bugs
> here, but I'm only going to take responsibility for one ;-)

:)

> 
> First, mine.  The problem with Foo.pm (the minimal test case) is that
> completely empty subroutines (that is subs which contain no statements
> at all) are ignored as far as subroutine coverage is concerned.  That is
> the case for both named and anonymous subs.  The op tree for an empty
> sub didn't contain the structure I was looking for, so it wasn't
> recognised as a sub.

oh.  cool, I think :)

> 
> I have put in a fix for this, but it only works with Perl 5.8.2 and
> later versions.  I've not gone trying to get it to work with earlier
> versions, since it is pretty obscure and I prefer to keep the code
> reasonably clean.  Or maybe I'm just too lazy.  In any case, let me know
> if this is going to cause anyone problems.  I have documented it as a
> bug though, and upped the recommended version to use from 5.8.1 to 5.8.2.

for minor, obscure issues like this depending on a more recent perl seems
perfectly fine.  especially here, where there isn't any code to create
metrics for anyway.

> 
> Then the second bug.  The problem here is that if you lie to perl it
> will bite your bottom ;-)

that's the quote of the week, for sure :)

>   1.  The coverage will not be reported in the Parser.pm module.

blarg.  but at least there's a reason that makes sense :)

> 
>   2.  Devel::Cover needs to be able to find Parser.yp.  In the example
>       the filename given is Parser.yp, but the file is actually at
>       lib/My/Parser.yp and so Devel::Cover can't find it.  Changing the
>       example to give the full filename, 

you mean changing the #line directive?


>       or putting in a link from the
>       current directory fixes the problem.  I'm not sure if this is
>       actually a problem with Parse::Yapp or just a result of the way
>       you packaged up the testcase.

well, the packaging is pretty much the way the code I'm testing is layed out
- Foo.yp in the same directory as Foo.pm, and all under some lib/ someplace.
 fairly standard I'd think.

but the symlink works - linking Foo.yp to the top-level directory, along
side cover_db.

> 
>   3.  Parse::Yapp doesn't clean up after itself by setting the line
>       number and filename back to what it actually is, which means that
>       subsequent code coverage is reported on in the grammar file even
>       though it didn't come from there, which can be somewhat
>       surprising.

hmph.

> 
> So I'm afraid there's not much I can do about this one - it will need to
> be fed to the author of Parse::Yapp and he can decide if he wants to do
> anything about it.

I suppose I could do that, but it seems kinda strange to ask him to change
stuff around just so we can have good test metrics.  but, per your
suggestion, at least there is a simple workaround - thanks for that.

> In any case, the first fix will be in the next release, 

excellent, thanks.

> and thanks again for the great test cases.

sure thing - thanks for being responsive :)

--Geoff

Reply via email to