Branch Coverage

blib/lib/MCE/Core/Manager.pm
Criterion Covered Total %
branch 88 286 30.7


line true false branch
33 0 0 $^O eq 'solaris' ? :
85 0 $INC{'POSIX.pm'} ? :
49 180 34 if (defined $self->{'user_tasks'}) { }
0 34 elsif (defined $self->{'task_end'}) { }
52 0 180 exists $self->{'user_tasks'}[$_task_id]{'task_end'} ? :
54 144 36 if (defined $_task_end)
57 144 0 exists $self->{'user_tasks'}[$_task_id]{'task_name'} ? :
90 0 0 unless ($_sendto_fhs{$_fd})
93 0 0 unless $_sendto_fhs{$_fd}->fdopen($_fd, "w")
98 0 0 if (not exists $self->{'flush_file'} or $self->{'flush_file'})
130 0 285 if $_O_FLG
131 0 285 if $_I_FLG
135 274 11 if ($_wa == 0) { }
2 9 elsif ($_wa == 1) { }
166 347 81 if ($_has_user_tasks and $_task_id >= 0)
172 347 81 $_has_user_tasks ? :
174 0 282 if ($_task_id == 0 and defined $_syn_flag and $_sync_cnt)
175 0 0 if ($_sync_cnt == $_total_running)
183 214 214 unless $_total_running
197 0 0 if ($_has_user_tasks and $_task_id >= 0)
204 0 0 $_has_user_tasks ? :
206 0 0 if ($_task_id == 0 and defined $_syn_flag and $_sync_cnt)
207 0 0 if ($_sync_cnt == $_total_running)
223 0 0 if $_len
227 0 0 if $_len
229 0 0 if (abs $_exit_status > abs $self->{'_wrk_status'})
237 0 0 if ($_exit_pid =~ /^PID_(-?\d+)/) { }
0 0 elsif ($_exit_pid =~ /^TID_(\d+)/) { }
240 0 0 if ($_list->[$i] and $_list->[$i] == $_pid)
250 0 0 if ($_list->[$i] and $_list->[$i] == $_tid)
262 0 0 if (defined $_on_post_exit) { }
0 0 elsif (defined $_on_post_run) { }
265 0 0 if (length $_retry_buf) { }
292 0 0 unless $_total_running
302 80 296 if ($_offset_pos >= $_input_size or $_aborted)
303 0 80 if defined $\
309 229 67 if ($_single_dim and $_cs_one_flag) { }
313 54 13 if ($_offset_pos + $_chunk_size - 1 < $_input_size) { }
325 0 296 if defined $\
339 36 18 if ($_eof_flag or $_aborted)
340 0 36 if defined $\
347 0 18 if $_RS_FLG
349 0 18 if ($_chunk_size <= 8192) { }
350 0 0 if ($_chunk_size == 1) { }
351 0 0 $_input_glob->can('getline') ? :
353 0 0 unless length $_buf
358 0 0 $_input_glob->can('getline') ? :
361 0 0 if ($_len == $_last_len)
370 18 0 if ($_input_glob->can('getline') and $_input_glob->can('read')) { }
371 0 18 if ($_input_glob->read($_buf, $_chunk_size) == $_chunk_size) { }
373 0 0 if length $_buf == $_chunk_size
379 0 0 if (read($_input_glob, $_buf, $_chunk_size) == $_chunk_size) { }
381 0 0 if length $_buf == $_chunk_size
389 0 18 if defined $\
391 18 0 if ($_len) { }
405 3 15 if ($_offset_pos >= $_input_size or $_aborted)
406 0 3 if defined $\
412 12 3 if ($_offset_pos + $_chunk_size - 1 < $_input_size) { }
425 0 15 if defined $\
435 0 0 if ($_aborted)
436 0 0 if defined $\
444 0 0 if (@_ret_a > 1 or defined $_ret_a[0])
446 0 0 if defined $\
452 0 0 if defined $\
487 579 529 if ($_is_c_ref[$_task_id]) { }
0 529 elsif ($_is_h_ref[$_task_id]) { }
379 150 elsif ($_is_q_ref[$_task_id]) { }
496 0 0 unless @{$_;}
517 0 0 if (defined $_user_output) { }
534 0 0 if (defined $_user_error) { }
554 0 0 unless (exists $_sendto_fhs{$_file})
555 0 0 unless open $_sendto_fhs{$_file}, ">>", "$_file"
560 0 0 if (not exists $self->{'flush_file'} or $self->{'flush_file'})
595 0 0 if (not defined $_sync_cnt or $_sync_cnt == 0)
601 0 0 $_has_user_tasks ? :
603 0 0 if (++$_sync_cnt == $_total_running)
614 0 0 if (--$_sync_cnt == 0)
617 0 0 $_has_user_tasks ? :
630 0 0 unless $_win32_ipc
665 0 0 $_has_user_tasks ? :
671 0 0 $_tasks && exists $_tasks->[$_task_id]{'interval'} ? :
673 0 0 if (not $_interval) { }
0 0 elsif ($_interval->{'max_nodes'} == 1) { }
681 0 0 if (not $_delay && defined $_lapse) { }
0 0 elsif ($_lapse + $_delay - $_time < 0) { }
694 0 0 $_tasks ? :
696 0 0 if (++$_delay_wid[$_task_id] > $_max_workers)
710 0 0 if ($_delay < 0 and $_app_tb)
713 0 0 if $_count > "2000000000"
718 0 0 $_delay > 0 ? :
731 108 34 defined $self->{'user_tasks'} ? :
732 60 82 $self->{'chunk_size'} == 1 ? :
743 0 142 if (defined $_max_retries and not $_on_post_exit)
747 0 0 if ($_e->{'id'})
751 0 0 if (defined $self->{'init_relay'}) { }
752 0 0 if $_retry_cnt < $_max_retries
758 0 0 $_retry_cnt < $_max_retries ? :
766 0 108 if ($_has_user_tasks and $self->{'user_tasks'}[0]{'chunk_size'})
770 108 34 if ($_has_user_tasks)
773 102 78 defined $self->{'user_tasks'}[$_i]{'gather'} ? :
775 91 89 ref $_gather[$_i] eq 'CODE' ? :
776 0 180 ref $_gather[$_i] eq 'HASH' ? :
778 51 129 ref $_gather[$_i] eq 'MCE::Queue' || ref $_gather[$_i] eq 'Thread::Queue' ? :
784 62 80 if (defined $self->{'gather'})
787 40 22 ref $_gather[0] eq 'CODE' ? :
788 0 62 ref $_gather[0] eq 'HASH' ? :
790 0 62 ref $_gather[0] eq 'MCE::Queue' || ref $_gather[0] eq 'Thread::Queue' ? :
795 40 102 if (defined $_input_data and ref $_input_data eq 'ARRAY') { }
3 99 elsif (defined $_input_data and ref $_input_data eq 'HASH') { }
809 0 142 if (defined $self->{'stdout_file'}) { }
811 0 0 unless open $_MCE_STDOUT, ">>", $self->{'stdout_file'}
818 0 142 if (defined $self->{'stderr_file'}) { }
820 0 0 unless open $_MCE_STDERR, ">>", $self->{'stderr_file'}
833 142 0 if not exists $self->{'flush_stderr'} or $self->{'flush_stderr'}
836 142 0 if not exists $self->{'flush_stdout'} or $self->{'flush_stdout'}
861 0 142 !$_RS || $_RS ne $MCE::LF ? :
862 0 142 defined $_O_SEP ? :
863 0 142 !$_I_SEP || $_I_SEP ne $MCE::LF ? :
876 0 142 if ($self->{'loop_timeout'} and @{$self->{'_tids'};} == 0 and $^O ne 'MSWin32') { }
0 142 elsif ($^O eq 'MSWin32') { }
882 0 0 if $_timeout < 5
888 0 0 if ($_pid = $_list->[$i])
889 0 0 if (waitpid $_pid, 1)
893 0 0 if ($? > abs $self->{'_wrk_status'})
904 0 0 if ($_has_user_tasks and $_task_id >= 0)
911 0 0 $_has_user_tasks ? :
913 0 0 if ($_task_id == 0 and defined $_syn_flag and $_sync_cnt)
914 0 0 if ($_sync_cnt == $_total_running)
922 0 0 unless $_total_running
924 0 0 if (my $_cid = $self->{'_pids_c'}{$_pid})
928 0 0 if ($_cid > $self->{'_relayed'})
932 0 0 if (defined $_pid and $_pid == 0)
961 0 0 if (exists $_core_output_function{$_func}) { }
0 0 elsif (exists $_plugin_function->{$_func}) { }
974 0 0 if $_win32_ipc
978 0 0 unless length $_func == 8
981 0 0 if (exists $_core_output_function{$_func}) { }
0 0 elsif (exists $_plugin_function->{$_func}) { }
988 0 0 if $_win32_ipc
993 0 3782 unless length $_func == 6
996 2269 1513 if (exists $_core_output_function{$_func}) { }
1513 0 elsif (exists $_plugin_function->{$_func}) { }
1012 0 142 if defined $_on_post_run