Branch Coverage

blib/lib/MCE/Step.pm
Criterion Covered Total %
branch 116 238 48.7


line true false branch
30 0 0 if $INC{'threads.pm'}
52 12 0 unless ($_pkg =~ /^MCE::/)
63 0 0 if $_arg eq "max_workers"
64 0 0 if $_arg eq "chunk_size"
65 0 0 if $_arg eq "tmp_dir"
66 0 0 if $_arg eq "freeze"
67 0 0 if $_arg eq "thaw"
68 0 0 if $_arg eq "init_relay"
69 0 0 if $_arg eq "use_threads"
71 0 0 if $_arg eq "fast"
74 0 0 if ($_arg eq "sereal")
75 0 0 if (shift() eq 0)
90 0 12 unless $_p->{'CHUNK_SIZE'} eq "auto"
106 10 12 if (defined $_mce->{'user_tasks'}[$_task_id + 1])
112 0 22 if exists $_params->{'task_end'} and ref $_params->{'task_end'} eq "CODE"
128 0 21 ref $x ? :
132 0 21 unless $self->{'_wid'}
136 21 0 if ($_task_id < $_last_task_id->{$_pid}) { }
150 0 0 ref $x ? :
155 0 0 unless $self->{'_wid'}
157 0 0 unless defined $_name and exists $_lkup->{$_pid}{$_name}
159 0 0 if $_lkup->{$_pid}{$_name} <= $self->{'_task_id'}
163 0 0 if ($_task_id < $_last_task_id->{$_pid}) { }
164 0 0 if (scalar @_ > 1) { }
183 0 0 ref $x ? :
188 0 0 unless $self->{'_wid'}
190 0 0 unless defined $_name and exists $_lkup->{$_pid}{$_name}
192 0 0 if $_lkup->{$_pid}{$_name} <= $self->{'_task_id'}
193 0 0 if not &looks_like_number($_p) or int $_p != $_p
198 0 0 if ($_task_id < $_last_task_id->{$_pid}) { }
199 0 0 if (scalar @_ > 1) { }
218 0 0 ref $x ? :
223 0 0 unless $self->{'_wid'}
225 0 0 unless defined $_name and exists $_lkup->{$_pid}{$_name}
227 0 0 if $_lkup->{$_pid}{$_name} <= $self->{'_task_id'}
231 0 0 if not &looks_like_number($_t) or int $_t != $_t
234 0 0 if ($_task_id < $_last_task_id->{$_pid}) { }
253 13 0 if defined $_[0] and $_[0] eq "MCE::Step"
256 0 13 ref $_[0] eq 'HASH' ? :
265 25 0 if defined $_[0] and $_[0] eq "MCE::Step"
266 21 4 defined $_[0] ? :
268 12 13 if ($_pkg eq 'MCE') { }
4 9 elsif ($_MCE->{$_pkg} and $_MCE->{$_pkg}{'_init_pid'} eq "$$.$_tid") { }
272 4 0 if $_MCE->{$_pkg}{'_spawned'}
284 4 0 if (defined $_queue->{$_pkg})
304 0 4 if defined $_[0] and $_[0] eq "MCE::Step"
306 4 0 ref $_[0] eq 'HASH' ? :
309 4 0 if (defined(my $_p = $_params->{$_pid})) { }
310 0 4 if exists $_p->{'input_data'}
311 0 4 if exists $_p->{'sequence'}
319 2 4 if ($_r eq "" or $_r eq "SCALAR" or $_r =~ /^(?:GLOB|FileHandle|IO::)/)
325 2 2 if (defined $_file and ref $_file eq '' and $_file ne '') { }
2 0 elsif (ref $_file eq 'SCALAR' or ref($_file) =~ /^(?:GLOB|FileHandle|IO::)/) { }
326 0 2 unless -e $_file
327 0 2 unless -r $_file
328 0 2 unless -f $_file
338 4 0 if (defined $_pos)
353 0 2 if defined $_[0] and $_[0] eq "MCE::Step"
355 2 0 ref $_[0] eq 'HASH' ? :
358 2 0 if (defined(my $_p = $_params->{$_pid})) { }
359 0 2 if exists $_p->{'sequence'}
360 0 2 if exists $_p->{'input_data'}
361 0 2 if exists $_p->{'_file'}
370 0 2 if ($_r eq "" or $_r =~ /^Math::/ or $_r eq "HASH" or $_r eq "ARRAY")
373 2 0 if ($_r eq '' or $_r =~ /^Math::/) { }
0 0 elsif ($_r eq 'HASH') { }
0 0 elsif ($_r eq 'ARRAY') { }
393 0 2 unless exists $_params->{$_pid}{'sequence'}
394 0 2 unless defined $_begin
396 0 2 unless defined $_end
401 2 0 if (defined $_pos)
416 0 21 if defined $_[0] and $_[0] eq "MCE::Step"
418 6 15 caller() eq 'MCE::Step' ? :
421 14 7 if (ref $_[0] eq "HASH")
422 0 14 unless defined $_params->{$_pid}
439 35 0 if (defined(my $_p = $_params->{$_pid}))
441 28 7 ref $_p->{'task_name'} eq 'ARRAY' ? :
443 0 35 ref $_p->{'use_threads'} eq 'ARRAY' ? :
445 28 7 ref $_p->{'max_workers'} eq 'ARRAY' ? :
448 28 7 if defined $_name[$_pos]
452 19 16 if not defined $_prev_c->{$_pid}[$_pos] or $_prev_c->{$_pid}[$_pos] != $_code[$_pos]
455 12 23 if $_prev_n->{$_pid}[$_pos] ne $_name[$_pos]
456 0 35 if $_prev_t->{$_pid}[$_pos] ne $_thrs[$_pos]
457 12 23 if $_prev_w->{$_pid}[$_pos] ne $_wrks[$_pos]
467 0 21 if (defined $_prev_c->{$_pid}[$_pos])
476 0 21 unless scalar @_code
483 4 17 if (@_ == 1 and $_r =~ /^(?:ARRAY|HASH|SCALAR|GLOB|FileHandle|IO::)/)
487 21 0 if (defined(my $_p = $_params->{$_pid}))
489 7 14 if exists $_p->{'max_workers'} and ref $_p->{'max_workers'} ne "ARRAY"
491 10 11 if defined $_input_data or scalar @_
492 0 21 if exists $_p->{'user_func'}
493 0 21 if exists $_p->{'user_tasks'}
496 14 7 if (@_code > 1 and $_max_workers > 1)
505 21 0 if (defined(my $_p = $_params->{$_pid}))
506 4 17 if (exists $_p->{'_file'}) { }
509 0 17 if exists $_p->{'input_data'}
517 13 8 if ($_init_mce or not exists $_queue->{$_pid}) { }
518 0 13 if defined $_MCE->{$_pid}
519 13 0 unless defined $_queue->{$_pid}
539 13 0 if (defined(my $_p = $_params->{$_pid}))
543 6 19 if $_ eq "max_workers" and ref $_p->{'max_workers'} eq "ARRAY"
544 6 13 if $_ eq "task_name" and ref $_p->{'task_name'} eq "ARRAY"
545 0 13 if $_ eq "use_threads" and ref $_p->{'use_threads'} eq "ARRAY"
547 0 13 if $_ eq "chunk_size"
548 0 13 if $_ eq "input_data"
549 0 13 if $_ eq "sequence_run"
550 0 13 if $_ eq "task_end"
553 0 13 unless exists $MCE::_valid_fields_new{$_}
561 0 65 if exists $_def->{$_pkg}{uc $_k} and not exists $_opts{$_k}
569 8 0 if (defined(my $_p = $_params->{$_pid}))
575 8 120 if exists $_p->{$_k}
582 7 14 if defined $_wa
584 8 13 if (defined $_input_data) { }
6 7 elsif (scalar @_) { }
594 2 5 if (defined $_params->{$_pid} and exists $_params->{$_pid}{'sequence'}) { }
599 2 0 if (exists $_params->{$_pid}{'sequence_run'})
613 0 12 unless ($_MCE->{$_pid}{'_spawned'})
618 2 10 if defined $_wa
620 2 10 defined $_wa ? :