• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bin/H19-May-2020-1,267713

docs/H19-May-2020-320247

lib/Devel/H03-May-2022-12,7257,519

t/H03-May-2022-352262

test_output/cover/H03-May-2022-9,5467,996

tests/H19-May-2020-2,8651,470

utils/H19-May-2020-970729

.autoenv.zshH A D19-May-202069 54

.gitignoreH A D19-May-2020327 4036

.travis.ymlH A D19-May-2020775 3938

ChangesH A D19-May-202034.5 KiB927790

ContributorsH A D19-May-20206.2 KiB134129

Cover.xsH A D19-May-202041.7 KiB1,6121,213

LICENCEH A D19-May-202017.9 KiB380292

MANIFESTH A D19-May-20206.8 KiB272271

MANIFEST.SKIPH A D19-May-2020259 3130

META.jsonH A D19-May-202019.3 KiB637635

META.ymlH A D19-May-202012.6 KiB470469

Makefile.PLH A D19-May-202014.6 KiB457347

README.mdH A D19-May-20203.1 KiB7956

dist.iniH A D19-May-20203.4 KiB9989

README.md

1# Devel::Cover
2
3## Code coverage metrics for Perl
4
5This module provides code coverage metrics for Perl.  Code coverage metrics
6describe how thoroughly tests exercise code.  By using Devel::Cover you can
7discover areas of code not exercised by your tests and determine which tests to
8create to increase coverage.  Code coverage can be considered an indirect
9measure of quality.
10
11Although it is still being developed, Devel::Cover is now quite stable and
12provides many of the features to be expected in a useful coverage tool.
13
14Statement, branch, condition, subroutine, and pod coverage information is
15reported.  Statement and subroutine coverage data should be accurate.  Branch
16and condition coverage data should be mostly accurate too, although not always
17what one might initially expect.  Pod coverage comes from Pod::Coverage.  If
18Pod::Coverage::CountParents is available it will be used instead.  Coverage
19data for other criteria are not yet collected.
20
21The cover program can be used to generate coverage reports.  Devel::Cover ships
22with a number of reports including various types of HTML output, textual
23reports, a report to display missing coverage in the same format as compilation
24errors and a report to display coverage information within the Vim editor.
25
26It is possible to add annotations to reports, for example you can add a column
27to an HTML report showing who last changed a line, as determined by git blame.
28Some annotation modules are shipped with Devel::Cover and you can easily create
29your own.
30
31The gcov2perl program can be used to convert gcov files to "Devel::Cover"
32databases.  This allows you to display your C or XS code coverage together with
33your Perl coverage, or to use any of the Devel::Cover reports to display your C
34coverage data.
35
36Code coverage data are collected by replacing perl ops with functions which
37count how many times the ops are executed.  These data are then mapped back to
38reality using the B compiler modules.  There is also a statement profiling
39facility which should not be relied on.  For proper profiling use
40Devel::NYTProf.  Previous versions of Devel::Cover collected coverage data by
41replacing perl's runops function.  It is still possible to switch to that mode
42of operation, but this now gets little testing and will probably be removed
43soon.  You probably don't care about any of this.
44
45The most appropriate mailing list on which to discuss this module would be
46perl-qa.  See <http://lists.perl.org/list/perl-qa.html>.
47
48The Devel::Cover repository can be found at
49<http://github.com/pjcj/Devel--Cover>.  This is also where problems should be
50reported.
51
52To get coverage for an uninstalled module:
53
54    cover -test
55
56or
57
58    cover -delete
59    HARNESS_PERL_SWITCHES=-MDevel::Cover make test
60    cover
61
62To get coverage for an uninstalled module which uses Module::Build (0.26 or
63later):
64
65    ./Build testcover
66
67If the module does not use the t/*.t framework:
68
69    PERL5OPT=-MDevel::Cover make test
70
71If you want to get coverage for a program:
72
73    perl -MDevel::Cover yourprog args
74    cover
75
76To alter default values:
77
78    perl -MDevel::Cover=-db,cover_db,-coverage,statement,time yourprog args
79