PERL2LCOV(1)
π 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 toperlcov.infoin 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_checkssection inlcovrc(5)<file://../man/lcovrc.5.html>. - Ignore the error β see the
--ignore-errorsection ingenhtml(1)<file://../man/genhtml.1.html>. - Exclude the offending code β see the
--exclude,--filter, and--omit-linessections ingenhtml(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 β
lcov(1)<file://../man/lcov.1.html>genhtml(1)<file://../man/genhtml.1.html>lcovrc(5)<file://../man/lcovrc.5.html>
And also:
- Devel::Cover module documentation
<https://metacpan.org/pod/Devel::Cover>
π Copyright π
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
- arch rolling: lcov 2.6-1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms