A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Perl test coverage

Select files to cover and run the tests, capturing coverage data:
perl -MDevel::Cover=,+ignore,.*,-select,^lib t/path/to/test.t

Meaning:
  • ignore all paths...
  • except ones starting with "lib"

After it's run, at the command prompt, type this to generate the HTML report:
cover

And then open this file in your web browser:
cover_db/coverage.html

(docs)