lib/Siesta/Build.pm

filter: Statementstmt 30.1% 19 / 63 Branchbran 0.0% 0 / 18 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 46.1% 6 / 13 Podpod 0.0% 0 / 5 totaltotal 24.0% 25 / 104 CC 12 SCAR 29.4
CC
12
Cov
23%
create_build_script
42.0
__ANON__
30.0
ACTION_install_extras
12.0
CRAP 18.8
« bin/nacho ↑ Summary blib/lib/Siesta/Plugin/Resume.pm »
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Siesta::Build;
3 2 ▶use Module::Build;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use File::Find qw(find);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use IO::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use base 'Module::Build';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use vars qw/$FAKE/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub create_build_script {
Subroutine create_build_script: not called CC=6 SCAR=37.4
Pod undocumented
10 0 my $self = shift;
11 0 $self->SUPER::create_build_script;
12  
13 # check for incompatible steps
14 0 my $module = $self->{properties}{module_name};
15 0 ▶ if (my $version = $self->check_installed_version($module, 0)) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $version = $self->check_installed_version($module, 0)) 0 0 0
16 0 print "Upgrading from $module $version\n";
17 0 my $fh = IO::File->new('Changes');
18 0 my $chunk = '';
19 0 my $this;
20 0 ▶ while (<$fh>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $fh)) 0 0 0
21 0 ▶ if (/^(\S+)/) {
Branch: 1 branch
BranchTrueFalseTotal
if (/^(\S+)/) 0 0 0
22 0 ▶ print "Incompatible change introduced in version $this:\n", $chunk
Branch: 1 branch
BranchTrueFalseTotal
if $chunk =~ /INCOMPATIBLE/ 0 0 0
23 if $chunk =~ /INCOMPATIBLE/;
24 0 $this = $1;
25 0 ▶ last if $self->check_installed_version( $module, $this );
Branch: 1 branch
BranchTrueFalseTotal
if $self->check_installed_version($module, $this) 0 0 0
26 0 $chunk = '';
27 }
28 0 $chunk .= $_;
29 }
30 }
31 }
32  
33 0 ▶sub ACTION_install {
Subroutine ACTION_install: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my $self = shift;
35 0 $self->SUPER::ACTION_install;
36 0 $self->ACTION_install_extras;
37 }
38  
39 0 ▶sub ACTION_fakeinstall {
Subroutine ACTION_fakeinstall: not called CC=1 SCAR=6.9
Pod undocumented
40 0 my $self = shift;
41 0 $self->SUPER::ACTION_fakeinstall;
42 0 local $FAKE = 1;
43 0 $self->ACTION_install_extras;
44 }
45  
46 0 ▶sub ACTION_install_extras {
Subroutine ACTION_install_extras: not called CC=3 SCAR=24.8
Pod undocumented
47 0 my $self = shift;
48 0 my $path = $self->{config}{__extras_destination};
49 0 my @files = $self->_find_extras;
50 0 print "installing extras to $path\n";
51 0 for (@files) {
52 0 ▶ $FAKE
Branch: 1 branch
BranchTrueFalseTotal
$Siesta::Build::FAKE ? : 0 0 0
53 ? print "$_ -> $path/$_ (FAKE)\n"
54 : $self->copy_if_modified($_, $path);
55 }
56 }
57  
58 0 ▶sub ACTION_cover {
Subroutine ACTION_cover: not called CC=1 SCAR=6.9
Pod undocumented
59 0 my $self = shift;
60 0 $self->depends_on('build');
61 0 system qw( cover -delete );
62  
63 # sometimes we get failing tests, which makes Test::Harness
64 # die. catch that
65 0 eval {
66 0 local $ENV{PERL5OPT} = "-MDevel::Cover=-summary,0";
67 0 $self->ACTION_test(@_);
68 };
69 0 system qw( cover -report html );
70 }
71  
72 0 ▶sub _find_extras {
Subroutine _find_extras: not called CC=1 SCAR=6.9
73 0 my $self = shift;
74 0 my @files;
75 0 ▶ find(sub {
Subroutine __ANON__: not called CC=5 SCAR=34.0
76 0 ▶ $File::Find::prune = 1 if -d && /^\.svn$/;
Branch: 1 branch
BranchTrueFalseTotal
if -d $_ and /^\.svn$/ 0 0 0
Condition0%0/3
-d $_ and /^\.svn$/
!ll&&!rl&&r
000
MC/DC0%0/2
-d $_ and /^\.svn$/
-d $_ /^\.svn$/
Truth table0%0/3
A and B
A= -d $_B= /^\.svn$/
ABresult
0X0
100
111
77 0 ▶ return if -d;
Branch: 1 branch
BranchTrueFalseTotal
if -d $_ 0 0 0
78 0 ▶ return if /~$/;
Branch: 1 branch
BranchTrueFalseTotal
if /~$/ 0 0 0
79 0 push @files, $File::Find::name;
80 0 }, @{ $self->{config}{__extras_from} });
81 0 return @files;
82 }
83  
84 2 1;
« bin/nacho ↑ Summary blib/lib/Siesta/Plugin/Resume.pm »