blib/lib/Dist/Zilla/Role/BuildPL.pm

filter: Statementstmt 39.2% 11 / 28 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 21.8% 14 / 64 CC 11 SCAR 35.9
CC
11
Cov
22%
test
56.0
build
30.0
BEGIN
1.0
CRAP 36.3
« blib/lib/Dist/Zilla/Dist/Builder.pm ↑ Summary blib/lib/Dist/Zilla/Chrome/Term.pm »
1 package Dist::Zilla::Role::BuildPL 6.040;
2 # ABSTRACT: Common ground for Build.PL based builders
3  
4 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 with 'Dist::Zilla::Role::InstallTool',
6 'Dist::Zilla::Role::BuildRunner',
7 'Dist::Zilla::Role::TestRunner';
8  
9 3 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 #pod =head1 DESCRIPTION
14 #pod
15 #pod This role is a helper for Build.PL based installers. It implements the
16 #pod L<Dist::Zilla::Plugin::BuildRunner> and L<Dist::Zilla::Plugin::TestRunner>
17 #pod roles, and requires you to implement the L<Dist::Zilla::Plugin::PrereqSource>
18 #pod and L<Dist::Zilla::Plugin::InstallTool> roles yourself.
19 #pod
20 #pod =cut
21  
22 0 ▶sub build {
Subroutine build: not called CC=5 SCAR=34.0
Pod undocumented
23 0 my $self = shift;
24  
25 return
26 0 ▶ if -e 'Build' and (stat 'Build.PL')[9] <= (stat 'Build')[9];
Branch: 1 branch
BranchTrueFalseTotal
if -e "Build" and (stat "Build.PL")[9] <= (stat "Build")[9] 0 0 0
Condition0%0/3
-e "Build" and (stat "Build.PL")[9] <= (stat "Build")[9]
!ll&&!rl&&r
000
MC/DC0%0/2
-e "Build" and (stat "Build.PL")[9] <= (stat "Build")[9]
-e "Build" (stat "Build.PL")[9] <= (stat "Build")[9]
Truth table0%0/3
A and B
A= -e "Build"B= (stat "Build.PL")[9] <= (stat "Build")[9]
ABresult
0X0
100
111
27  
28 0 $self->log_debug("running $^X Build.PL");
29 0 ▶ system $^X, 'Build.PL' and die "error with Build.PL\n";
Branch: 1 branch
BranchTrueFalseTotal
system $^X, "Build.PL" and die "error with Build.PL\n" 0 0 0
30  
31 0 $self->log_debug("running $^X Build");
32 0 ▶ system $^X, 'Build' and die "error running $^X Build\n";
Branch: 1 branch
BranchTrueFalseTotal
system $^X, "Build" and die "error running $^X Build\n" 0 0 0
33  
34 0 return;
35 }
36  
37 0 ▶sub test {
Subroutine test: not called CC=7 SCAR=40.3
Pod undocumented
38 0 my ($self, $target, $arg) = @_;
39  
40 0 $self->build;
41  
42 my $job_count = $arg && exists $arg->{jobs}
43 ? $arg->{jobs}
44 0 ▶ : $self->default_jobs;
Branch: 1 branch
BranchTrueFalseTotal
$arg && exists $arg->{'jobs'} ? : 0 0 0
Condition0%0/3
$arg and exists $arg->{"jobs"}
!ll&&!rl&&r
000
MC/DC0%0/2
$arg and exists $arg->{"jobs"}
$arg exists $arg->{"jobs"}
Truth table0%0/3
A and B
A= $argB= exists $arg->{"jobs"}
ABresult
0X0
100
111
45 0 my $jobs = "j$job_count";
46 0 my $ho = "HARNESS_OPTIONS";
47 0 ▶ local $ENV{$ho} = $ENV{$ho} ? "$ENV{$ho}:$jobs" : $jobs;
Branch: 1 branch
BranchTrueFalseTotal
$ENV{$ho} ? : 0 0 0
48  
49 0 ▶ my @testing = $self->zilla->logger->get_debug || $arg->{test_verbose} ? '--verbose' : ();
Branch: 1 branch
BranchTrueFalseTotal
$self->zilla->logger->get_debug || $arg->{'test_verbose'} ? : 0 0 0
Condition0%0/3
$self->zilla->logger->get_debug or $arg->{"test_verbose"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->zilla->logger->get_debug or $arg->{"test_verbose"}
$self->zilla->logger->get_debug $arg->{"test_verbose"}
Truth table0%0/3
A or B
A= $self->zilla->logger->get_debugB= $arg->{"test_verbose"}
ABresult
1X1
011
000
50  
51 0 $self->log_debug('running ' . join(' ', $^X, 'Build', 'test', @testing));
52 0 ▶ system $^X, 'Build', 'test', @testing and die "error running $^X Build test\n";
Branch: 1 branch
BranchTrueFalseTotal
system $^X, "Build", "test", @testing and die "error running $^X Build test\n" 0 0 0
53  
54 0 return;
55 }
56  
57 3 1;
58  
59 __END__
« blib/lib/Dist/Zilla/Dist/Builder.pm ↑ Summary blib/lib/Dist/Zilla/Chrome/Term.pm »