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

filter: Statementstmt 78.9% 15 / 19 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 72.4% 21 / 29 CC 3 SCAR 8.1
CC
3
Cov
74%
__ANON__
3.6
__ANON__
2.0
BEGIN
1.0
CRAP 2.2
« blib/lib/Dist/Zilla/Plugin/InlineFiles.pm ↑ Summary blib/lib/Dist/Zilla/Role/File.pm »
1 package Dist::Zilla::Role::TestRunner 6.040;
2 # ABSTRACT: something used as a delegating agent to 'dzil test'
3  
4 14 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 14 with 'Dist::Zilla::Role::Plugin';
6  
7 14 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 14 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 #pod =head1 DESCRIPTION
12 #pod
13 #pod Plugins implementing this role have their C<test> method called when
14 #pod testing. It's passed the root directory of the build test dir and an
15 #pod optional hash reference of arguments. Valid arguments include:
16 #pod
17 #pod =for :list
18 #pod * jobs -- if parallel testing is supported, this indicates how many to run at once
19 #pod
20 #pod =method test
21 #pod
22 #pod This method should throw an exception on failure.
23 #pod
24 #pod =cut
25  
26 14 requires 'test';
27  
28 #pod =attr default_jobs
29 #pod
30 #pod This attribute is the default value that should be used as the C<jobs> argument
31 #pod to the C<test> method.
32 #pod
33 #pod =cut
34  
35 has default_jobs => (
36 is => 'ro',
37 isa => 'Int', # non-negative
38 lazy => 1,
39 2 ▶ default => sub {
Subroutine __ANON__: called CC=3 SCAR=12.7
40 2 ▶ return ($ENV{HARNESS_OPTIONS} // '') =~ / \b j(\d+) \b /x ? $1 : 1;
Branch: 1 branch
BranchTrueFalseTotal
($ENV{'HARNESS_OPTIONS'} // '') =~ / \b j(\d+) \b /ux ? : 0 2 2
Condition50%1/2
$ENV{"HARNESS_OPTIONS"} // ""
l!l
20
MC/DC0%0/1
$ENV{"HARNESS_OPTIONS"} // ""
$ENV{"HARNESS_OPTIONS"}
Truth table50%1/2
A
A= $ENV{"HARNESS_OPTIONS"}
Aresult
11
00
41 },
42 14 );
43  
44 0 ▶around dump_config => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
45 0 my ($orig, $self) = @_;
46 0 my $config = $self->$orig;
47  
48 0 $config->{'' . __PACKAGE__} = { default_jobs => $self->default_jobs };
49  
50 0 return $config;
51 14 };
52  
53 14 1;
54  
55 __END__
« blib/lib/Dist/Zilla/Plugin/InlineFiles.pm ↑ Summary blib/lib/Dist/Zilla/Role/File.pm »