Branch Coverage

lib/PAGI/Runner.pm
Criterion Covered Total %
branch 99 174 56.9


line true false branch
212 3 78 if ($args[$i] eq "server_options" and ref $args[$i + 1] eq "HASH")
221 1 78 if (/^(-[IMMe])(.+)/) { }
266 0 22 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 22 if ($opts{'version'})
273 1 21 if ($opts{'help'})
279 2 19 if defined $opts{'host'}
280 7 14 if defined $opts{'port'}
281 0 21 if defined $opts{'server'}
282 2 19 if defined $opts{'env'}
283 1 20 if defined $opts{'loop'}
284 0 21 if defined $opts{'access_log'}
285 0 21 if $opts{'no_access_log'}
286 4 17 if $opts{'daemonize'}
287 3 18 if defined $opts{'pid_file'}
288 3 18 if defined $opts{'user'}
289 3 18 if defined $opts{'group'}
290 3 18 if $opts{'quiet'}
292 1 20 if defined $opts{'default_middleware'}
295 0 21 if @libs
298 2 19 if @modules
301 5 16 if defined $opts{'eval'}
304 2 19 if (defined $opts{'app'})
325 4 24 if defined $self->{'env'}
326 7 17 if defined $ENV{'PAGI_ENV'}
327 0 17 -t STDIN ? :
343 0 21 if (@{$self->{'libs'};})
352 0 1 if $@
353 0 1 if (defined $imports) { }
362 4 17 if (defined $self->{'eval'})
365 0 4 if $@
366 1 3 unless ref $app eq "CODE"
375 3 14 if (not $self->{'app_spec'} and @argv)
378 3 0 unless ($first =~ /=/)
388 7 10 if (not defined $app_spec) { }
400 10 7 if ($self->_is_module_name($app_spec)) { }
7 0 elsif ($self->_is_file_path($app_spec)) { }
408 0 0 if (-f $app_spec) { }
438 0 11 if ($use_middleware and $self->mode eq "development")
443 0 0 unless $self->{'quiet'}
470 0 10 if ($@)
483 0 10 if ($self->{'no_access_log'}) { }
0 10 elsif ($self->{'access_log'}) { }
10 0 elsif ($self->mode eq 'production') { }
490 0 0 unless open $access_log, ">>", $self->{'access_log'}
508 2 8 $has_socket_or_listen ? :
0 10 $self->{'loop'} ? :
10 0 defined $access_log || $disable_log ? :
533 2 0 unless (ref $self)
550 0 2 if ($self->{'show_version'})
556 0 2 if ($self->{'show_help'})
569 0 2 if ($self->{'daemonize'})
574 0 2 if ($self->{'pid_file'})
581 0 2 if ($self->{'user'} or $self->{'group'})
589 0 1 if $self->{'_pid_file_path'}
594 0 0 if ($_current_runner and $PAGI::Runner::_current_runner->{'_pid_file_path'})
611 2 0 if ($configured)
613 0 2 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 6 unless -f $file
679 6 0 if (exists $INC{'FindBin.pm'})
685 0 6 if ($@)
688 0 0 if (not defined $app and $!)
691 1 5 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