| 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
Condition50%1/2
$ENV{"HARNESS_OPTIONS"} // ""
MC/DC0%0/1
$ENV{"HARNESS_OPTIONS"} // ""
$ENV{"HARNESS_OPTIONS"}
Truth table50%1/2
A
A= $ENV{"HARNESS_OPTIONS"}
| |||||||||||||||||||||
| 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__ | ||||||||||||||||||||