Branch Coverage

blib/lib/Test/PostgreSQL.pm
Criterion Covered Total %
branch 17 208 8.1


line true false branch
63 0 10 if @_ < 1
0 10 if @_ > 1
79 0 10 if (defined $ENV{'POSTGRES_HOME'})
134 0 0 if @_ < 1
0 0 if @_ > 1
157 0 10 if @_ < 1
0 10 if @_ > 1
159 0 10 if ($prog)
162 0 0 if ($ret =~ /(\d+)(?:\.|devel)/u and $1 >= 9)
188 0 0 if @_ < 1
0 0 if @_ > 1
189 0 0 $self->unix_socket ? :
252 0 0 if @_ < 1
0 0 if @_ > 1
253 0 0 $self->unix_socket ? :
270 0 10 if @_ < 2
0 10 if @_ > 2
272 10 0 unless $self->pg_ctl
274 0 0 if (defined $self->uid and $self->uid == 0)
278 0 0 if (not defined $self->uid and $self->is_root)
280 0 0 unless (defined $ent)
283 0 0 unless ($ent->uid > 0)
290 0 0 if defined $self->uid
293 0 0 if ($self->auto_start)
294 0 0 if $self->auto_start >= 2
300 0 10 if @_ < 2
0 10 if @_ > 2
302 0 10 if (defined $self->pid and $self->_owner_pid == $$)
318 0 0 if ($self->{'unix_socket'}) { }
337 0 0 if @_ < 1
0 0 if @_ > 1
338 0 0 if (defined $self->pid)
344 0 0 if ($self->port) { }
357 0 0 if @_ < 1
0 0 if @_ > 1
368 0 0 unless ($tries--)
373 0 0 if $good
378 0 0 if @_ < 2
0 0 if @_ > 2
381 0 0 if ($self->pg_ctl) { }
396 0 0 unless open my $pidfh, '<', $pid_path
409 0 0 unless open my $logfh, '>>', $logfile
412 0 0 unless defined $pid
414 0 0 if ($pid == 0)
415 0 0 unless open STDOUT, '>>&', $logfh
417 0 0 unless open STDERR, '>>&', $logfh
419 0 0 unless chdir $self->base_dir
421 0 0 if (defined $self->uid)
422 0 0 unless setuid($self->uid)
438 0 0 unless open $logfh, '<', $logfile
443 0 0 if $lines =~ /is ready to accept connections/u
444 0 0 if (waitpid($pid, 1) > 0)
457 0 0 if @_ < 1
0 0 if @_ > 2
0 0 if @_ < 1
458 0 0 if ($self->pg_ctl and defined $self->base_dir) { }
468 0 0 unless defined $self->pid
476 0 0 if ($timeout <= 0)
483 0 0 if ($timeout <= 0)
492 0 0 if @_ < 2
0 0 if @_ > 2
501 0 0 if $dbh
504 0 0 if ($DBI::errstr =~ /the database system is starting up/u or $DBI::errstr =~ /Connection refused/u)
512 0 0 unless $dbh
515 0 0 if ($dbh->selectrow_arrayref("SELECT COUNT(*) FROM pg_database WHERE datname='${dbname}'")->[0] == 0)
516 0 0 unless $dbh->do("CREATE DATABASE $dbname")
522 0 0 if @$seed_scripts
528 0 0 if @_ < 1
0 0 if @_ > 1
531 0 0 unless chmod 0755, $self->base_dir
533 0 0 if ($ENV{'USER'} and $ENV{'USER'} eq 'root')
534 0 0 unless chown $self->uid, -1, $self->base_dir
538 0 0 if (mkdir $tmpdir)
539 0 0 if ($self->uid)
540 0 0 unless chown $self->uid, -1, $tmpdir
545 0 0 if (not -d 'File::Spec'->catdir($self->base_dir, 'data'))
546 0 0 if ($self->pg_ctl) { }
559 0 0 unless pipe my $rfh, my $wfh
562 0 0 unless defined $pid
564 0 0 if ($pid == 0)
566 0 0 unless open STDOUT, '>&', $wfh
568 0 0 unless open STDERR, '>&', $wfh
570 0 0 unless chdir $self->base_dir
572 0 0 if (defined $self->uid)
573 0 0 unless setuid($self->uid)
593 0 0 if $? != 0
601 0 0 if (my $pg_config = $self->pg_config) { }
602 0 0 unless open my $fh, '>', $conf_file
614 0 30 if @_ < 2
0 30 if @_ > 2
617 0 30 if $path
619 0 60 if -x "$sp/bin/$prog"
620 0 60 if -x "$sp/$prog"
626 0 0 if @_ < 2
0 0 if @_ > 3
0 0 if @_ < 2
628 0 0 if ($pid == 0) { }
630 0 0 if (defined $self->uid)
631 0 0 unless setuid($self->uid)
633 0 0 if $suppress_errors
634 0 0 unless exec @$cmd
641 0 0 if @_ < 1
663 0 0 unless $? == 0
666 0 0 if @_ < 1