Devel::Cover - An Introduction

Braga, Portugal -- 1st September 2005

Paul Johnson

www.pjcj.net

What is Devel::Cover

test_cover.jpg

Preparation

installation.jpg

Tools you will need

tools.gif

Using Devel::Cover

running.jpg

Using Devel::Cover

running.jpg

A worked example

shell.jpg

Normal Test

$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" \
  "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bash....ok
t/csh.....ok
t/ksh.....ok
t/sh......ok
t/tcsh....ok
t/zsh.....ok
All tests successful.
Files=6, Tests=24,  1 wallclock secs ( 0.49 cusr +  0.09 csys =  0.58 CPU)

Normal Test

$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" \
  "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bash....ok
t/csh.....ok
t/ksh.....ok
t/sh......ok
t/tcsh....ok
t/zsh.....ok
All tests successful.
Files=6, Tests=24,  1 wallclock secs ( 0.49 cusr +  0.09 csys =  0.58 CPU)

Normal Test

$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" \
  "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bash....ok
t/csh.....ok
t/ksh.....ok
t/sh......ok
t/tcsh....ok
t/zsh.....ok
All tests successful.
Files=6, Tests=24,  1 wallclock secs ( 0.49 cusr +  0.09 csys =  0.58 CPU)

Coverage Run

$ cover -test
Deleting database /home/pjcj/g/perl/Shell-Source-0.01/cover_db
PERL_DL_NONLAZY=1 /usr/local/pkg/cover/c1/perl-5.8.7/bin/perl "-MExtUtils::Command::MM" \
  "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bash....ok
t/csh.....ok
t/ksh.....ok
t/sh......ok
t/tcsh....ok
t/zsh.....ok
All tests successful.
Files=6, Tests=24, 17 wallclock secs (16.16 cusr +  1.01 csys = 17.17 CPU)
Reading database from /home/pjcj/g/perl/Shell-Source-0.01/cover_db


---------------------------- ------ ------ ------ ------ ------ ------ ------
File                           stmt   bran   cond    sub    pod   time  total
---------------------------- ------ ------ ------ ------ ------ ------ ------
blib/lib/Shell/Source.pm       96.6   65.0   66.7   90.9    n/a  100.0   86.1
Total                          96.6   65.0   66.7   90.9    n/a  100.0   86.1
---------------------------- ------ ------ ------ ------ ------ ------ ------


Writing HTML output to /home/pjcj/g/perl/Shell-Source-0.01/cover_db/coverage.html ...
done.

Coverage Results

File Coverage

Subroutine Coverage

Statement Coverage

Output

Output