Branch Coverage

lib/PAGI/Runner.pm
Criterion Covered Total %
branch 98 174 56.3


line true false branch
212 2 73 if ($args[$i] eq "server_options" and ref $args[$i + 1] eq "HASH")
221 1 73 if (/^(-[IMMe])(.+)/) { }
266 0 21 unless &GetOptionsFromArray(\@args, "a|app=s", \$opts{'app'}, "e=s", \$opts{'eval'}, "I|lib=s", \@libs, "M=s", \@modules, "o|host=s", \$opts{'host'}, "p|port=i", \$opts{'port'}, "s|server=s", \$opts{'server'}, "E|env=s", \$opts{'env'}, "l|loop=s", \$opts{'loop'}, "access-log=s", \$opts{'access_log'}, "no-access-log", \$opts{'no_access_log'}, "D|daemonize", \$opts{'daemonize'}, "pid=s", \$opts{'pid_file'}, "user=s", \$opts{'user'}, "group=s", \$opts{'group'}, "q|quiet", \$opts{'quiet'}, "default-middleware!", \$opts{'default_middleware'}, "help", \$opts{'help'}, "v|version", \$opts{'version'})
269 0 21 if ($opts{'version'})
273 1 20 if ($opts{'help'})
279 2 18 if defined $opts{'host'}
280 6 14 if defined $opts{'port'}
281 0 20 if defined $opts{'server'}
282 2 18 if defined $opts{'env'}
283 1 19 if defined $opts{'loop'}
284 0 20 if defined $opts{'access_log'}
285 0 20 if $opts{'no_access_log'}
286 4 16 if $opts{'daemonize'}
287 3 17 if defined $opts{'pid_file'}
288 3 17 if defined $opts{'user'}
289 3 17 if defined $opts{'group'}
290 2 18 if $opts{'quiet'}
292 1 19 if defined $opts{'default_middleware'}
295 0 20 if @libs
298 2 18 if @modules
301 5 15 if defined $opts{'eval'}
304 1 19 if (defined $opts{'app'})
325 4 20 if defined $self->{'env'}
326 4 16 if defined $ENV{'PAGI_ENV'}
327 0 16 -t STDIN ? :
343 0 20 if (@{$self->{'libs'};})
352 0 1 if $@
353 0 1 if (defined $imports) { }
362 4 16 if (defined $self->{'eval'})
365 0 4 if $@
366 1 3 unless ref $app eq "CODE"
375 3 13 if (not $self->{'app_spec'} and @argv)
378 3 0 unless ($first =~ /=/)
388 7 9 if (not defined $app_spec) { }
400 10 6 if ($self->_is_module_name($app_spec)) { }
6 0 elsif ($self->_is_file_path($app_spec)) { }
408 0 0 if (-f $app_spec) { }
438 0 10 if ($use_middleware and $self->mode eq "development")
443 0 0 unless $self->{'quiet'}
470 0 9 if ($@)
483 0 9 if ($self->{'no_access_log'}) { }
0 9 elsif ($self->{'access_log'}) { }
9 0 elsif ($self->mode eq 'production') { }
490 0 0 unless open $access_log, ">>", $self->{'access_log'}
508 2 7 $has_socket_or_listen ? :
0 9 $self->{'loop'} ? :
9 0 defined $access_log || $disable_log ? :
533 1 0 unless (ref $self)
550 0 1 if ($self->{'show_version'})
556 0 1 if ($self->{'show_help'})
569 0 1 if ($self->{'daemonize'})
574 0 1 if ($self->{'pid_file'})
581 0 1 if ($self->{'user'} or $self->{'group'})
589 0 0 if $self->{'_pid_file_path'}
594 0 0 if ($_current_runner and $PAGI::Runner::_current_runner->{'_pid_file_path'})
611 1 0 if ($configured)
613 0 1 if ($self->mode ne "production" and not $self->{'quiet'})
636 0 10 unless $module =~ /^[A-Za-z_][A-Za-z0-9_]*(?:::[A-Za-z_][A-Za-z0-9_]*)*$/
645 1 9 if ($@)
650 0 9 unless ($module->can("new") and $module->can("to_app"))
661 0 9 unless (ref $app eq "CODE")
674 1 5 unless -f $file
679 5 0 if (exists $INC{'FindBin.pm'})
685 0 5 if ($@)
688 0 0 if (not defined $app and $!)
691 1 4 unless (ref $app eq "CODE")
704 5 0 if ($arg =~ /^([^=]+)=(.*)$/) { }
768 0 0 unless defined $pid
769 0 0 if $pid
772 0 0 unless setsid()
776 0 0 unless defined $pid
777 0 0 if $pid
781 0 0 unless chdir "/"
787 0 0 unless open STDIN, "<", "/dev/null"
788 0 0 unless open STDOUT, ">", "/dev/null"
789 0 0 unless open STDERR, ">", "/dev/null"
797 0 3 unless open my $fh, ">", $pid_file
809 0 5 unless $self->{'_pid_file_path'}
819 1 4 unless $user or $group
822 0 4 if ($> != 0)
827 2 2 if ($group)
829 2 0 unless defined $gid
833 0 0 if $) != $gid
837 2 0 if ($user)
839 2 0 unless defined $uid
842 0 0 unless ($group)
848 0 0 if $> != $uid