COVER(1)
π NAME π
cover β report coverage statistics. Okay bestie, this is the COVER(1) manual and it's all about coverage reporting. Slay. π
π VERSION π
This page is version 1.50, periodt. π
π§ 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:
htmlβ detailed HTML reports (default)html_basicβ detailed HTML reports with syntax highlightingtextβ detailed textual summarycompilationβ output in a format similar to Perl errorsjsonβ output in a JSON formatvimβ show coverage information in vim gutter
π OPTIONS π
The following command line options are supported, bestie:
-h,-helpβ show help-i,-infoβ show documentation-v,-versionβ show version-silentβ don't print informational messages (default off)-summaryβ give summary report (default on)-report report_formatβ report format (default html)-outputdir dirβ directory for output (default given db)-launchβ launch report in viewer (if avail) (default off)-select filenameβ only report on the file (default all)-ignore filenameβ don't report on the file (default none)-select_re REβ append to REs of files to select (default none)-ignore_re REβ append to REs of files to ignore (default none)-relative_onlyβ for XS, ignore absolute paths (default off)-gcov_chdirβ for XS, run gcov in subdirs (default off)-write [db]β write the merged database (default off)-deleteβ drop database(s) (default off)-dump_dbβ dump database(s) (for debugging) (default off)-coverage criterionβ report on criterion (default all available)-testβ drop database(s) and run make test (default off)-gcovβ run gcov to cover XS code (default on if using gcc)-make make_progβ use the given 'make' program for 'make test'-prefer_libβ prefer files in lib (default off)-ignore_covered_errβ allow covering uncoverable code (default off)-add_uncoverable_point string-delete_uncoverable_point string-clean_uncoverable_points-uncoverable_file file- other options specific to the report format
coverage_database [coverage_database ...]
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>. Here's the little threshold map, no cap:
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.
β οΈ Do not play yourself with conflicting report formats, bestie. The HTML reports will absolutely 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. The page literally says: βIf you are using the -test option will be turned on by default.β π If you have XS code in subdirectories, you will probably need to add the -gcov_chdir option since gcov seems to work better with that.
The -prefer_lib option tells Devel::Cover to report on files in the lib directory even if they were used from the blib directory.
The -ignore_covered_err option will not flag an error if uncoverable code is covered.
β EXIT STATUS β
The following exit values are returned:
0β All operations were completed successfully.>0β An error occurred.
With the -test option the exit status of the underlying test run is returned.
π¦ SEE ALSO π¦
Devel::Cover
π BUGS π
Did I mention that this is alpha code? See the BUGS file. π
π LICENCE π
Copyright 2001-2025, Paul Johnson (paul@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: https://pjcj.net
Later, bestie β this COVER(1) page comes from perl v5.42.0 and is dated 2025-06-11. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Devel-Cover 1.500.0-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms