PERL2LCOV(1)

πŸ“¦
version 2.6 Β· 2 versions
, in arch rolling

πŸ’… PERL2LCOV(1) β€” the LCOV manual, bestie edition πŸŽ€

Okay so this is perl2lcov, straight out of the LCOV manual pages (manual group: LCOV Tools, manual section 1, iykyk). Sit down, grab a strawberry, and let me tell you about the tool that takes your Perl coverage data and makes it speak LCOV. ✨


✨ NAME ✨

perl2lcov β€” like, the perl2lcov documentation, but also the whole point: translate Perl coverage data from Devel::Cover to lcov format. Periodt. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

perl2lcov [--output filename] [--test-name name] [options] cover_db+

That's the whole vibe check right there. πŸ’–


🌸 DESCRIPTION 🌸

perl2lcov walks through the Perl coverage info sitting in one or more coverage data directories (the ones the Perl Devel::Cover module generates, bestie) and translates all of it into the LCOV .info format. That's it, that's the job, and it slays at it. πŸ”₯


πŸ’… OPTIONS πŸ’…

So on top of the common options that every other tool in the LCOV suite supports (think --comment, --version-script, --ignore-error, --substitute, --exclude, etc.), here are the tool's very own options:

  • --output filename, -o filename β€” your LCOV data gets written to whatever file you name here. Don't use this option? Then it goes to perlcov.info in the current directory. That's the default, no cap. πŸ’Ύ
  • --test-name name β€” the coverage info gets associated with the testcase name you hand over. And ngl, you don't actually have to provide a name. It's optional, she's flexible. πŸŽ€

Also, go peep lcov(1) <file://../man/lcov.1.html> and lcovrc(5) <file://../man/lcovrc.5.html> for the deets on all the other supported options and configuration settings. They're iconic, trust. πŸ‘‘


🌈 EXAMPLES 🌈

Generate Perl coverage data and translate it to LCOV format β€” the full main character arc:

# Write Perl line, branch, condition, and subroutine coverage data
# to 'myPerlDB' in the current directory
$ perl -MDevel::Cover=-db,./myPerlDB,-coverage,statement,branch,condition,subroutine,-silent,1 myScript.pl

# OR: write all coverage types that Perl knows about to 'myPerlDB2'
# Note that perl2lcov will ignore types it does not understand
# (pod, time, and path)
$ perl -MDevel::Cover=-db,./myPerlDB2,-silent,1 myScript.pl

# Run 'cover' from the Devel::Cover installation to extract runtime
# data into a usable form. This will also generate an HTML report
# in 'myCoverDB'
$ cover myCoverDB -silent 1

# Run perl2lcov translator to produce LCOV format data:
$ perl2lcov -o perldata.info [--test-name myTestName] myCoverDB

# Generate an HTML coverage report:
$ genhtml -o html_report perldata.info

Obsessed with this workflow, honestly. 🧚


πŸ’€ NOTES πŸ’€

Real talk: the data Devel::Cover generates is not always internally consistent. Like, it's giving chaos sometimes. For example:

  • Some functions that are never called just... don't appear in the coverage data at all. Ghosted. πŸ‘»
  • Sometimes a line will look like it was executed (non-zero hit count) but none of its contained branch expressions were ever evaluated. Which is weird because β€” if the line was executed, then at least one branch condition must have been evaluated. Make it make sense. 😭

This can cause the various tools in the LCOV package to throw errors of type inconsistent.

When that happens, you have options, bestie:

  • Skip consistency checks entirely β€” see the skip_consistency_checks section in lcovrc(5) <file://../man/lcovrc.5.html>.
  • Ignore the error β€” see the --ignore-error section in genhtml(1) <file://../man/genhtml.1.html>.
  • Exclude the offending code β€” see the --exclude, --filter, and --omit-lines sections in genhtml(1) <file://../man/genhtml.1.html>.
Pick your fighter, honestly. All three are valid. πŸ’…

🫢 AUTHOR 🫢

Henry Cox <<henry.cox@mediatek.com>> β€” thank you for your service, king. πŸ‘‘


⭐ SEE ALSO ⭐

And also:

  • Devel::Cover module documentation

<https://metacpan.org/pod/Devel::Cover>


2024-2026, LCOV Project


That's the whole page, bestie! πŸ’œ Cute little sign-off for you: this was version 2.6, dated 2026-10-03, and yes, it's still PERL2LCOV(1) at the end of the day. Go forth and make that perlcov.info file, you absolute icon. 🌸✨

πŸ“¦ where this page comes from