Questions tagged [devel-cover]

Devel::Cover - Code coverage metrics for Perl

Devel::Cover - Code coverage metrics for Perl

This module provides code coverage metrics for Perl. Code coverage metrics describe how thoroughly tests exercise code. By using Devel::Cover you can discover areas of code not exercised by your tests and determine which tests to create to increase coverage. Code coverage can be considered an indirect measure of quality.

Quick start for Devel::Cover

33 questions
14
votes
1 answer

How can I run Devel::Cover under mod_perl2?

Unfortunately, Devel::Cover does not yet work with threads. It doesn't work with prefork either. Being use'd in startup.pl, Devel::Cover issues Not a CODE reference. END failed--call queue aborted. perl 5.8.9, Apache 2.2.13. My OS is FreeBSD, if…
codeholic
  • 5,680
  • 3
  • 23
  • 43
7
votes
2 answers

How do I disable Devel::Cover for forked child processes?

I noticed, that when I run my program with perl -MDevel::Cover=-silent,-nogcov foo.pl to collect coverage information for foo.pl, I am getting massive slowdowns from parts of my program that fork and exec non-perl programs like tar, gzip or…
josch
  • 6,716
  • 3
  • 41
  • 49
7
votes
1 answer

How to mark `//` conditions uncoverable with Devel::Cover?

I have the following logic: sub test { my ($x, $y) = @_; die unless defined $x || defined $y; # uncoverable condition false return $x // $y; } test( 1, 2 ); test( 1, undef ); test( undef, 2 ); test( undef, undef…
stevenl
  • 6,736
  • 26
  • 33
6
votes
1 answer

How do I collect coverage from child processes when running `cover -test`, and not otherwise? (Devel::Cover)

(I think I've seen the answer to this, but I can't find it again. The closest I have come across is this question). I am hacking on prt and am trying to get full coverage data for my changes. Some of my new tests call system($^X, 'prt', ...) to…
cxw
  • 16,685
  • 2
  • 45
  • 81
5
votes
1 answer

Devel::Cover merging coverage data for Perl scripts and modules

I'm having issues merging data for coverage on Perl scripts and modules.. Running Devel::Cover individually works just fine, but when I try to combine the data I lose statistics for just the Perl script not the module.. Let me explain.. I have a…
5
votes
2 answers

How can I change the CSS of Devel::Cover in Perl?

When running ./Build testcover to test the code coverage, is there a way I can pass in some kind of option for using my own stylesheet, maybe as an override? I have looked at the Devel::Cover CPAN documentation to no avail.
ardavis
  • 9,842
  • 12
  • 58
  • 112
5
votes
1 answer

For Devel::Cover to cover all files in specific paths

I have been tasked with cleaning up some legacy code which is poorly written, but has an astonishingly large number of tests. Some of these tests run code in files like this: fcgi/*.fcgi I would very much like to include those in my coverage…
Ovid
  • 11,580
  • 9
  • 46
  • 76
4
votes
1 answer

How to force Devel::Cover to ignore a folder when using perl-helpers via Travis CI

The MetaCPAN Travis CI coverage builds are quite slow. See https://travis-ci.org/metacpan/metacpan-web/builds/238884497 This is likely in part because we're not successfully ignoring the /local folder that gets created by Carton as part of our…
oalders
  • 5,239
  • 2
  • 23
  • 34
4
votes
1 answer

Not able to generate the code coverage result using Devel::Cover

I tried to find code coverage for a c4rgr.pl test file with Devel::Cover. I have a .pm module sitting in the same area. I am using perl -MDevel::Cover c4rgr.pl, which generates a cover_db and has a runs subdirectory inside. Inside the runs…
Enthusiast
  • 85
  • 1
  • 6
4
votes
1 answer

Devel::Cover HTML output

I am playing around with Devel::Cover to see how well our test suite is actually testing our codebase. I run all of our tests using -MDevel::Cover nothing seems to fail or crash, but the HTML output of the coverage table has entries like these for…
Hunter McMillen
  • 59,865
  • 24
  • 119
  • 170
4
votes
2 answers

how to list uncovered pm/pl file in Devel::Cover's report

My dir/files are like this: /lib/a.pm /lib/b.pm /lib/c.pm .. /lib/n.pm /lib/start.pl start.pl is an interactive program, it will call different pm based on my selection. when I run start.pl with Devel::Cover : PERL5OPT=-MDevel::Cover…
Tingting
  • 157
  • 1
  • 8
3
votes
1 answer

Why does Perl's Devel::Cover think some branches and conditions are not covered?

I have this function which takes an array, counts how often each item occurs, and returns an array of unique items, ordered by count first, then alphabetically sorted, and then alphabetically case-insensitive so that order does not change between…
Robert
  • 7,394
  • 40
  • 45
  • 64
3
votes
2 answers

Devel::Cover HTML report process killed

I have test suite with over 200+ selenium test cases where in each I capture the coverage using Devel::Cover. After all the test cases are run, when I try to generate the HTML report using 'cover cover_db -report html' the process is killed after…
Santosh
  • 31
  • 1
3
votes
2 answers

No coverage for runtime with Devel::Cover and ModPerl::Registry

When I'm running Devel::Cover with ModPerl::Registry, I get no coverage info except for BEGIN blocks. When I'm running the same script with Devel::Cover from command line or as a CGI, everything works alright (obviously). How can I make Devel::Cover…
codeholic
  • 5,680
  • 3
  • 23
  • 43
3
votes
1 answer

Provision of switching Devel::Cover on/off

While using Devel::Cover in a test code which tests CodeA, does Devel::Cover have an option of switching the coverage off. Is there a way to switch the coverage module on or off as per user? Test code tests CodeA. Devel::Cover commands are embedded…
Enthusiast
  • 85
  • 1
  • 6
1
2 3