Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

import Devel::Cover 0.24

  • Loading branch information...
commit 2eb1bed6960cc1dbdac5b30d7612c121a2929551 1 parent ffe2236
@pjcj authored
Showing with 121 additions and 104 deletions.
  1. +6 −0 CHANGES
  2. +2 −2 META.yml
  3. +4 −4 Makefile.PL
  4. +1 −1  README
  5. +0 −1  TODO
  6. +3 −3 cover
  7. +11 −15 cpancover
  8. +2 −2 create_gold
  9. +3 −3 gcov2perl
  10. +24 −8 lib/Devel/Cover.pm
  11. +2 −2 lib/Devel/Cover/Branch.pm
  12. +2 −2 lib/Devel/Cover/Condition.pm
  13. +2 −2 lib/Devel/Cover/Condition_and_3.pm
  14. +2 −2 lib/Devel/Cover/Condition_or_2.pm
  15. +2 −2 lib/Devel/Cover/Condition_or_3.pm
  16. +2 −2 lib/Devel/Cover/Condition_xor_4.pm
  17. +13 −13 lib/Devel/Cover/Criterion.pm
  18. +4 −4 lib/Devel/Cover/DB.pm
  19. +3 −3 lib/Devel/Cover/DB/File.pm
  20. +1 −1  lib/Devel/Cover/Op.pm
  21. +2 −2 lib/Devel/Cover/Pod.pm
  22. +3 −3 lib/Devel/Cover/Report/Html.pm
  23. +5 −5 lib/Devel/Cover/Report/Html_basic.pm
  24. +6 −6 lib/Devel/Cover/Report/Html_subtle.pm
  25. +3 −3 lib/Devel/Cover/Report/Text.pm
  26. +2 −2 lib/Devel/Cover/Report/Text2.pm
  27. +2 −2 lib/Devel/Cover/Statement.pm
  28. +2 −2 lib/Devel/Cover/Subroutine.pm
  29. +2 −2 lib/Devel/Cover/Test.pm
  30. +2 −2 lib/Devel/Cover/Time.pm
  31. +2 −2 lib/Devel/Cover/Truth_Table.pm
  32. +1 −1  lib/Devel/Cover/Tutorial.pod
