ShipIt/ProjectType/Perl/MakeMaker.pm

filter: Statementstmt 41.8% 23 / 55 Branchbran 12.5% 3 / 24 Conditioncond 16.6% 1 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 54.5% 6 / 11 Podpod 40.0% 2 / 5 totaltotal 33.3% 35 / 105 CC 15 SCAR 28.9
CC
15
Cov
32%
disttest
42.0
makedist
30.0
prepare_build
6.0
CRAP 18.1
« ShipIt/ProjectType.pm ↑ Summary ShipIt/Step/AddToSVNDir.pm »
1 package ShipIt::ProjectType::Perl::MakeMaker;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use base 'ShipIt::ProjectType::Perl';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use ExtUtils::Manifest qw(manicheck skipcheck filecheck);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use ShipIt::Util qw(make_var);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub new {
Subroutine new: called CC=5 SCAR=17.5
Pod undocumented
9 2 my ($class) = @_;
10 2 my $self = $class->SUPER::new;
11 2 ▶ my $make = $Config{make} or die "You don't have make";
Branch: 1 branch
BranchTrueFalseTotal
my $make = $ShipIt::ProjectType::Perl::MakeMaker::Config{"make"} or die "You don't have make" 2 0 2
12 2 ▶ my $quot = $^O eq 'MSWin32' ? q/"/ : q/'/;
Branch: 1 branch
BranchTrueFalseTotal
$^O eq 'MSWin32' ? : 0 2 2
13 2 ▶ $make = "$quot$make$quot" if $make =~ /\s/ && $make !~ /^$quot/;
Branch: 1 branch
BranchTrueFalseTotal
if $make =~ /\s/ and not $make =~ /^$quot/ 0 2 2
Condition33%1/3
$make =~ /\s/ and not $make =~ /^$quot/
!ll&&!rl&&r
200
MC/DC0%0/2
$make =~ /\s/ and not $make =~ /^$quot/
$make =~ /\s/ not $make =~ /^$quot/
Truth table33%1/3
A and not(B)
A= $make =~ /\s/B= not $make =~ /^$quot/
ABresult
0X0
100
111
14 2 $self->{make} = $make;
15 2 return $self;
16 }
17  
18 0 ▶sub prepare_build {
Subroutine prepare_build: not called CC=2 SCAR=17.9
Pod undocumented
19 0 my $self = shift;
20 0 ▶ system("perl", "Makefile.PL") and die "Makefile.PL failed";
Branch: 1 branch
BranchTrueFalseTotal
system "perl", "Makefile.PL" and die "Makefile.PL failed" 0 0 0
21 }
22  
23 0 ▶sub run_build {
Subroutine run_build: not called CC=1 SCAR=6.9
Pod undocumented
24 0 my $self = shift;
25 0 my($cmd) = @_;
26  
27 0 !system($self->{make}, $cmd);
28 }
29  
30 # returns 1 if a make disttest succeeds.
31 0 ▶sub disttest {
Subroutine disttest: not called CC=6 SCAR=37.4
Pod documented
32 0 my $self = shift;
33  
34 0 $self->prepare_build;
35 0 ▶ $self->run_build('disttest') or die "Disttest failed";
Branch: 1 branch
BranchTrueFalseTotal
$self->run_build("disttest") or die "Disttest failed" 0 0 0
36 0 ▶ $self->run_build('distclean') or die "Distclean failed";
Branch: 1 branch
BranchTrueFalseTotal
$self->run_build("distclean") or die "Distclean failed" 0 0 0
37  
38 0 my @missing = manicheck;
39 0 my @extra = filecheck;
40  
41 # Module::Install creates inc/ in perl Makefile.PL and META.yml in make
42 0 my $missing_ignore = join "|", qw( ^META\.yml$ ^inc/ );
43 0 @missing = grep { $_ !~ $missing_ignore } @missing;
44  
45 # I'm getting sick of making MANIFEST.SKIP files just for the
46 # .shipit conf file and dh-make-perl stuff, so let's ignore those
47 0 my %ignore = map { $_ => 1 } qw(
48 .shipit
49 install-stamp
50 build-stamp
51 );
52 0 ▶ @extra = grep { ! ($ignore{$_} || /^\.git/) } @extra;
Condition0%0/3
$ignore{$_} || /^\.git/
l!l&&r!l&&!r
000
MC/DC0%0/2
$ignore{$_} || /^\.git/
$ignore{$_} /^\.git/
Truth table0%0/3
A || B
A= $ignore{$_}B= /^\.git/
ABresult
1X1
011
000
53  
54 0 ▶ my $list = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
55 0 join('', map { "$_\n" } @_);
56 0 };
57  
58 0 ▶ die "Missing files in MANIFEST, not on disk:\n\n" . $list->(@missing) if @missing;
Branch: 1 branch
BranchTrueFalseTotal
if @missing 0 0 0
59 0 ▶ die "Extra files on disk, not in MANIFEST:\n\n" . $list->(@extra) if @extra;
Branch: 1 branch
BranchTrueFalseTotal
if @extra 0 0 0
60  
61 0 return 1;
62 }
63  
64 0 ▶sub makedist {
Subroutine makedist: not called CC=5 SCAR=34.0
Pod documented
65 0 my $self = shift;
66 0 $self->prepare_build;
67  
68 0 ▶ my $file = make_var("DISTVNAME") or die "No DISTVNAME in Makefile";
Branch: 1 branch
BranchTrueFalseTotal
my $file = make_var("DISTVNAME") or die "No DISTVNAME in Makefile" 0 0 0
69 0 $file .= ".tar.gz";
70 0 ▶ die "Distfile $file already exists.\n" if -e $file;
Branch: 1 branch
BranchTrueFalseTotal
if -e $file 0 0 0
71  
72 0 ▶ $self->run_build("dist") or die "make dist failed";
Branch: 1 branch
BranchTrueFalseTotal
$self->run_build("dist") or die "make dist failed" 0 0 0
73 0 ▶ die "Distfile $file doesn't exists, but should.\n" unless -e $file;
Branch: 1 branch
BranchTrueFalseTotal
unless -e $file 0 0 0
74 0 return $file;
75 }
76  
77 2 1;
78  
« ShipIt/ProjectType.pm ↑ Summary ShipIt/Step/AddToSVNDir.pm »