#696906 libdevel-cover-perl: misreports conditional coverage

Package:
libdevel-cover-perl
Source:
libdevel-cover-perl
Description:
Perl tool for determining code coverage metrics
Submitter:
Russ Allbery
Date:
2026-07-20 17:35:01 UTC
Severity:
wishlist
Tags:
#696906#5
Date:
2012-12-29 01:20:55 UTC
From:
To:
Devel::Cover (called via Test::Strict, although I don't believe that
would matter) misreports coverage of conditionals for one of my Perl
modules.  It reports conditional coverage of 70.5%, but when looking
at the HTML report, all conditionals are listed as covered (green).
There's apparently some phantom conditional affecting the stats but
not reflected in the report.

Steps to reproduce:

1. Install libtest-strict-perl.
2. git clone git://git.eyrie.org/perl/ansicolor.git && cd ansicolor
3. perl Makefile.PL
4. make
5. env RRA_MAINTAINER_TESTS=1 prove -b t/strict.t

Now, look at cover_db/coverage.html.  You'll see in the table that
conditional coverage is only 70.5% and is marked red.  However, if
you click on the percentage to go to the detailed breakdown, you'll
see that all conditionals are 100% covered.

#696906#10
Date:
2012-12-29 01:34:26 UTC
From:
To:
Russ Allbery <rra@debian.org> writes:

I found it.  The phantom conditionals were in subs generated via eval
inside AUTOLOAD.  So the summary is correct; the only problem is with the
reporting, which doesn't know how to handle eval-generated subs.  Some of
the reporting sort of works, when I look at the main summary for the file,
but apparently the conditional coverage doesn't.