View
6 CHANGES
@@ -139,3 +139,9 @@ Release 0.23 - 6th September 2003
- Report condition coverage for branches on the same line as the branch.
- Add subroutine coverage.
- Made "all" coverage value work and made it the default.
+
+Release 0.24 - 10th October 2003
+ - Paths in Devel::Cover::Inc in single quotes for Windows platforms.
+ - Add -dir option and default it to cwd.
+ - Ignore test.pl in cpancover.
+ - Display pod coverage in cpancover.
View
4 META.yml
@@ -1,10 +1,10 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Devel-Cover
-version: 0.22
+version: 0.24
version_from:
installdirs: site
requires:
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.16
+generated_by: ExtUtils::MakeMaker version 6.17
View
8 Makefile.PL
@@ -19,8 +19,8 @@ use ExtUtils::Manifest "maniread";
$| = 1;
-my $Version = "0.23";
-my $Date = "6th September 2003";
+my $Version = "0.24";
+my $Date = "10th October 2003";
my $Author = 'pjcj@cpan.org';
my @perlbug = ("perlbug", "-a", $Author,
@@ -55,8 +55,8 @@ use strict;
use warnings;
our \$VERSION = "$Version";
-our \$Perl = "$^X";
-our \$Base = "$base";
+our \$Perl = '$^X';
+our \$Base = '$base';
our \@Inc = qw( @inc );
1
View
2  README
@@ -18,7 +18,7 @@ DESCRIPTION
although there may be some statements which are not reported. Branch and
condition coverage data should be mostly accurate too, although not
always what one might initially expect. Subroutine coverage should be as
- accurate as statements coverage. Pod coverage comes from Pod::Coverage.
+ accurate as statement coverage. Pod coverage comes from Pod::Coverage.
Coverage data for path coverage are not yet collected.
The gcov2perl program can be used to convert gcov files to Devel::Cover
View
1  TODO
@@ -17,7 +17,6 @@
- Add popups to html output to specify x/y = z% (or some other way)
- Look at time coverage again - collecting for too many ops?
- MD5 file and check it hasn't changed.
-- Add -blib option defaulting on if blib directory is present.
- Make path to DB absolute based on cwd.
- Merge data from dynamically created subs.
- Separate output for pod coverage, like subroutine coverage.
View
6 cover
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::DB 0.23;
+use Devel::Cover::DB 0.24;
use Getopt::Long;
@@ -202,7 +202,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
26 cpancover
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::DB 0.23;
+use Devel::Cover::DB 0.24;
use Cwd ();
use File::Find ();
@@ -102,18 +102,15 @@ sub get_cover
my $db = "$d/cover_db";
- if (-d $db)
- {
- print "Already analysed\n";
- # return;
- }
+ print "Already analysed\n" if -d $db;
+ print "Cannot cover tests in test.pl\n" if -e "test.pl";
my $s = $Options->{cover_source};
my $inc = "-I$s/blib/lib -I$s/blib/arch";
$ENV{HARNESS_PERL_SWITCHES} =
"$inc -MDevel::Cover=-db,$db,+inc,$s,-ignore,\\\\bt/,-silent,1";
- if (! -d $db || $Options->{force})
+ if ((! -d $db || $Options->{force}) && ! -e "test.pl")
{
print "Testing $module\n";
sys "$^X $inc $s/cover -delete $db";
@@ -239,8 +236,8 @@ sub write_html
my $vars =
{
- title => "CPAN Coverage report",
- modules => [],
+ title => "CPAN Coverage report",
+ modules => [],
};
my %vals;
@@ -253,7 +250,7 @@ sub write_html
my $db = Devel::Cover::DB->new(db => "$base/$File::Find::dir");
my $criteria = $vars->{headers} ||=
- [ grep(!/path|pod|time/, $db->all_criteria) ];
+ [ grep(!/path|time/, $db->all_criteria) ];
my %options = map { $_ => 1 } @$criteria;
$db->calculate_summary(%options);
@@ -285,7 +282,6 @@ sub write_html
write_stylesheet;
$Template->process("summary", $vars, $f) or die $Template->error();
-
}
sub main
@@ -310,7 +306,7 @@ package Devel::Cover::Cpancover::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Template::Provider";
@@ -346,7 +342,7 @@ $Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.23
+This file was generated by Devel::Cover Version 0.24
Devel::Cover is copyright 2001-2003, Paul Johnson (pjcj@cpan.org)
@@ -454,7 +450,7 @@ The following exit values are returned:
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 create_gold
@@ -12,11 +12,11 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use blib;
-use Devel::Cover::Test 0.23;
+use Devel::Cover::Test 0.24;
my @tests = @ARGV;
View
6 gcov2perl
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::DB 0.23;
+use Devel::Cover::DB 0.24;
use Getopt::Long;
use Pod::Usage;
@@ -128,7 +128,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
32 lib/Devel/Cover.pm
@@ -11,12 +11,12 @@ use strict;
use warnings;
our @ISA = qw( DynaLoader );
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use DynaLoader ();
-use Devel::Cover::DB 0.23;
-use Devel::Cover::Inc 0.23;
+use Devel::Cover::DB 0.24;
+use Devel::Cover::Inc 0.24;
use B qw( class ppname main_cv main_start main_root walksymtable OPf_KIDS );
use B::Debug;
@@ -30,6 +30,7 @@ BEGIN { eval "use Pod::Coverage 0.06" } # We'll use this if it is available.
my $Silent = undef; # Output nothing.
+my $Dir; # Directory in cover will be gathered.
my $DB = "cover_db"; # DB name.
my $Indent = 1; # Data::Dumper indent.
my $Merge = 1; # Merge databases.
@@ -53,8 +54,6 @@ my $Cover; # Coverage data.
my %Criteria; # Names of coverage criteria.
my %Coverage; # Coverage criteria to collect.
-my $Cwd = Cwd::cwd(); # Where we start from.
-
use vars '$File', # Last filename we saw. (localised)
'$Line', # Last line number we saw. (localised)
'$Collect', # Whether or not we are collecting
@@ -119,6 +118,7 @@ sub import
{
local $_ = shift;
/^-silent/ && do { $Silent = shift; next };
+ /^-dir/ && do { $Dir = shift; next };
/^-db/ && do { $DB = shift; next };
/^-indent/ && do { $Indent = shift; next };
/^-merge/ && do { $Merge = shift; next };
@@ -135,6 +135,17 @@ sub import
warn __PACKAGE__ . ": Unknown option $_ ignored\n";
}
+ if (defined $Dir)
+ {
+ chdir $Dir or die __PACKAGE__ . ": Can't chdir $Dir: $!\n";
+ }
+ else
+ {
+ $Dir = Cwd::getcwd()
+ }
+
+ $DB = Cwd::abs_path($DB);
+
if ($blib)
{
eval "use blib";
@@ -226,7 +237,7 @@ sub get_location
my $file = $File;
$File =~ s/ \(autosplit into .*\)$//;
- $File =~ s/^$Cwd\///;
+ $File =~ s/^$Dir\///;
# $File =~ s/^blib\///;
# $File =~ s/^lib\///;
@@ -297,6 +308,8 @@ sub check_files
sub report
{
+ chdir $Dir or die __PACKAGE__ . ": Can't chdir $Dir: $!\n";
+
my @collected = get_coverage();
# print "Collected @collected\n";
return unless @collected;
@@ -340,6 +353,7 @@ sub report
};
$cover->merge($existing) if $existing;
$cover->indent($Indent);
+ print __PACKAGE__, ": Writing coverage database to $DB\n" unless $Silent;
$cover->write($DB);
$cover->print_summary if $Summary && !$Silent;
}
@@ -706,7 +720,7 @@ Statement, branch, condition, subroutine, pod and time coverage information is
reported. Statement coverage data should be reasonable, although there may be
some statements which are not reported. Branch and condition coverage data
should be mostly accurate too, although not always what one might initially
-expect. Subroutine coverage should be as accurate as statements coverage. Pod
+expect. Subroutine coverage should be as accurate as statement coverage. Pod
coverage comes from Pod::Coverage. Coverage data for path coverage are not yet
collected.
@@ -735,6 +749,8 @@ Requirements:
include statement, branch, path, subroutine, pod, time,
all and none (default all available).
-db cover_db - Store results in coverage db (default ./cover_db).
+ -dir path - Directory in which coverage will be collected (default
+ cwd).
-ignore RE - Ignore files matching RE.
-inc path - Set prefixes of files to ignore (default @INC).
+inc path - Append to prefixes of files to ignore.
@@ -767,7 +783,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Branch.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Branch;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Criterion";
@@ -76,7 +76,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Condition.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Condition;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Criterion";
@@ -80,7 +80,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Condition_and_3.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_and_3;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Condition_or_2.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_or_2;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Condition_or_3.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_or_3;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Condition_xor_4.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Condition_xor_4;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Condition";
@@ -45,7 +45,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
26 lib/Devel/Cover/Criterion.pm
@@ -10,18 +10,18 @@ package Devel::Cover::Criterion;
use strict;
use warnings;
-our $VERSION = "0.23";
-
-use Devel::Cover::Statement 0.23;
-use Devel::Cover::Branch 0.23;
-use Devel::Cover::Condition 0.23;
-use Devel::Cover::Condition_or_2 0.23;
-use Devel::Cover::Condition_or_3 0.23;
-use Devel::Cover::Condition_and_3 0.23;
-use Devel::Cover::Condition_xor_4 0.23;
-use Devel::Cover::Subroutine 0.23;
-use Devel::Cover::Time 0.23;
-use Devel::Cover::Pod 0.23;
+our $VERSION = "0.24";
+
+use Devel::Cover::Statement 0.24;
+use Devel::Cover::Branch 0.24;
+use Devel::Cover::Condition 0.24;
+use Devel::Cover::Condition_or_2 0.24;
+use Devel::Cover::Condition_or_3 0.24;
+use Devel::Cover::Condition_and_3 0.24;
+use Devel::Cover::Condition_xor_4 0.24;
+use Devel::Cover::Subroutine 0.24;
+use Devel::Cover::Time 0.24;
+use Devel::Cover::Pod 0.24;
sub new
{
@@ -79,7 +79,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
8 lib/Devel/Cover/DB.pm
@@ -10,10 +10,10 @@ package Devel::Cover::DB;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::DB::File 0.23;
-use Devel::Cover::Criterion 0.23;
+use Devel::Cover::DB::File 0.24;
+use Devel::Cover::Criterion 0.24;
use Carp;
use Data::Dumper;
@@ -561,7 +561,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
6 lib/Devel/Cover/DB/File.pm
@@ -10,9 +10,9 @@ package Devel::Cover::DB::File;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::Criterion 0.23;
+use Devel::Cover::Criterion 0.24;
sub calculate_summary
{
@@ -78,7 +78,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
2  lib/Devel/Cover/Op.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Op;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use Devel::Cover qw( -ignore blib -ignore \\wB\\w -indent 1 );
use B::Concise qw( set_style add_callback );
View
4 lib/Devel/Cover/Pod.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Pod;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Criterion";
@@ -72,7 +72,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
6 lib/Devel/Cover/Report/Html.pm
@@ -10,9 +10,9 @@ package Devel::Cover::Report::Html;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::Report::Html_subtle 0.23;
+use Devel::Cover::Report::Html_subtle 0.24;
sub report
{
@@ -52,7 +52,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
10 lib/Devel/Cover/Report/Html_basic.pm
@@ -10,9 +10,9 @@ package Devel::Cover::Report::Html_basic;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::DB 0.23;
+use Devel::Cover::DB 0.24;
use Cwd ();
use Template 2.00;
@@ -280,7 +280,7 @@ package Devel::Cover::Report::Html_basic::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Template::Provider";
@@ -316,7 +316,7 @@ $Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.23
+This file was generated by Devel::Cover Version 0.24
Devel::Cover is copyright 2001-2002, Paul Johnson (pjcj@cpan.org)
@@ -535,7 +535,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
12 lib/Devel/Cover/Report/Html_subtle.pm
@@ -2,10 +2,10 @@ package Devel::Cover::Report::Html_subtle;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::DB 0.23;
-use Devel::Cover::Truth_Table 0.23;
+use Devel::Cover::DB 0.24;
+use Devel::Cover::Truth_Table 0.24;
use Cwd();
use Template 2.00;
@@ -378,7 +378,7 @@ package Devel::Cover::Report::Html_subtle::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Template::Provider";
@@ -396,7 +396,7 @@ sub fetch {
$Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.23
+This file was generated by Devel::Cover Version 0.24
Devel::Cover is copyright 2001-2002, Paul Johnson (pjcj@cpan.org)
@@ -722,7 +722,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
6 lib/Devel/Cover/Report/Text.pm
@@ -10,9 +10,9 @@ package Devel::Cover::Report::Text;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
-use Devel::Cover::DB 0.23;
+use Devel::Cover::DB 0.24;
sub print_file
{
@@ -263,7 +263,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Report/Text2.pm
@@ -4,7 +4,7 @@ use warnings;
our $VERSION = '0.20';
-use Devel::Cover::DB 0.23;
+use Devel::Cover::DB 0.24;
use Devel::Cover::Truth_Table;
my %format = (
@@ -191,7 +191,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Statement.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Statement;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Criterion";
@@ -68,7 +68,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Subroutine.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Subroutine;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Criterion";
@@ -69,7 +69,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Test.pm
@@ -10,14 +10,14 @@ package Devel::Cover::Test;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use Carp;
use File::Spec;
use Test;
-use Devel::Cover::Inc 0.23;
+use Devel::Cover::Inc 0.24;
sub new
{
View
4 lib/Devel/Cover/Time.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Time;
use strict;
use warnings;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
use base "Devel::Cover::Criterion";
@@ -69,7 +69,7 @@ Huh?
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
View
4 lib/Devel/Cover/Truth_Table.pm
@@ -171,7 +171,7 @@ sub covered {
package Devel::Cover::Truth_Table;
use warnings;
use strict;
-our $VERSION = "0.23";
+our $VERSION = "0.24";
#-------------------------------------------------------------------------------
# Subroutine : new()
@@ -555,7 +555,7 @@ None that I'm aware of...
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENSE
View
2  lib/Devel/Cover/Tutorial.pod
@@ -163,7 +163,7 @@ basis for future research.
=head1 VERSION
-Version 0.23 - 6th September 2003
+Version 0.24 - 10th October 2003
=head1 LICENCE
Please sign in to comment.
Something went wrong with that request. Please try again.