Devel::Cover::DB - Code coverage metrics for Perl


Devel-Cover documentation  | view source Contained in the Devel-Cover distribution.

Index


NAME

Top

Devel::Cover::DB - Code coverage metrics for Perl

SYNOPSIS

Top

 use Devel::Cover::DB;

 my $db = Devel::Cover::DB->new(db => "my_coverage_db");
 $db->print_summary(statement => 1, pod => 1);
 $db->print_details;

DESCRIPTION

Top

This module provides access to a database of code coverage information.

SEE ALSO

Top

 Devel::Cover

METHODS

Top

new

 my $db = Devel::Cover::DB->new(db => "my_coverage_db");

Contructs the DB from the specified database.

cover

 my $cover = $db->cover;

Returns a Devel::Cover::DB::Cover object. From here all the coverage data may be accessed.

 my $cover = $db->cover;
 for my $file ($cover->items)
 {
     print "$file\n";
     my $f = $cover->file($file);
     for my $criterion ($f->items)
     {
         print "  $criterion\n";
         my $c = $f->criterion($criterion);
         for my $location ($c->items)
         {
             my $l = $c->location($location);
             print "    $location @$l\n";
         }
     }
 }

Data for different criteria will be in different formats, so that will need special handling, but I'll deal with that when we have the data for different criteria.

If you don't want to remember all the method names, use values() instead of files(), criteria() and locations() and get() instead of file(), criterion() and location().

Instead of calling $file->criterion("x") you can also call $file->x.

is_valid

 my $valid = $db->is_valid;

Returns true iff the db is valid. (Actually there is one too many fs there, but that's what it should do.)

BUGS

Top

Huh?

VERSION

Top

Version 0.78 - 17th May 2011

LICENCE

Top

Copyright 2001-2011, Paul Johnson (pjcj@cpan.org)

This software is free. It is licensed under the same terms as Perl itself.

The latest version of this software should be available from my homepage: http://www.pjcj.net


Devel-Cover documentation  | view source Contained in the Devel-Cover distribution.