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: 22013
Status: rejected
Priority: 0/
Queue: Devel-Cover

People
Owner: Nobody in particular
Requestors: geckcatcher [...] yahoo.com
Cc:
AdminCc:

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



Subject: Devel::Cover bug - Running "exec" function causes coverage data be lost
Date: Tue, 10 Oct 2006 13:52:13 -0700 (PDT)
To: bug-Devel-Cover [...] rt.cpan.org
From: Scott Wang <geckcatcher [...] yahoo.com>
Download (untitled) / with headers
text/plain 709b
Here in some information: (1) Version 0.55 Devel::Cover (2) Perl v5.8.8 (3) SUSE93 Linux When I was running below simple script exec.pl by coverage command "Perl -MDevel::Cover=-db,./cover_exec_db exec.pl", there was no any coverage data be generated from that. I think "exec" flushes out (in process) previous data from memory and causes coverage data be lost. =============== #!/usr/bin/perl -w # exec.pl print "Print the first line\n"; print "Print the second line\n"; exec ('echo','hello'); ============= Is this a known issue or a bug? If I used "system" or "``" to replace the "exec", coverage data was generated fine and I got 100% code coverage for my simple script exec.pl. Thanks, Scott
Subject: Re: [rt.cpan.org #22013] Devel::Cover bug - Running "exec" function causes coverage data be lost
Date: Sat, 30 Dec 2006 00:26:03 +0100
To: Scott Wang via RT <bug-Devel-Cover [...] rt.cpan.org>
From: Paul Johnson <paul [...] pjcj.net>
Download (untitled) / with headers
text/plain 1.1k
On Tue, Oct 10, 2006 at 04:52:30PM -0400, Scott Wang via RT wrote: Show quoted text
> When I was running below simple script exec.pl by coverage command "Perl > -MDevel::Cover=-db,./cover_exec_db exec.pl", there was no any coverage data > be generated from that. I think "exec" flushes out (in process) previous > data from memory and causes coverage data be lost.
Show quoted text
> Is this a known issue or a bug?
Thanks for your report. I'm not sure I'd call it either, but it's not something I'm planning on changing, so lets call it a limitation. When Devel::Cover is running it collects data in memory. When your program is finished, and Devel::Cover runs its END block, that data is processed and written to the database. By calling exec you stop the END block being run. It should be possible to manually call Devel::Cover report() before exec to collect the coverage data, but I don't think I want to properly support that, at least not officially. Show quoted text
> If I used "system" or "``" to replace the "exec", coverage data was > generated fine and I got 100% code coverage for my simple script exec.pl.
Yes, that allowed the script to continue and the END block to be run. -- Paul Johnson - paul@pjcj.net http://www.pjcj.net


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.