Skip to content
Browse files

import Devel::Cover 0.34

  • Loading branch information...
1 parent b8eeb86 commit 19ecf3f8c1f748a0244f35287d6802bc81c6027a @pjcj committed Nov 3, 2004
View
4 CHANGES
@@ -204,3 +204,7 @@ Release 0.33 - 13th January 2004
- Add dynamic_subs test.
- Fix and document Devel::Cover::Op.
- Redo subroutine coverage so anon subs are covered correctly in 5.6.x.
+
+Release 0.34 - 14th January 2004
+ - Fix various warnings and errors that had crept in whilst working on
+ dynamic subs.
View
2 META.yml
@@ -1,7 +1,7 @@
# 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.33
+version: 0.34
version_from:
installdirs: site
requires:
View
4 Makefile.PL
@@ -19,8 +19,8 @@ use ExtUtils::Manifest "maniread";
$| = 1;
-my $Version = "0.33";
-my $Date = "13th January 2004";
+my $Version = "0.34";
+my $Date = "14th January 2004";
my $Author = 'pjcj@cpan.org';
my @perlbug = ("perlbug", "-a", $Author,
View
6 cover
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
-use Devel::Cover::DB 0.33;
+use Devel::Cover::DB 0.34;
use Cwd "abs_path";
use Data::Dumper;
@@ -252,7 +252,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
10 cpancover
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
-use Devel::Cover::DB 0.33;
+use Devel::Cover::DB 0.34;
use Cwd ();
use File::Find ();
@@ -314,7 +314,7 @@ package Devel::Cover::Cpancover::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Template::Provider";
@@ -350,7 +350,7 @@ $Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.33
+This file was generated by Devel::Cover Version 0.34
Devel::Cover is copyright 2001-2004, Paul Johnson (pjcj@cpan.org)
@@ -459,7 +459,7 @@ The following exit values are returned:
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 create_gold
@@ -12,11 +12,11 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use blib;
-use Devel::Cover::Test 0.33;
+use Devel::Cover::Test 0.34;
my @tests = @ARGV;
View
6 gcov2perl
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
-use Devel::Cover::DB 0.33;
+use Devel::Cover::DB 0.34;
use Getopt::Long;
use Pod::Usage;
@@ -128,7 +128,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
27 lib/Devel/Cover.pm
@@ -10,13 +10,13 @@ package Devel::Cover;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use DynaLoader ();
our @ISA = qw( DynaLoader );
-use Devel::Cover::DB 0.33;
-use Devel::Cover::Inc 0.33;
+use Devel::Cover::DB 0.34;
+use Devel::Cover::Inc 0.34;
use B qw( class ppname main_cv main_start main_root walksymtable OPf_KIDS );
use B::Debug;
@@ -615,7 +615,7 @@ sub B::Deparse::deparse
}
elsif ($Seen{$$op}++)
{
- return # Only report on each op once.
+ return "" # Only report on each op once.
}
elsif ($name eq "cond_expr")
{
@@ -722,8 +722,9 @@ sub get_cover
my $cv = $deparse->{curcv} = shift;
my $gv = $cv->GV;
- my $sub_name = $cv->GV->SAFENAME unless ($gv->isa("B::SPECIAL"));
- $sub_name =~ s/(__ANON__)\[.+:\d+\]/$1/;
+ my $sub_name = "";
+ $sub_name = $cv->GV->SAFENAME unless ($gv->isa("B::SPECIAL"));
+ $sub_name =~ s/(__ANON__)\[.+:\d+\]/$1/ if defined $sub_name;
# printf STDERR "getting cover for $sub_name, %x\n", $$cv;
# use Carp "cluck"; cluck "here: ";
@@ -755,12 +756,14 @@ sub get_cover
}
}
- return $deparse->deparse(shift, 0) if @_;
+ my $root = $cv->ROOT;
+ if ($root->can("first"))
+ {
+ my $lineseq = $root->first;
+ add_subroutine_cover($lineseq->first, $sub_name) if $lineseq->can("first");
+ }
- my $lineseq = $cv->ROOT->first;
- my $op = $lineseq->first;
- add_subroutine_cover($op, $sub_name);
- $deparse->deparse_sub($cv, 0)
+ @_ && ref $_[0] ? $deparse->deparse($_[0], 0) : $deparse->deparse_sub($cv, 0);
}
sub get_cover_x
@@ -896,7 +899,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Branch.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Branch;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Criterion";
@@ -76,7 +76,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Condition.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Condition;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Criterion";
@@ -80,7 +80,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Condition";
@@ -46,7 +46,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Condition";
@@ -45,7 +45,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
26 lib/Devel/Cover/Criterion.pm
@@ -10,18 +10,18 @@ package Devel::Cover::Criterion;
use strict;
use warnings;
-our $VERSION = "0.33";
-
-use Devel::Cover::Statement 0.33;
-use Devel::Cover::Branch 0.33;
-use Devel::Cover::Condition 0.33;
-use Devel::Cover::Condition_or_2 0.33;
-use Devel::Cover::Condition_or_3 0.33;
-use Devel::Cover::Condition_and_3 0.33;
-use Devel::Cover::Condition_xor_4 0.33;
-use Devel::Cover::Subroutine 0.33;
-use Devel::Cover::Time 0.33;
-use Devel::Cover::Pod 0.33;
+our $VERSION = "0.34";
+
+use Devel::Cover::Statement 0.34;
+use Devel::Cover::Branch 0.34;
+use Devel::Cover::Condition 0.34;
+use Devel::Cover::Condition_or_2 0.34;
+use Devel::Cover::Condition_or_3 0.34;
+use Devel::Cover::Condition_and_3 0.34;
+use Devel::Cover::Condition_xor_4 0.34;
+use Devel::Cover::Subroutine 0.34;
+use Devel::Cover::Time 0.34;
+use Devel::Cover::Pod 0.34;
sub new
{
@@ -79,7 +79,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
10 lib/Devel/Cover/DB.pm
@@ -10,10 +10,10 @@ package Devel::Cover::DB;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
-use Devel::Cover::DB::File 0.33;
-use Devel::Cover::Criterion 0.33;
+use Devel::Cover::DB::File 0.34;
+use Devel::Cover::Criterion 0.34;
use Carp;
use File::Path;
@@ -122,7 +122,7 @@ sub merge_runs
# shouldn't be a problem unless a file is altered and the coverage run
# created in less than a second. I think we're OK for now.
- for my $run (sort {$a <=> $b} @runs)
+ for my $run (sort @runs)
{
print STDERR "Devel::Cover: merging run $run\n"
unless $Devel::Cover::Silent;
@@ -615,7 +615,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
-use Devel::Cover::Criterion 0.33;
+use Devel::Cover::Criterion 0.34;
sub calculate_summary
{
@@ -78,7 +78,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Op.pm
@@ -12,7 +12,7 @@ require 5.8.0; # My patches to B::Concise didn't get released till 5.8.0.
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use Devel::Cover qw( -ignore blib -ignore \\wB\\w );
use B::Concise qw( set_style add_callback );
@@ -111,7 +111,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Pod.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Pod;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Criterion";
@@ -72,7 +72,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Report/Html.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Report::Html;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Report::Html_minimal";
@@ -45,7 +45,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
-use Devel::Cover::DB 0.33;
+use Devel::Cover::DB 0.34;
use Template 2.00;
@@ -278,7 +278,7 @@ package Devel::Cover::Report::Html_basic::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Template::Provider";
@@ -314,7 +314,7 @@ $Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.33
+This file was generated by Devel::Cover Version 0.34
Devel::Cover is copyright 2001-2002, Paul Johnson (pjcj@cpan.org)
@@ -533,7 +533,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
10 lib/Devel/Cover/Report/Html_minimal.pm
@@ -4,10 +4,10 @@ use strict;
use warnings;
use CGI;
use Getopt::Long;
-use Devel::Cover::DB 0.33;
-use Devel::Cover::Truth_Table 0.33;
+use Devel::Cover::DB 0.34;
+use Devel::Cover::Truth_Table 0.34;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
#-------------------------------------------------------------------------------
# Subroutine : get_coverage_for_line
@@ -255,7 +255,7 @@ sub print_html_header {
print $fh <<"END_HTML";
<!--
-This file was generated by Devel::Cover Version 0.33
+This file was generated by Devel::Cover Version 0.34
Devel::Cover is copyright 2001-2004, Paul Johnson (pjcj\@cpan.org)
Devel::Cover is free. It is licensed under the same terms as Perl itself.
The latest version of Devel::Cover should be available from my homepage:
@@ -746,7 +746,7 @@ Devel::Cover
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
-use Devel::Cover::DB 0.33;
-use Devel::Cover::Truth_Table 0.33;
+use Devel::Cover::DB 0.34;
+use Devel::Cover::Truth_Table 0.34;
use Template 2.00;
use CGI;
@@ -386,7 +386,7 @@ package Devel::Cover::Report::Html_subtle::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Template::Provider";
@@ -404,7 +404,7 @@ sub fetch {
$Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.33
+This file was generated by Devel::Cover Version 0.34
Devel::Cover is copyright 2001-2002, Paul Johnson (pjcj@cpan.org)
@@ -734,7 +734,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33";
+our $VERSION = "0.34";
-use Devel::Cover::DB 0.33;
+use Devel::Cover::DB 0.34;
sub print_file
{
@@ -261,7 +261,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=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.33;
+use Devel::Cover::DB 0.34;
use Devel::Cover::Truth_Table;
my %format = (
@@ -191,7 +191,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Statement.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Statement;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Criterion";
@@ -68,7 +68,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Subroutine.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Subroutine;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Criterion";
@@ -69,7 +69,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Test.pm
@@ -10,14 +10,14 @@ package Devel::Cover::Test;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use Carp;
use File::Spec;
use Test;
-use Devel::Cover::Inc 0.33;
+use Devel::Cover::Inc 0.34;
sub new
{
View
4 lib/Devel/Cover/Time.pm
@@ -10,7 +10,7 @@ package Devel::Cover::Time;
use strict;
use warnings;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
use base "Devel::Cover::Criterion";
@@ -70,7 +70,7 @@ Huh?
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
4 lib/Devel/Cover/Truth_Table.pm
@@ -173,7 +173,7 @@ sub covered {
package Devel::Cover::Truth_Table;
use warnings;
use strict;
-our $VERSION = "0.33";
+our $VERSION = "0.34";
#-------------------------------------------------------------------------------
# Subroutine : new()
@@ -556,7 +556,7 @@ None that I'm aware of...
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENSE
View
2 lib/Devel/Cover/Tutorial.pod
@@ -163,7 +163,7 @@ basis for future research.
=head1 VERSION
-Version 0.33 - 13th January 2004
+Version 0.34 - 14th January 2004
=head1 LICENCE
View
23 test_output/cover/dynamic_subs.5.006001
@@ -4,8 +4,8 @@ Reading database from /home/pjcj/g/perl/dev/Devel-Cover-0.3209/cover_db
------------------------------------------ ------ ------ ------ ------ ------
File stmt branch cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/dynamic_subs 100.00 50.00 n/a 100.00 93.33
-Total 100.00 50.00 n/a 100.00 93.33
+tests/dynamic_subs 100.00 50.00 n/a 100.00 96.00
+Total 100.00 50.00 n/a 100.00 96.00
------------------------------------------ ------ ------ ------ ------ ------
@@ -39,6 +39,22 @@ line err stmt branch cond sub code
25 1 my $t = gen(5)->(6);
26
27 1 print "$p, $q, $r, $s, $t\n";
+28
+29 1 for my $func (qw(f1 f2))
+ 2
+30 {
+31 no strict "refs";
+32 *$func = sub
+33 {
+34 2 100 my $self = shift;
+ 100
+ 100
+35 2 print "$func\n"
+36 }
+37 2 }
+38
+39 1 f1();
+40 1 f2();
Branches
@@ -55,6 +71,9 @@ Covered Subroutines
Subroutine Location
---------- ---------------------
__ANON__ tests/dynamic_subs:15
+__ANON__ tests/dynamic_subs:34
+__ANON__ tests/dynamic_subs:34
+__ANON__ tests/dynamic_subs:34
gen tests/dynamic_subs:12
View
23 test_output/cover/dynamic_subs.5.008
@@ -4,8 +4,8 @@ Reading database from /home/pjcj/g/perl/dev/Devel-Cover-0.3209/cover_db
------------------------------------------ ------ ------ ------ ------ ------
File stmt branch cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/dynamic_subs 100.00 50.00 n/a 100.00 93.33
-Total 100.00 50.00 n/a 100.00 93.33
+tests/dynamic_subs 100.00 50.00 n/a 100.00 96.00
+Total 100.00 50.00 n/a 100.00 96.00
------------------------------------------ ------ ------ ------ ------ ------
@@ -39,6 +39,22 @@ line err stmt branch cond sub code
25 1 my $t = gen(5)->(6);
26
27 1 print "$p, $q, $r, $s, $t\n";
+28
+29 1 for my $func (qw(f1 f2))
+ 2
+30 {
+31 no strict "refs";
+32 *$func = sub
+33 {
+34 2 100 my $self = shift;
+ 100
+ 100
+35 2 print "$func\n"
+36 }
+37 2 }
+38
+39 1 f1();
+40 1 f2();
Branches
@@ -55,6 +71,9 @@ Covered Subroutines
Subroutine Location
---------- ---------------------
__ANON__ tests/dynamic_subs:15
+__ANON__ tests/dynamic_subs:34
+__ANON__ tests/dynamic_subs:34
+__ANON__ tests/dynamic_subs:34
gen tests/dynamic_subs:12
View
22 test_output/cover/dynamic_subs.5.008001
@@ -4,8 +4,8 @@ Reading database from /home/pjcj/g/perl/dev/Devel-Cover-0.3209/cover_db
------------------------------------------ ------ ------ ------ ------ ------
File stmt branch cond sub total
------------------------------------------ ------ ------ ------ ------ ------
-tests/dynamic_subs 100.00 50.00 n/a 100.00 93.33
-Total 100.00 50.00 n/a 100.00 93.33
+tests/dynamic_subs 100.00 50.00 n/a 100.00 95.83
+Total 100.00 50.00 n/a 100.00 95.83
------------------------------------------ ------ ------ ------ ------ ------
@@ -39,6 +39,21 @@ line err stmt branch cond sub code
25 1 my $t = gen(5)->(6);
26
27 1 print "$p, $q, $r, $s, $t\n";
+28
+29 1 for my $func (qw(f1 f2))
+30 {
+31 no strict "refs";
+32 *$func = sub
+33 {
+34 2 100 my $self = shift;
+ 100
+ 100
+35 2 print "$func\n"
+36 }
+37 2 }
+38
+39 1 f1();
+40 1 f2();
Branches
@@ -55,6 +70,9 @@ Covered Subroutines
Subroutine Location
---------- ---------------------
__ANON__ tests/dynamic_subs:15
+__ANON__ tests/dynamic_subs:34
+__ANON__ tests/dynamic_subs:34
+__ANON__ tests/dynamic_subs:34
gen tests/dynamic_subs:12
View
13 tests/dynamic_subs
@@ -25,3 +25,16 @@ my $s = gen(3)->(4);
my $t = gen(5)->(6);
print "$p, $q, $r, $s, $t\n";
+
+for my $func (qw(f1 f2))
+{
+ no strict "refs";
+ *$func = sub
+ {
+ my $self = shift;
+ print "$func\n"
+ }
+}
+
+f1();
+f2();

0 comments on commit 19ecf3f

Please sign in to comment.
Something went wrong with that request. Please try again.