Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Devel::Cover tutorial wanted

by qq (Hermit)
on Apr 05, 2005 at 13:00 UTC ( #444965=note: print w/ replies, xml ) Need Help??


in reply to Re: Devel::Cover tutorial wanted
in thread Devel::Cover tutorial wanted

Thanks for your clear response.

Devel::Cover tells you how much of your code your tests are exercising. So, if you don't hook it into your tests, how is it supposed to do its job?

Agreed - but as noted, running against the test harness script gives no practical output. I can do it against each .t script individually, but that's a pain. When you run use Devel::Cover, do you run it against a script that calls all your tests, or some other way?

Personally, I think your layout is borked. There is no reason to put your t/ directory under lib/Foo/Bar, just because the Foo/Bar levels have no files.

I'll move up the t/ directory. The docs/ is a typo in my node. The real dir is called document_root/, which isn't exactly inspired itself.

Update: clarified docs/ layout


Comment on Re^2: Devel::Cover tutorial wanted
Select or Download Code
Re^3: Devel::Cover tutorial wanted
by dragonchild (Archbishop) on Apr 05, 2005 at 13:13 UTC
    . . . running against the test harness script gives no practical output.

    How are you doing this? What does your test.pl look like? Is there a reason you're not using prove or 'make test'?

      The best/worst reason: ignorance.

      My test.pl script looks like very like the synopsis from Test::Harness. But, now I've seen it, I'll be using prove from now on.

      The modules are not built with ExtUtils::MakeMaker or Module::Build, so I can't use make test.

      I've a lot to learn yet, so thanks for helping me.

Re^3: Devel::Cover tutorial wanted
by mpeters (Chaplain) on Apr 05, 2005 at 15:11 UTC
    Since you are running under mod_perl you need to tell Devel::Cover to look at the code that's being run by apache. Put something like this into your startup.pl. (Or modperl_extra.pl if you are using Apache::Test which I recommend anyway for testing a mod_perl application).
    use Devel::Cover ('+select' => 'My/Module', '+silent');
    Then I would recommend that you look at using something like Module::Build to create your test harness. With it, you can simply run make testcover and it will take care of making sure the test harness has Devel::Cover enabled.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://444965]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-11-29 01:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls