Hi,
I have unique requirement of handling code coverage of my perl scripts.
I have written few perl scripts which inturn uses few perl modules. My
requirement is to use run these perl scripts with different options they
support and asses the code coverage of both perl scripts perl modules.
So I am using *Devel::Cover, Module::Build and Test::More* from CPAN. Its
all woring fine if I call functions inside perl modules directly inside test
script. But its not working if I call the scripts directly (In this case I
am not getting generated with code coverage of perl modules and scripts
both).
Here is my example test script using Test::More:
use strict;
use warnings;
use Test::More;
BEGIN { plan tests => 1 }
# Expected Failure: Incorrect IP address
ok(sub {
my @args = ("*ex4200fw*","-query-fw","-i","192.168.168.1");
#print "# Executing @args \n";
`...@args`;
my $rc = $? >> 8;
#print "# Return code: $rc \n";
$rc == 1
}->(),"Query Juniper EX4200 FW, incorrect IP address.\n");
Here ex4200fw (is in path) is the perl script written by me which inturn
calls dependant module updates.pm
Do we have any tools to suite to this requirement? (like running perl
scripts and getting code coverage of both scripts and its dependant
modules)?
Can we accomplish the same using above CPAN modules? Any sample script is
much useful for me.
Thanks in Advance.
Naren.
--
Thanks and Regards
Narendra Dhulipalla
Success is not final, failure is not fatal: it is the courage to continue
that counts. --- Winston Churchill
(9986164688)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs