On Fri, Aug 26, 2011 at 12:37:57PM -0400, John Scaglione wrote:
>  I've run my suite of unit tests with Devel::Cover turned on. I've created a
> coverage report. There are over a hundred modules in the report. The totals
> row lists the following:
> 
> Total    12.5    2.6    2.2    32.7    2.1    100.0    10.5
> 
>  Now, I want to see what the coverage is for the 3 modules named Foo.pm (in
> MVC architecture). I run:
> 
> cover -select_re Foo\.pm
> 
> The coverage report looks like this:
> 
> file    stmt    bran    cond    sub    pod    time    total
> lib/C/Foo.pm    19.1    0.0    0.0    50.0    0.0    0.0    13.3
> lib/M/Foo.pm    6.4    0.0    0.0    11.5    0.0    0.0    5.2
> lib/V/Foo.pm    31.6    n/a    n/a    50.0    0.0    0.0    32.0
> Total    12.5    2.6    2.2    32.7    2.1    100.0    10.5
> 
>  The total row is the total for the entire codebase. I would like the total
> row to be the percentage of code lines covered in the 3 modules selected
> with the regex.
> 
> I am using Devel::Cover 0.73

That's a little old now, but I don't think you'll find any difference in the
latest version.  This is a bug.  It's not trivial to fix, being based on an
early incorrect design decision, and it has not made it to the top of my list
yet.  Or anyone else's, it would seem.

> This too does not work, but gives the total for all files touched by
> testing:
> 
> HARNESS_PERL_SWITCHES=-MDevel::Cover=-db,testcover_db,-select,Foo
> /usr/local/bin/prove t/unit

Hmmm.  I would have expected this to have provided the resuults you wanted.
Do you have a minimal example you can send?

> Any ideas on how to accomplish this? Can I provide any more information?
> Thanks in advance for any help.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

Reply via email to