Devel::Cover::DB.3pm

Langue: en

Version: 2010-05-13 (ubuntu - 24/10/10)

Section: 3 (Bibliothèques de fonctions)

NAME

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

SYNOPSIS

  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

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

SEE ALSO

  Devel::Cover
 
 

METHODS

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

Huh?

VERSION

Version 0.66 - 12th April 2010

LICENCE

Copyright 2001-2010, 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