GCOV2PERL(1)

πŸ’… GCOV2PERL(1) β€” the glow-up

okay so this is gcov2perl, and it lives in the "User Contributed Perl Documentation" section of your manpages (iykyk, that's where all the good stuff hides) ✨

πŸŽ€ NAME

gcov2perl β€” bestie, it converts gcov files into Devel::Cover databases. that's literally the whole job and it does it slayfully πŸ’–

🌸 VERSION

version 1.50 β€” she's serving 1.50, no cap 🫢

⭐ SYNOPSIS

 gcov2perl -h -i -v -db database gcov_files

πŸ¦‹ DESCRIPTION

Convert gcov files to Devel::Cover databases. that's it, that's the vibe 🌈

✨ OPTIONS ✨

here's every flag she supports, and yes you need to know all of them, don't skip πŸ‘‘

  • -db database β€” picks which database you're gonna use, like choosing your main character database πŸ’…
  • -h, -help β€” shows you the help, a little "hey bestie here's what I do" 🫢
  • -i, -info β€” shows the documentation, aka the full lore drop πŸ“–
  • -v, -version β€” shows the version, for when you gotta know exactly which girl you're dealing with ⭐

πŸ”₯ DETAILS

okay so here's the tea on getting coverage out of XS files β€” you literally cannot skip the first step, they have to be compiled with the right options first, periodt πŸ™ˆ

in a standard Makefile environment, like the one ExtUtils::MakeMaker creates, you can pull this off with:

 HARNESS_PERL_SWITCHES=-MDevel::Cover make test \
   CCFLAGS=-O0\ -fprofile-arcs\ -ftest-coverage \
   OTHERLDFLAGS=-fprofile-arcs\ -ftest-coverage
ngl if you've already built your object files, it might be necessary to run make clean first 🧹 β€” or find some other way to make sure they actually get rebuilt with the options gcov requires. no shortcuts bestie 😭

so now the code coverage data has been collected, and that means gcov needs to be run:

 gcov Mylib.xs

this will create one or more gcov files, and those are exactly what you run gcov2perl on:

 gcov2perl Mylib.xs.gcov

and finally, cover should be run as usual with whatever options you need:

 cover

and if you're running everything with standard options, you can do all of this with one single command, iconic behavior honestly πŸ‘‘

 cover -test

πŸ’€ EXIT STATUS

the following exit values are returned:

  • 0 β€” all files converted successfully, we ate and left no crumbs πŸ’–
  • >0 β€” an error occurred. not the vibe. 😭

πŸ”— SEE ALSO

  • Devel::Cover β€” go read it, she's the icon this whole thing feeds into 🌟

πŸ™ˆ BUGS

Huh?

(no fr that's what it says, that's the whole bug section, and honestly? relatable.)

πŸ‘‘ 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


and that's the whole page bestie!! this one shipped with perl v5.42.0 and was dated 2025-06-11 β€” go forth and get that coverage πŸŒΈπŸ’œπŸ¦‹

πŸ“¦ where this page comes from