Branch Coverage

lib/ControlFreak/Service.pm
Criterion Covered Total %
branch 97 166 58.4


line true false branch
106 2 24 unless (_IDENTIFIER($svc->name))
111 24 0 unless exists $$svc{'respawn_on_fail'}
114 24 0 unless defined $$svc{'respawn_max_retries'}
117 23 1 unless defined $$svc{'startwait_secs'}
120 24 0 unless defined $$svc{'stopwait_secs'}
123 0 24 unless $$svc{'ctrl'} = $param{'ctrl'}
220 57 21 unless $state =~ /^(?:running|starting|stopping)$/
222 19 2 unless ($$svc{'proxy'})
224 0 19 unless defined $$svc{'child_cv'}
225 0 19 unless defined $svc->pid
248 1 6 unless $svc->is_fail
286 2 13 if ($svc->is_backoff)
297 1 12 if $svc->is_down
300 0 12 unless $svc->pid
318 1 11 if (my $proxy = $$svc{'proxy'}) { }
323 0 11 if (not $pid) { }
325 0 0 unless ($svc->is_starting)
333 11 0 if ($has_new_session) { }
334 0 11 if (getpgrp $pid == getpgrp 0) { }
388 0 35 if $svc->is_up
392 1 34 unless $cmd
400 30 4 unless $svc->is_backoff
404 5 29 if (my $proxy = $$svc{'proxy'}) { }
438 2 1 if $svc->is_down
455 0 1 if ($svc->is_stopped)
456 0 0 if $on_stop
462 1 0 if ($svc->pid) { }
487 0 1 unless ($pid)
498 0 12 unless $svc->is_starting
499 0 12 unless ($svc->pid)
500 0 0 if (my $proxy = $$svc{'proxy'})
519 0 4 unless $svc->is_backoff
543 0 1 if $svc->is_up
556 1 1 if ($svc->is_down)
557 0 1 if $param{'on_stop'}
576 0 2 if $fail
582 0 1 if ($tries > 150)
586 0 1 if $svc->is_up
602 0 0 unless $proxy
604 0 0 $proxy->is_running ? :
637 0 0 unless $svc->$_
665 0 0 unless $svc->$_
696 56 0 defined $value ? :
699 9 47 if (ref $v)
702 30 26 if ($old) { }
703 30 0 defined $old ? :
704 5 25 if ref $oldv
747 6 25 ref $_[1] ? :
3 28 unless my $value = ref $_[1] ? _ARRAY($_[1]) : _STRING($_[1])
754 5 9 unless defined $value
755 4 5 if ($value =~ /^\[/)
767 0 0 unless my $value = _STRING($_[1])
773 0 3 unless my $value = _STRING($_[1])
781 0 0 unless my $value = _STRING($_[0])
812 0 5 unless my $value = _NUMBER($_[1])
817 0 8 unless my $value = _NUMBER($_[1])
822 0 2 unless my $value = _STRING($_[1])
828 0 0 unless defined $value
834 0 0 unless defined $value
840 0 4 unless defined $value
846 0 4 unless defined $value
852 0 2 unless defined $value
858 0 0 unless defined $value
873 3 26 if (my $sockname = $svc->tie_stdin_to)
875 3 0 if ($socket)
876 3 0 if ($socket->is_bound) { }
896 29 0 if (my $logger = $ctrl->log)
898 29 0 unless ($svc->ignore_stdout)
901 29 0 unless ($svc->ignore_stderr)
923 0 0 unless ($svc->no_new_session)
925 0 0 unless $sessid
942 0 0 unless $env
943 0 0 unless ref $env eq 'HASH'
968 5 27 if (POSIX::WIFEXITED($es) and not POSIX::WEXITSTATUS($es)) { }
12 15 elsif (POSIX::WIFSIGNALED($es) and POSIX::WTERMSIG($es) == 15) { }
979 1 16 if $on_stop
992 4 11 unless ($svc->respawn_on_fail)
998 1 10 if ($$svc{'wants_down'})
1004 9 1 if ($svc->is_starting) { }
1006 2 7 if ($n >= $$svc{'respawn_max_retries'})
1029 0 17 unless $svc->is_stopped
1030 13 4 unless $svc->respawn_on_stop
1031 3 1 if not $$svc{'normal_exit'} or $$svc{'wants_down'}