inc/Module/Install/AuthorTests.pm

filter: Statementstmt 46.1% 18 / 39 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 54.5% 6 / 11 Podpod 0.0% 0 / 2 totaltotal 35.8% 24 / 67 CC 7 SCAR 24.6
CC
7
Cov
35%
_add_author_tests
30.0
__ANON__
12.0
author_tests
2.0
CRAP 11.6
« inc/Module/Install/ReadmeFromPod.pm ↑ Summary blib/lib/Module/Install/ReadmePodFromPod.pm »
1 #line 1
2 package Module::Install::AuthorTests;
3 1 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use 5.005;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Module::Install::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 use Carp ();
8  
9 #line 16
10  
11 use vars qw{$VERSION $ISCORE @ISA};
12 BEGIN {
13 $VERSION = '0.002';
14 $ISCORE = 1;
15 @ISA = qw{Module::Install::Base};
16 }
17 1 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶#line 42
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1  
20 1 sub author_tests {
21 1 my ($self, @dirs) = @_;
22 _add_author_tests($self, \@dirs, 0);
23 }
24  
25 #line 56
26  
27 sub recursive_author_tests {
28 my ($self, @dirs) = @_;
29 _add_author_tests($self, \@dirs, 1);
30 }
31  
32 sub _wanted {
33 my $href = shift;
34 sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
35 }
36  
37 sub _add_author_tests {
38 my ($self, $dirs, $recurse) = @_;
39 return unless $Module::Install::AUTHOR;
40  
41 my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
42  
43 0 ▶ # XXX: pick a default, later -- rjbs, 2008-02-24
Subroutine author_tests: not called CC=1 SCAR=6.9
Pod undocumented
44 0 my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
45 0 @dirs = grep { -d } @dirs;
46  
47 if ($recurse) {
48 require File::Find;
49 my %test_dir;
50 File::Find::find(_wanted(\%test_dir), @dirs);
51 $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir );
52 } else {
53 $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs );
54 }
55 }
56  
57 0 ▶#line 107
Subroutine recursive_author_tests: not called CC=1 SCAR=6.9
Pod undocumented
58 0  
59 0 1;
« inc/Module/Install/ReadmeFromPod.pm ↑ Summary blib/lib/Module/Install/ReadmePodFromPod.pm »