Note that there are some explanatory texts on larger screens.

plurals
  1. PONo coverage for runtime with Devel::Cover and ModPerl::Registry
    primarykey
    data
    text
    <p>When I'm running <code>Devel::Cover</code> with <code>ModPerl::Registry</code>, I get no coverage info except for <code>BEGIN</code> blocks. When I'm running the same script with <code>Devel::Cover</code> from command line or as a CGI, everything works alright (obviously).</p> <p>How can I make <code>Devel::Cover</code> "see" my code being executed in the runtime?</p> <p>Here's <code>Devel::Cover</code> related stuff in my <code>httpd.conf</code>:</p> <pre><code>MaxClients 1 PerlSetEnv DEVEL_COVER_OPTIONS -db,/tmp/cover_db,-silent,1 PerlRequire /var/www/project/startup.pl </code></pre> <p>Here's <code>startup.pl</code>:</p> <pre><code>#!/usr/bin/perl use strict; use warnings; use Apache2::Directive (); BEGIN { # Devel::Cover database must be writable by worker processes my $conftree = Apache2::Directive::conftree-&gt;as_hash; my $name = $conftree-&gt;{User} or die "couldn't find user in Apache config"; print "user=$name\n"; my $uid = getpwnam($name); defined $uid or die "couldn't determine uid by name"; no warnings 'redefine'; local $&gt; = $uid; require Devel::Cover; my $old_report = \&amp;Devel::Cover::report; *Devel::Cover::report = sub { local $&gt; = $uid; $old_report-&gt;(@_) }; Devel::Cover-&gt;import; } 1; </code></pre> <p>(As you may see, I made a monkey patch for <code>Devel::Cover</code> since <code>startup.pl</code> is being run by <code>root</code>, but worker processes run under a different user, and otherwise they couldn't read directories created by <code>startup.pl</code>. If you know a better solution, make a note, please.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload