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