On Sat, Jun 03, 2006 at 10:18:46PM -0500, jason gessner wrote:

> Hi All.
> 
> Has anyone successfully used Devel::Cover under mod_perl to do  
> coverage for a mason application?
> 
> My preliminary experiments were mixed.  I used D::C from my .pl  
> handler file and ran apache with -X, but saw inconsistent results  
> when i did a couple tests.
> 
> During the first test, it showed some of the files i had accessed,  
> but showed no code executed for them.  On the second test (second  
> test being the same thing, but after restarting apache again and  
> deleting the coverage db), i only saw code referenced by my handler.
> 
> Google searches have turned up nada so far.
> 
> Has anyone done this before i figure out how to do it?

Devel::Cover should work under mod_perl.  I have used it successfully
with the Template Toolkit, but I am not a Mason user and I don't recall
any previous reports of success or otherwise with Mason.

I suggest using Devel::Cover from your mod_perl startup script (see the
docs).  You might like to check that $ENV{MOD_PERL} is being set.  IIRC
it should be set to 1 under mp1 and 2 under mp2.

When Mason works with Perl code, does it manage __LINE__ and __FILE__
correctly?  If so, then Devel::Cover should report coverage at the
correct place.  You can probably assume this is OK if error messages
from your template point you to the code correctly.

If you still have problems you might need to come back with a bit more
information.

Good luck.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to