hifirock has asked for the wisdom of the Perl Monks concerning the following question:

I have written a perl script which inturn calls or runs few perl modules. My requirement is to use run the perl script with different switches or arguments and asses the code coverage of both perl script and perl modules.
I am using Devel::Cover module to collect metrics, but it collects only for the given perl script not for modules. Does anyone uses the Devel::Cover module to collect the coverage metrics for perl and its modules? Any suggestion is much useful for me.
Thanks in Advance.

Regards, Manimaran
  • Comment on How to collect code coverage of both perl scripts and modules

Replies are listed 'Best First'.
Re: How to collect code coverage of both perl scripts and modules
by GrandFather (Saint) on Feb 15, 2010 at 19:52 UTC

    I use the following two lines as part of a make file associated with a unit test suite for the project I'm currently working on:

    perl.exe -MDevel::Cover t/Task.t c:\Perl\Site\bin\cover.bat -report html -outputdir C:\Users\Sample +\CoverHtml

    The test file exercises Task.pm and the coverage results include coverage for Task.t, Task.pm and various other of my modules used by Task.pm.


    True laziness is hard work