Branch Coverage

blib/lib/Apache/TestConfig.pm
Criterion Covered Total %
branch 55 446 12.3


line true false branch
27 0 6 $ENV{'APACHE_TEST_COLOR'} && -t STDOUT ? :
113 0 0 if $opt
130 0 15 if (ref $filter[0])
137 3 2 if (defined $key and $key =~ /^-?-?(.+)/ and exists $$wanted_args{$1}) { }
138 3 0 if (@filter) { }
181 6 0 ref $self ? :
185 0 6 if $ENV{'APACHE_TEST_INTERACTIVE_CONFIG_TEST'}
192 0 6 if ($$server{'rev'} and $$server{'rev'} == 2 or IS_MOD_PERL_2_BUILD or $ENV{'MOD_PERL_API_VERSION'})
194 0 0 unless eval {
215 6 0 if $_[0] and ref $_[0]
217 6 0 $args ? :
231 6 0 if $top_dir =~ /(.*)/
241 6 6 if eval {
251 6 0 if ($$args{'thaw'} and ref $thaw ne 'HASH')
260 0 0 if ($$args{'save'})
262 0 0 if exists $$thaw{$_}
289 0 0 unless exists $$args{$_}
299 0 0 if -d $src_dir
337 0 0 if ($$vars{'maxclients_preset'} and $$vars{'maxclients_preset'} < $$vars{'minclients'})
369 0 6 if (not $$vars{'httpd'} || $$vars{'apxs'}) { }
376 0 0 if (IS_MOD_PERL_2_BUILD)
381 0 0 unless ($$mp2_build{'MP_APXS'})
394 0 0 if ($ENV{'APACHE_TEST_NO_STICKY_PREFERENCES'})
413 0 6 unless (custom_config_exists())
437 0 36 unless ($$self{'vars'}{$mname})
454 0 6 unless $$self{'APXS'}
465 6 0 if ($$vars{'conf_dir'})
478 0 6 unless ($$vars{'httpd'})
482 0 0 unless defined $dir
484 0 0 unless -x $httpd
492 6 0 if ($$vars{'httpd'})
497 0 12 unless @chunks
499 6 6 if -d "$$self{'httpd_basedir'}/bin"
505 6 0 unless (-e $sem)
515 0 6 if (defined $$self{'httpd_defines'}{'EAPI_MM_CORE_PATH'})
522 0 0 unless (file_name_is_absolute($path))
534 0 5 if ($$vars{'proxy'} =~ /^on$/i)
535 0 0 unless ($$vars{'maxclients_preset'})
568 6 6 if ($data) { }
0 6 elsif (ref $directive eq 'ARRAY') { }
570 0 6 if (ref $data eq 'HASH') { }
0 6 elsif (ref $data eq 'ARRAY') { }
591 0 6 ref $arg && ref $arg eq 'ARRAY' ? :
626 0 0 if (ref $_ and ref $_ eq 'CODE' or $self->can($_)) { }
658 0 0 if ($group eq 'root')
664 0 0 $user ? :
665 0 0 if $gid
678 0 0 if ($user eq 'root')
680 0 0 if ($other) { }
700 0 6 if $$self{'vars'}{'apxs'}
702 0 6 if (my $build_config = $self->modperl_build_config)
714 0 0 if (my $build_config = $self->modperl_build_config)
715 0 0 if (my $p = $$build_config{'MP_AP_PREFIX'})
718 0 0 if -e $httpd
739 0 0 unless gethostbyaddr $localhost_addr, Socket::AF_INET()
745 0 0 unless $localhost
770 15 0 unless $port eq 'select'
780 0 0 unless (--$tries)
788 0 0 unless $port == 8529
803 0 0 unless (defined $iaddr)
817 15 0 unless ($module)
819 15 0 unless $$vars{'scheme'} eq 'https'
839 0 0 unless $module
853 0 0 if (-e $file)
864 0 0 if $$self{'modules'}{$name}
899 0 0 unless $filename
902 0 0 if defined $from_filename
915 0 0 unless $filename
938 0 0 if -e $path
946 0 0 if defined $from_file
953 0 0 if (my $msg = $self->genwarning($file, $from_file))
969 0 0 unless open $fh, ">$file"
971 0 0 unless $nowarning
984 0 0 if $content
996 0 0 if (IS_MOD_PERL_2_BUILD or $ENV{'APACHE_TEST_LIVE_DEV'})
1000 0 0 if -d $dir
1003 0 0 if (-e catfile($FindBin::Bin, '..', 'Makefile.PL'))
1005 0 0 if -d $dir
1011 0 0 if (-d $dir)
1019 0 0 if -d $dir
1045 0 0 if $content
1057 0 0 length $Config{'perlpath'} < 62 ? :
1089 0 0 if not defined $path or -e $path
1103 18 0 if $cmd =~ /(.*)/
1106 0 18 unless open $handle, "$cmd|"
1120 0 0 if (-e $_) { }
1132 0 0 if (-d $_)
1137 0 0 if $notempty
1150 0 0 $File ? :
1154 0 0 if (my $callback = $special_tokens{$key}) { }
0 0 elsif (exists $$self{'vars'}{$key}) { }
1193 0 0 if ($line =~ /^(\s*)<VirtualHost\s+(?:_default_:|([^:]+):(?!:))?(.*?)\s*>\s*$/) { }
1210 0 0 if ($module =~ /^(mod_\w+)_ssl$/ and $have_module ne $ssl_module)
1212 0 0 unless $$mods{$ssl_module}
1217 0 0 if ($module =~ /^mod_/ and not $$mods{$have_module})
1225 0 0 $namebased ? :
1231 0 0 if ($$self{'vhosts'}{$module}{'namebased'} < 2)
1235 0 0 if ($$self{'vhosts'}{$module}{'namebased'})
1257 0 0 $indent ? :
1264 0 0 $namebased ? :
1273 0 0 unless my $mod_path = $self->find_apache_module($name)
1276 0 0 if ($mod_path and -e $mod_path)
1286 0 0 if (my $cfg = $self->parse_vhost($_))
1289 0 0 unless $$cfg{$key}
1316 0 0 if -e $file
1338 0 0 unless ($$self{'inherit_config'}{'TypesConfig'})
1340 0 0 unless (-e $types)
1360 0 0 if (open $in, $try) { }
1365 0 0 unless open $dup, '<&DATA'
1379 0 0 unless ($$vars{'proxyssl_url'})
1381 0 0 if ($ssl)
1385 0 0 if ($$vars{'proxyssl_url'})
1386 0 0 unless ($$vars{'maxclients_preset'})
1399 0 0 unless /\.in$/
1401 0 0 unless -e $generated and -M $generated < -M $File::Find::name
1414 0 0 unless /\.in$/
1420 0 0 if (basename($file) =~ /^ssl/) { }
1439 0 0 unless open $in, $file
1461 0 0 unless $$self{'modules'}{$$vars{'ssl_module'}}
1462 0 0 unless -d "$$vars{'t_conf'}/ssl"
1466 0 0 if ($check)
1468 0 0 if (which($openssl))
1483 0 0 if $ca and -d $ca
1485 0 0 unless $self->sslca_can(1)
1496 0 0 unless $$self{'vars'}{'httpd'} and $$self{'vars'}{'ssl_module'}
1498 0 0 unless $self->sslca_can
1512 0 0 if (-d $ssl_conf and not -d $conf)
1527 0 0 if -d $location
1554 0 0 if (my $extra_conf = $self->generate_extra_conf)
1557 0 0 if ($file =~ /\.conf$/) { }
0 0 elsif ($file =~ /\.pl$/) { }
1558 0 0 if $file =~ m[/httpd\.conf$]
1569 0 0 if ($file =~ /\.last\.(conf|pl)$/) { }
1593 0 0 if ($$vars{$name})
1614 0 0 unless $$vars{$aliases{$_}}
1626 0 0 unless close $out
1636 0 0 if (my $port = $$conf_opts{'port'} || $Argv{'port'})
1637 0 0 if ($port eq 'select')
1644 0 0 if -e $exe and -e $$vars{'t_conf_file'} and -M $exe < -M $$vars{'t_conf_file'}
1651 0 0 if (my(@files) = $self->extra_conf_files_needing_update)
1665 0 0 if (my(@env_vars) = grep({$ENV{$_};} keys %$passenv))
1676 0 0 if (not $config or $config < $current)
1688 0 0 $rel ? :
0 0 wantarray ? :
1715 0 0 unless $program
1721 0 0 if $perl_bin and -d $perl_bin
1724 0 0 if ($ENV{'HOME'} and 1)
1730 0 0 if -x $base and -f _
1742 0 18 unless $$self{'APXS'}
1744 0 18 unless (exists $$self{'_apxs'}{$q})
1750 0 0 if defined $val
1751 0 0 if ($val)
1754 0 0 unless ($val)
1755 0 0 if ($ok_fail) { }
1783 0 6 if $chunks[-1] eq $remove
1791 0 6 if $ENV{'MOD_PERL'}
1800 0 6 if -d $apache_test_dir
1804 0 6 if ($ENV{'APACHE_TEST_LIVE_DEV'})
1808 0 0 if -d $lib_dir
1832 0 0 if $$self{'save'}
1841 0 0 if (exists $$v{$key} and not defined $$v{$key})
1845 0 0 if exists $$tvars{$key} and exists $$svars{$key} and $$tvars{$key} eq $$svars{$key}
1851 0 0 unless $changed
1860 0 0 unless $$self{'save'}
1883 0 0 unless close $fh
1893 0 0 if (my $httpd = $$test_config{'vars'}{'httpd'}) { }
1924 0 0 if $ldd
1928 0 0 if ($command)
1953 0 6 if $custom_config_path
1958 6 0 if $ENV{'HOME'}
1964 48 6 unless -e $candidate
1982 0 0 if -e $path
1986 0 0 if (-e $path)
1999 0 0 if $ENV{'HOME'}
2005 0 0 unless -e $victim
2019 6 0 if $httpd and -e $httpd and -x _
2022 0 0 if $apxs and -e $apxs and -x _
2036 0 0 if custom_config_exists()
2056 0 0 if ($ENV{'APACHE_TEST_NO_STICKY_PREFERENCES'})
2066 0 0 unless $$vars{'httpd'} or $$Apache::TestConfigData::vars{'httpd'} or $$vars{'apxs'} or $$Apache::TestConfigData::vars{'apxs'}
2072 0 0 unless my $var = $$vars{$_} || $$conf_opts{$_}
2081 0 0 unless my $var = $$conf_opts{$_}
2089 0 0 if (-e $path and custom_config_path_is_writable($path))
2096 0 0 if (-e $blib_path and custom_config_path_is_writable($blib_path))
2104 0 0 if ($path = custom_config_path()) { }
0 0 elsif ('File::Spec'->file_name_is_absolute('/usr/local/pkg/cover/20070318/sw/.cpan/build/Apache-Test-1.29/blib/lib/Apache/TestConfig.pm')) { }
2120 0 0 if ($path and custom_config_path_is_writable($path)) { }
0 0 elsif ($ENV{'HOME'}) { }
2127 0 0 if ($path and custom_config_path_is_writable($path))
2142 0 0 unless $path
2149 0 0 if (-e $path) { }
2158 0 0 if ($dir and not -e $dir)
2161 0 0 if @dirs
2169 0 0 if (open $fh, ">>$path")
2172 0 0 if $file_created
2173 0 0 if $top_dir_created
2204 0 0 unless -e $dir
2206 0 0 unless open $fh, ">$path"
2214 0 0 unless $Apache::TestConfigData::vars and keys %$Apache::TestConfigData::vars
2227 0 0 unless $ENV{$vars_to_env{$_}}
2233 0 0 if IS_MOD_PERL_2_BUILD
2235 0 0 unless ($vars_must_overriden)
2237 0 0 unless $$Apache::TestConfigData::vars{$_}
2243 0 0 unless $$Apache::TestConfigData::vars{$_}
2246 0 0 unless defined $env_value and length $env_value
2254 0 6 if ($ENV{'APACHE_TEST_NO_STICKY_PREFERENCES'})
2260 0 6 if ($ENV{'APACHE_TEST_INTERACTIVE_CONFIG_TEST'})
2266 0 6 if $custom_config_loaded
2268 6 0 if (my $custom_config_path = custom_config_path()) { }
2285 0 0 unless (-t STDIN or $ENV{'APACHE_TEST_INTERACTIVE_PROMPT_OK'})
2327 0 0 if -e $_ and -x _
2366 0 0 if -e $_ and -x _
2387 0 0 $optional ? :
2392 0 0 if (%$rh_choices) { }
2414 0 0 if ($ans =~ /^(\d+)$/)
2415 0 0 if ($1 > 0 and $choices[$1 - 1]) { }
2424 0 0 if ($optional)
2425 0 0 unless $ans
2430 0 0 if (lc $ans eq 'skip' and not $optional)
2435 0 0 unless ('File::Spec'->file_name_is_absolute($ans))
2441 0 0 unless -e $ans
2442 0 0 unless -f _
2443 0 0 unless -x _