COVER(1p)

πŸ’– COVER(1p) β€” the cover girlies' manual πŸ’–

okay so bestie, welcome to the manual page for cover from the User Contributed Perl Documentation crowd. she reports coverage statistics and she ate, no cap. currently living her best life at version 1.52. ✨


🌸 NAME 🌸

cover β€” report coverage statistics. that's it, that's the vibe check. πŸ’…

πŸŽ€ VERSION πŸŽ€

version 1.52 β€” yes queen, that's the current one. πŸ‘‘

✨ SYNOPSIS ✨

cover -test

cover -report html_basic

literally two whole commands and you're off. iconic.

πŸ¦‹ DESCRIPTION πŸ¦‹

she reports coverage statistics in a variety of formats. versatility? we love to see it. πŸ’–

the summary option gives you a short textual summary β€” quick, cute, to the point. want more? the other reports are available by using the report option. yes bestie, there's a whole menu.

the following reports are currently available:

  • html β€” detailed HTML reports (default)
  • html_basic β€” detailed HTML reports with syntax highlighting
  • text β€” detailed textual summary
  • compilation β€” output in a format similar to Perl errors
  • json β€” output in a JSON format
  • vim β€” show coverage information in vim gutter

πŸ’… OPTIONS πŸ’…

the following command line options are supported, and yes i'm listing every single one because we don't gatekeep:

  • -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 ...]

also!! the -report, -select, -ignore, -select_re, -ignore_re, and -coverage options may be specified multiple times. go off, stack them. πŸ”₯


🌈 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 β€” so check your installed goodies bestie.

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

look at that gradient, it's giving traffic light but make it fashion. 🚦

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. simple. elegant. no notes. 🌸

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. handy for the editor girlies. πŸ’»

json

a report in JSON format. data girlies rise. πŸ“Š

vim

a report suitable for use with the vim editor to show coverage data in the sign column. for the terminal besties who never leave vim (respect). πŸ’š


πŸ‘‘ 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. so like, heads up.

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. the exclusion era, we love her. πŸ’…

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. that's not a slay, that's a mess, so watch out bestie. 😭

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. 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.

ok important: -test deletes your databases before running the tests. no take-backs. she's dramatic like that. πŸ’€

πŸ”₯ EXIT STATUS πŸ”₯

the following exit values are returned:

  • 0 β€” all operations were completed successfully. we love a clean exit. 🫢
  • >0 β€” an error occurred. not the vibe. 😭

with the -test option the exit status of the underlying test run is returned.


🧚 SEE ALSO 🧚

  • Devel::Cover

πŸ’œ LICENCE πŸ’œ

Copyright 2001-2026, 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


and that's the whole thing bestie πŸŽ€ this page is from User Contributed Perl Documentation, it's perl v5.42.3, and it was dated 2026-08-22. so yeah β€” go get your coverage, drink water, and remember: no cap, cover fr fr slays. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from