man > cover(1p)

COVER(1p) User Contributed Perl Documentation COVER(1p)

๐Ÿ“› NAME

cover - report coverage statistics

๐Ÿš€ Quick Reference

Use CaseCommandDescription
Run tests with coveragecover -testDrop databases and run make test to generate new coverage data
Generate HTML reportcover -report htmlCreate detailed HTML reports with color-coded percentage thresholds
Generate text summarycover -summaryOutput a short textual summary of coverage statistics
Report on specific filecover -select lib/Foo.pmOnly report coverage for a particular file (shell glob)
Ignore filescover -ignore t/*.tExclude test files from coverage report (shell glob)
Merge databasescover db1 db2 -write db3Merge multiple coverage databases and write merged result
Delete databasescover -deleteDrop all coverage databases

๐Ÿ“Œ VERSION

version 1.36

๐Ÿ“‹ SYNOPSIS

cover -test

cover -report html_basic

๐Ÿ“– DESCRIPTION

Report coverage statistics in a variety of formats.

The summary option produces a short textual summary. Other reports are available by using the report option.

The following reports are currently available:

โš™๏ธ OPTIONS

The following command line options are supported:

The -report, -select, -ignore, -select_re, -ignore_re, and -coverage options may be specified multiple times.

๐Ÿ“Š REPORT FORMATS

The following -report options are available in the core module. Other reports may be available if they've been installed from external packages.

๐Ÿ“„ html|html_minimal (default)

HTML reporting. Percentage thresholds are colour-coded and configurable via -report_c0 <integer>, -report_c1 <integer> and -report_c2 <integer>:

0%      75%      90%      100%
|   ..   |   ..   |   ..   |
   <c0      <c1      <c2   c3
   red     yellow   orange green

๐Ÿ“„ html_basic

HTML reporting with syntax highlighting if PPI::HTML or Perl::Tidy module is detected. Like html|html_minimal reporting, percentage thresholds are colour-coded and configurable.

๐Ÿ“„ text

Plain text reporting.

๐Ÿ“„ compilation

A textual report in a format similar to that output by Perl itself such that the report may be used by your editor or other reporting tools to show where coverage is missing.

๐Ÿ“„ json

A report in JSON format.

๐Ÿ“„ vim

A report suitable for use with the vim editor to show coverage data in the sign column.

๐Ÿ” DETAILS

Any number of coverage databases may be specified on the command line. These databases will be merged and the reports will be based on the merged information. If no databases are specified the default database (cover_db) will be used.

The -write option will write out the merged database. If no name is given for the new database, the first database read in will be overwritten. When this option is used no reports are generated by default.

Specify the -select, -select_re, -ignore, and -ignore_re options to report on specific files. -select and -ignore are interpreted as shell globs; -select_re and -ignore_re are interpreted as regular expressions.

Specify -coverage options to report on specific criteria. By default all available information on all criteria in all files will be reported. Available coverage options are statement, branch, condition, subroutine, pod, and default (which equates to all available options). However, if you know you only want coverage information for certain criteria it is better to only collect data for those criteria in the first place by specifying them at that point. This will make the data collection and reporting processes faster and less memory intensive. See the documentation for Devel::Cover for more information.

If you want all except some criteria, then you can say something like -coverage default,-pod.

If you specify multiple -report options, make sure that they do not conflict. For example, the different HTML reports will overwrite each other's results.

The -test option will delete the databases and run your tests to generate new coverage data before reporting on it. Devel::Cover knows how to work with standard Perl Makefiles as well as Module::Build based distributions. For detailed instructions see the documentation for ExtUtils::MakeMaker at <https://metacpan.org/module/ExtUtils::MakeMaker> or for Module::Build at <https://metacpan.org/module/Module::Build> both of which come as standard in recent Perl distributions.

The -gcov option will try to run gcov on any XS code. This requires that you are using gcc of course. If you are using the -test option will be turned on by default.

The -prefer_lib option tells Devel::Cover to report on files in the lib directory even if they were used from the blib directory.

๐Ÿšช EXIT STATUS

The following exit values are returned:

๐Ÿ“š SEE ALSO

Devel::Cover

๐Ÿ› BUGS

Did I mention that this is alpha code?

See the BUGS file.

๐Ÿ“„ LICENCE

Copyright 2001-2019, Paul Johnson (paul AT pjcj.net)

This software is free. It is licensed under the same terms as Perl itself.

The latest version of this software should be available from my homepage: http://www.pjcj.net

perl v5.34.0 2022-02-06 COVER(1p)

cover(1p)
๐Ÿ“› NAME ๐Ÿš€ Quick Reference ๐Ÿ“Œ VERSION ๐Ÿ“‹ SYNOPSIS ๐Ÿ“– DESCRIPTION โš™๏ธ OPTIONS ๐Ÿ“Š REPORT FORMATS
๐Ÿ“„ html|html_minimal (default) ๐Ÿ“„ html_basic ๐Ÿ“„ text ๐Ÿ“„ compilation ๐Ÿ“„ json ๐Ÿ“„ vim
๐Ÿ” DETAILS ๐Ÿšช EXIT STATUS ๐Ÿ“š SEE ALSO ๐Ÿ› BUGS ๐Ÿ“„ LICENCE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-04 09:43 @216.73.217.103
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^