Setting Devel::Cover options for a web applicationby talexb (Chancellor)
|on Feb 14, 2007 at 18:57 UTC ( #600039=perlquestion: print w/replies, xml )||Need Help??|
talexb has asked for the wisdom of the Perl Monks concerning the following question:
I installed Devel::Cover and ran it against my web application test suite, and got some lovely coverage information about .. my test suite.
My next step was to use Devel::Cover in the web application itself, and to do that I needed to specify the directory where I wanted to leave its database. Simple!
Or not. I tried setting %ENV in a BEGIN clause in the top-level module -- it didn't take. I tried using SetEnv in the httpd.conf file and doing a graceful restart of Apache. Nope -- no luck.
So now I'm wondering if anyone else has managed to do this -- I plan on adding more options so that Devel::Cover doesn't map out all of the parts of CGI::Application that get used -- fascinating information, but not relevant to my goal, which is to find out which paths in my code get used for particular functions.
Update at 1445, February 14, 2007: dragonchild asks, why would I want to do this? Good question.
I'm a one-man web development team, so can't really do the XP thing with anyone else. This means tools like Devel::Cover will help me understand what's happening with my code when I perform certain operations in the web application.
My first shot at using Devel::Cover was yesterday, when I ran it again my test scripts, which use LWP::UserAgent (for REST access) and WWW:Mechanize (for web access) to communicate with my web application. This produced coverage for my test scripts, but I'm more interested in the source code of my application, hence the quest for turning it on, and setting some options, from within Apache.
Back to Seekers of Perl Wisdom