Branch Coverage

blib/lib/Proc/Launcher.pm
Criterion Covered Total %
branch 66 94 70.2


line true false branch
375 4 25 unless ($self->is_enabled)
380 1 24 if ($self->is_running)
387 19 5 if (my $pid = fork) { }
402 17 27 if ($locked_pid and $self->is_running($pid))
407 17 0 if ($locked_pid == $pid) { }
424 0 5 unless ($self->write_my_pid($$))
435 0 5 unless open STDIN, '<', '/dev/null'
437 0 5 unless open STDOUT, '>>', $self->log_file
438 0 5 unless open STDERR, '>>', $self->log_file
440 0 5 unless setsid()
450 1 4 if ($self->pipe)
453 1 0 unless (-p $named_pipe)
455 0 1 unless POSIX::mkfifo($named_pipe, 448)
457 0 1 unless open STDIN, '<', $named_pipe
461 2 3 if ($self->class) { }
469 0 2 if ($error) { }
482 0 2 unless (eval { do { $obj = $class->new('context', $self->context); 1 } })
494 0 2 unless (eval { do { $obj->$method($args); 1 } })
505 0 1 unless (eval { do { $self->start_method->($args); 1 } })
529 1 9 unless ($self->is_running)
564 1 2 $sleep ? :
588 112 19 unless ($pid)
590 67 64 unless $pid
598 50 14 if (kill 0, $pid)
599 0 50 if ($!{'EPERM'}) { }
649 3 6 unless ($self->is_running)
677 1 16 if ($self->pipe)
694 92 84 unless (-r $path)
700 0 84 unless open my $fh, '<', $path
705 0 84 unless close $fh
707 1 83 unless $line
709 0 83 unless $line
711 0 83 unless ($line =~ /^\d+$/)
736 0 5 unless ($pid)
739 0 5 if $self->is_running
744 0 5 unless open my $pid_fh, '>', $path
747 0 5 unless close $pid_fh
751 0 5 if (-r $self->pid_file)
757 0 5 unless (rename $path, $self->pid_file)
779 0 18 unless -r $self->pid_file
822 0 1 unless $self->pipe
825 0 1 unless (-r $self->pipe_file)
834 0 1 unless sysopen my $fh, $self->pipe_file, &POSIX::O_WRONLY
848 4 1 if ($self->is_enabled)
864 4 1 unless ($self->is_enabled)
883 11 33 if -r $self->disable_file
892 382 18 unless $self->debug