Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Devel-Cover CPAN distribution.

Report information
The Basics
Id: 63568
Status: resolved
Priority: 0/
Queue: Devel-Cover

People
Owner: Nobody in particular
Requestors: MITHALDU [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.73
Fixed in: (no value)



Subject: Devel::Cover can't handle Test::More's is()
Running this test case script: marp.pl: #!/usr/bin/perl use Devel::Cover; use Test::More; is('', ''); Results in this error: Devel::Cover: Can't find file "(eval in cmp_ok) <path_here> \marp.pl" ((eval in cmp_ok) <path_here>\marp.pl): ignored.
Slightly more minimal test case: #!/usr/bin/perl use Devel::Cover; use Test::More; cmp_ok('', 'eq', ''); Same error.
This still fails with a slightly different error message: Devel::Cover: Can't open cmp_ok [from t/test.t line 10] for MD5 digest: No such file or directory The "cmp_ok [from t/test.t line 10] is being generated by Test::Builder's cmp_ok subroutine in an eval that looks like this: $test = eval qq[ #line 1 "cmp_ok [from $file line $line]" \$got $type \$expect; ]; which Devel::Cover isn't recognizing as an eval and skipping it. Devel::Cover already has a couple of hacks to avoid other arguably weird modules. The attached patch that silences the warning for me.
Subject: Devel-Cover_pm-63568.patch
--- Cover.pm.orig 2011-08-05 04:26:39.000000000 -0600 +++ Cover.pm 2012-03-20 16:17:40.000000000 -0600 @@ -518,7 +518,8 @@ return $Files{$file} if exists $Files{$file}; return 0 if $file =~ /\(eval \d+\)/ || - $file =~ /^\.\.[\/\\]\.\.[\/\\]lib[\/\\](?:Storable|POSIX).pm$/; + $file =~ /^\.\.[\/\\]\.\.[\/\\]lib[\/\\](?:Storable|POSIX).pm$/ || + $file =~ /^cmp_ok \[from /; my $f = normalised_file($file);
This seems to be a problem in Test::More 0.94 at least, and it is fixed by 0.98. I'm not sure whether it's worthwhile doing anything about this, but since I have some plans to be working in this area, I my well put in a fix for this whilst I am there, since this problem will show in a default 5.12.x installation.
Oops, didn't notice the patch. That area of the code in probably changing, but I will work a fix in with it. Thanks,
Fixed by 28b12c9. As ever, thanks for the report, investigation and test case.