blib/lib/Dist/Zilla/Plugin/MakeMaker/Runner.pm

filter: Statementstmt 100% 35 / 35 Branchbran 50.0% 9 / 18 Conditioncond 36.3% 4 / 11 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 68.3% 54 / 79 CC 13 SCAR 19.9
CC
13
Cov
75%
test
10.7
build
7.0
BEGIN
1.0
CRAP 7.3
« blib/lib/Dist/Zilla/Plugin/Prereqs.pm ↑ Summary blib/lib/Test/DZil.pm »
1 package Dist::Zilla::Plugin::MakeMaker::Runner 6.040;
2 # ABSTRACT: Test and build dists with a Makefile.PL
3  
4 13 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 with(
6 'Dist::Zilla::Role::BuildRunner',
7 'Dist::Zilla::Role::TestRunner',
8 );
9  
10 13 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 13 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 13 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 has 'make_path' => (
17 isa => 'Str',
18 is => 'ro',
19 13 ▶ default => $Config{make} || 'make',
Condition50%1/2
$Dist::Zilla::Plugin::MakeMaker::Runner::Config{'make'} || 'make'
l!l
130
MC/DC0%0/1
$Dist::Zilla::Plugin::MakeMaker::Runner::Config{'make'} || 'make'
$Dist::Zilla::Plugin::MakeMaker::Runner::Config{'make'}
Truth table50%1/2
A
A= $Dist::Zilla::Plugin::MakeMaker::Runner::Config{'make'}
Aresult
11
00
20 );
21  
22 2 ▶sub build {
Subroutine build: called CC=6 SCAR=19.4
Pod undocumented
23 2 my $self = shift;
24  
25 2 my $make = $self->make_path;
26  
27 2 ▶ my $makefile = $^O eq 'VMS' ? 'Descrip.MMS' : 'Makefile';
Branch: 1 branch
BranchTrueFalseTotal
$^O eq 'VMS' ? : 0 2 2
28  
29 return
30 2 ▶ if -e $makefile and (stat 'Makefile.PL')[9] <= (stat $makefile)[9];
Branch: 1 branch
BranchTrueFalseTotal
if -e $makefile and (stat "Makefile.PL")[9] <= (stat $makefile)[9] 0 2 2
Condition33%1/3
-e $makefile and (stat "Makefile.PL")[9] <= (stat $makefile)[9]
!ll&&!rl&&r
200
MC/DC0%0/2
-e $makefile and (stat "Makefile.PL")[9] <= (stat $makefile)[9]
-e $makefile (stat "Makefile.PL")[9] <= (stat $makefile)[9]
Truth table33%1/3
A and B
A= -e $makefileB= (stat "Makefile.PL")[9] <= (stat $makefile)[9]
ABresult
0X0
100
111
31  
32 2 $self->log_debug("running $^X Makefile.PL");
33 2 ▶ system($^X => qw(Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none)) and die "error with Makefile.PL\n";
Branch: 1 branch
BranchTrueFalseTotal
system $^X, ("Makefile.PL", "INSTALLMAN1DIR=none", "INSTALLMAN3DIR=none") and die "error with Makefile.PL\n" 0 2 2
34  
35 2 $self->log_debug("running $make");
36 2 ▶ system($make) and die "error running $make\n";
Branch: 1 branch
BranchTrueFalseTotal
system $make and die "error running $make\n" 0 2 2
37  
38 2 return;
39 }
40  
41 2 ▶sub test {
Subroutine test: called CC=8 SCAR=23.7
Pod undocumented
42 2 my ($self, $target, $arg) = @_;
43  
44 2 my $make = $self->make_path;
45 2 $self->build;
46  
47 my $job_count = $arg && exists $arg->{jobs}
48 ? $arg->{jobs}
49 2 ▶ : $self->default_jobs;
Branch: 1 branch
BranchTrueFalseTotal
$arg && exists $arg->{'jobs'} ? : 0 2 2
Condition33%1/3
$arg and exists $arg->{"jobs"}
!ll&&!rl&&r
200
MC/DC0%0/2
$arg and exists $arg->{"jobs"}
$arg exists $arg->{"jobs"}
Truth table33%1/3
A and B
A= $argB= exists $arg->{"jobs"}
ABresult
0X0
100
111
50  
51 2 my $jobs = "j$job_count";
52 2 my $ho = "HARNESS_OPTIONS";
53 2 ▶ local $ENV{$ho} = $ENV{$ho} ? "$ENV{$ho}:$jobs" : $jobs;
Branch: 1 branch
BranchTrueFalseTotal
$ENV{$ho} ? : 0 2 2
54  
55 2 ▶ $self->log_debug(join(' ', "running $make test", ( $self->zilla->logger->get_debug ? 'TEST_VERBOSE=1' : () )));
Branch: 1 branch
BranchTrueFalseTotal
$self->zilla->logger->get_debug ? : 0 2 2
56 system($make, 'test',
57 2 ▶ ( $self->zilla->logger->get_debug || $arg->{test_verbose} ? 'TEST_VERBOSE=1' : () ),
Branch: 2 branches
BranchTrueFalseTotal
system $make, "test", $self->zilla->logger->get_debug || $arg->{"test_verbose"} ? "TEST_VERBOSE=1" : () and die "error running $make test\n" 0 2 2
$self->zilla->logger->get_debug || $arg->{'test_verbose'} ? : 0 2 2
Condition33%1/3
$self->zilla->logger->get_debug or $arg->{"test_verbose"}
l!l&&r!l&&!r
002
MC/DC0%0/2
$self->zilla->logger->get_debug or $arg->{"test_verbose"}
$self->zilla->logger->get_debug $arg->{"test_verbose"}
Truth table33%1/3
A or B
A= $self->zilla->logger->get_debugB= $arg->{"test_verbose"}
ABresult
1X1
011
000
58 ) and die "error running $make test\n";
59  
60 2 return;
61 }
62  
63 13 __PACKAGE__->meta->make_immutable;
64 13 1;
65  
66 __END__
« blib/lib/Dist/Zilla/Plugin/Prereqs.pm ↑ Summary blib/lib/Test/DZil.pm »