til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Create Test Coverage Report Using Dist::Zilla

Perl has the magnificent Devel::Cover, this can be used from Dist::Zilla using the plugin Dist::Zilla::App::Command::cover

And then you can just do:

$ dzil cover

And you get your good old coverage report:

---------------------------- ------ ------ ------ ------ ------ ------ ------
File                           stmt   bran   cond    sub    pod   time  total
---------------------------- ------ ------ ------ ------ ------ ------ ------
blib/lib/Module/Info/File.pm  100.0  100.0   60.0  100.0  100.0  100.0   97.1
Total                         100.0  100.0   60.0  100.0  100.0  100.0   97.1
---------------------------- ------ ------ ------ ------ ------ ------ ------

and a link to the HTML version.

HTML output written to /Users/jonasbn/develop/github/Module-Info-File/.build/D9L1sYL19B/cover_db/coverage.html
done.

And on macOS you can then do:

open /Users/jonasbn/develop/github/Module-Info-File/.build/D9L1sYL19B/cover_db/coverage.html

And a browser window will open with a coverage report, you can navigate in and see the coverage of your code.

References