Permalink
Browse files

import Devel::Cover 0.08

  • Loading branch information...
1 parent ba86713 commit 2717da1b6b10bd5accd99caff5317faaf3561378 @pjcj committed Nov 3, 2004
Showing with 61 additions and 21 deletions.
  1. +6 −1 CHANGES
  2. +19 −8 Cover.pm
  3. +2 −2 Cover/DB.pm
  4. +1 −1 Cover/Op.pm
  5. +27 −3 Makefile.PL
  6. +1 −1 cover
  7. +1 −1 t/Compare.pm
  8. +2 −2 t/t1.t
  9. +2 −2 t/t2.t
View
@@ -28,4 +28,9 @@ Release 0.06 - 10th August 2001
- Trim filename length in detailed output.
Release 0.07 - 17th August 2001
- - Add an API to Devel::Cover::DB
+ - Add an API to Devel::Cover::DB.
+
+Release 0.08 - 18th August 2001
+ - Provide better handling of files to report on or ignore.
+ Makefile.PL generates Inc.pm containing default @INC.
+ added +inc, -ignore and -select.
View
@@ -12,10 +12,11 @@ use warnings;
use DynaLoader ();
-use Devel::Cover::DB 0.07;
+use Devel::Cover::DB 0.08;
+use Devel::Cover::Inc 0.08;
our @ISA = qw( DynaLoader );
-our $VERSION = "0.07";
+our $VERSION = "0.08";
use B qw( class ppname main_root main_start main_cv svref_2object OPf_KIDS );
# use B::Debug;
@@ -25,16 +26,18 @@ my $Covering = 1;
my $DB = "cover_db";
my $Details = 0;
my $Merge = 1;
+my @Ignore;
my @Inc;
my $Indent = 0;
+my @Select;
my $Summary = 1;
my %Cover;
our $Cv; # gets localised
my @Todo;
my %Done;
-BEGIN { @Inc = @INC }
+BEGIN { @Inc = @Devel::Cover::Inc::Inc }
# BEGIN { $^P = 0x02 | 0x04 | 0x100 }
BEGIN { $^P = 0x04 | 0x100 }
@@ -50,9 +53,11 @@ sub import
/^-db/ && do { $DB = shift; next };
/^-details/ && do { $Details = shift; next };
/^-merge/ && do { $Merge = shift; next };
- /^-inc/ && do { push @Inc, shift; next };
/^-indent/ && do { $Indent = shift; next };
/^-summary/ && do { $Summary = shift; next };
+ /^-ignore/ && do { push @Ignore, shift while $_[0] !~ /^-/; next };
+ /^[-+]inc/ && do { push @Inc, shift while $_[0] !~ /^-/; next };
+ /^-select/ && do { push @Select, shift while $_[0] !~ /^-/; next };
warn __PACKAGE__ . ": Unknown option $_ ignored\n";
}
}
@@ -79,8 +84,11 @@ sub report
INC:
while (my ($name, $file) = each %INC)
{
- # print "$name => $file\n";
- for (@Inc) { next INC if $file =~ /^\Q$_/ }
+ # print "test $name => $file\n";
+ for (@Select) { next INC if $file !~ /$_/ }
+ for (@Ignore) { next INC if $file =~ /$_/ }
+ for (@Inc) { next INC if $file =~ /^\Q$_/ }
+ # print "use $name => $file\n";
$name =~ s/\.pm$//;
$name =~ s/\//::/g;
push @roots, get_subs($name);
@@ -337,9 +345,12 @@ Requirements:
-db cover_db - Store results in coverage db (default cover_db).
-details val - Print detailed information iff val is true (default off).
- -inc path - Prefix of files to ignore (default @INC).
+ -inc path - Set prefixes of files to ignore (default @INC).
+ +inc path - Append to prefixes of files to ignore.
+ -ignore RE - Ignore files matching RE.
-indent indent - Set indentation level to indent. See Data::Dumper for details.
-merge val - Merge databases, for multiple test benches (default on).
+ -select RE - Only report on files matching RE.
-summary val - Print summary information iff val is true (default on).
=head1 TUTORIAL
@@ -524,7 +535,7 @@ Huh?
=head1 VERSION
-Version 0.07 - 17th May 2001
+Version 0.08 - 18th May 2001
=head1 LICENCE
View
@@ -14,7 +14,7 @@ use Carp;
use Data::Dumper;
use File::Path;
-our $VERSION = "0.07";
+our $VERSION = "0.08";
my $DB = "cover.1"; # Version 1 of the database.
@@ -469,7 +469,7 @@ Huh?
=head1 VERSION
-Version 0.07 - 17th May 2001
+Version 0.08 - 18th May 2001
=head1 LICENCE
View
@@ -10,7 +10,7 @@ package Devel::Cover::Op;
use strict;
use warnings;
-our $VERSION = "0.07";
+our $VERSION = "0.08";
use Devel::Cover qw( -inc B -indent 1 -details 1 );
use B::Concise qw( set_style add_callback );
View
@@ -16,8 +16,8 @@ use ExtUtils::MakeMaker;
$| = 1;
-my $Version = "0.07";
-my $Date = "17th May 2001";
+my $Version = "0.08";
+my $Date = "18th May 2001";
my $Author = 'pjcj@cpan.org';
my @perlbug = ("perlbug", "-a", $Author,
@@ -27,10 +27,34 @@ my $Perlbug = join " ", map { / / ? "'$_'" : $_ } @perlbug;
open M, "MANIFEST" or die "Cannot open MANIFEST: $!";
-my @files = map { split } <M>;
+my @files = map { split } <M>, "Cover/Inc.pm";
my @versions = grep { $_ ne "README" && $_ ne "Makefile.PL" } @files;
close M or die "Cannot close MANIFEST: $!";
+open I, ">Cover/Inc.pm" or die "Cannot open Cover/Inc.pm: $!";
+print I <<'EOI1', <<"EOI2";
+# Copyright 2001, 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
+
+# This file was automatically generated by Makefile.PL.
+
+package Devel::Cover::Inc;
+
+use strict;
+use warnings;
+
+EOI1
+our \$VERSION = "$Version";
+our \@Inc = qw( @INC );
+
+1
+EOI2
+close I or die "Cannot close Cover/Inc.pm: $!";
+
$ExtUtils::MakeMaker::Verbose = 0;
WriteMakefile
View
2 cover
@@ -12,7 +12,7 @@ require 5.6.1;
use strict;
use warnings;
-use Devel::Cover::DB 0.07;
+use Devel::Cover::DB 0.08;
my $db = Devel::Cover::DB->new(db => shift);
$db->print_summary;
View
@@ -10,7 +10,7 @@ package Compare;
use strict;
use warnings;
-our $VERSION = "0.07";
+our $VERSION = "0.08";
sub compare
{
View
4 t/t1.t
@@ -10,8 +10,8 @@
use strict;
use warnings;
-use Devel::Cover::DB 0.07;
-use Devel::Cover 0.07 qw( -db t1 -indent 1 -merge 0 );
+use Devel::Cover::DB 0.08;
+use Devel::Cover 0.08 qw( -db t1 -select T1 -indent 1 -merge 0 );
use Test;
View
4 t/t2.t
@@ -10,8 +10,8 @@
use strict;
use warnings;
-use Devel::Cover::DB 0.07;
-use Devel::Cover 0.07 qw( -db t2 -indent 1 -merge 0 );
+use Devel::Cover::DB 0.08;
+use Devel::Cover 0.08 qw( -db t2 +inc blib -indent 1 -merge 0 );
use Test;

0 comments on commit 2717da1

Please sign in to comment.