Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

Replies are listed 'Best First'.
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 (Or 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.
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 look like? Is there a reason you're not using prove or 'make test'?

      The best/worst reason: ignorance.

      My 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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2022-01-20 05:17 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (56 votes). Check out past polls.