Branch Coverage

blib/lib/Test/PostgreSQL.pm
Criterion Covered Total %
branch 17 220 7.7


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
158 0 0 if @_ < 1
0 0 if @_ > 1
176 0 10 if @_ < 1
0 10 if @_ > 1
178 0 10 if ($prog)
181 0 0 if ($ret =~ /(\d+)(?:\.|devel|beta)/u and $1 >= 9)
207 0 0 if @_ < 1
0 0 if @_ > 1
208 0 0 $self->unix_socket ? :
227 0 0 if @_ < 1
0 0 if @_ > 1
236 0 0 if $self->pg_version >= 9.5
285 0 0 if @_ < 1
0 0 if @_ > 1
286 0 0 $self->unix_socket ? :
303 0 10 if @_ < 2
0 10 if @_ > 2
305 10 0 unless $self->pg_ctl
307 0 0 if (defined $self->uid and $self->uid == 0)
311 0 0 if (not defined $self->uid and $self->is_root)
313 0 0 unless (defined $ent)
316 0 0 unless ($ent->uid > 0)
323 0 0 if defined $self->uid
326 0 0 if ($self->auto_start)
327 0 0 if $self->auto_start >= 2
333 0 10 if @_ < 2
0 10 if @_ > 2
335 0 10 if (defined $self->pid and $self->_owner_pid == $$)
351 0 0 if ($self->{'unix_socket'}) { }
370 0 0 if @_ < 1
0 0 if @_ > 1
371 0 0 if (defined $self->pid)
377 0 0 if ($self->port) { }
390 0 0 if @_ < 1
0 0 if @_ > 1
402 0 0 unless ($tries--)
407 0 0 if $good
414 0 0 if @_ < 2
0 0 if @_ > 2
417 0 0 if ($self->pg_ctl) { }
432 0 0 unless open my $pidfh, '<', $pid_path
445 0 0 unless open my $logfh, '>>', $logfile
448 0 0 unless defined $pid
450 0 0 if ($pid == 0)
451 0 0 unless open STDOUT, '>>&', $logfh
453 0 0 unless open STDERR, '>>&', $logfh
455 0 0 unless chdir $self->base_dir
457 0 0 if (defined $self->uid)
458 0 0 unless setuid($self->uid)
474 0 0 unless open $logfh, '<', $logfile
479 0 0 if $lines =~ /is ready to accept connections/u
480 0 0 if (waitpid($pid, 1) > 0)
493 0 0 if @_ < 1
0 0 if @_ > 2
0 0 if @_ < 1
494 0 0 if ($self->pg_ctl and defined $self->base_dir) { }
504 0 0 unless defined $self->pid
512 0 0 if ($timeout <= 0)
519 0 0 if ($timeout <= 0)
528 0 0 if @_ < 2
0 0 if @_ > 2
537 0 0 if $dbh
540 0 0 if ($DBI::errstr =~ /the database system is starting up/u or $DBI::errstr =~ /Connection refused/u)
548 0 0 unless $dbh
551 0 0 if ($dbh->selectrow_arrayref("SELECT COUNT(*) FROM pg_database WHERE datname='${dbname}'")->[0] == 0)
552 0 0 unless $dbh->do("CREATE DATABASE $dbname")
558 0 0 if @$seed_scripts
564 0 0 if @_ < 1
0 0 if @_ > 1
567 0 0 unless chmod 0755, $self->base_dir
569 0 0 if ($ENV{'USER'} and $ENV{'USER'} eq 'root')
570 0 0 unless chown $self->uid, -1, $self->base_dir
574 0 0 if (mkdir $tmpdir)
575 0 0 if ($self->uid)
576 0 0 unless chown $self->uid, -1, $tmpdir
581 0 0 if (not -d 'File::Spec'->catdir($self->base_dir, 'data'))
582 0 0 if ($self->pg_ctl) { }
595 0 0 unless pipe my $rfh, my $wfh
598 0 0 unless defined $pid
600 0 0 if ($pid == 0)
602 0 0 unless open STDOUT, '>&', $wfh
604 0 0 unless open STDERR, '>&', $wfh
606 0 0 unless chdir $self->base_dir
608 0 0 if (defined $self->uid)
609 0 0 unless setuid($self->uid)
629 0 0 if $? != 0
637 0 0 if (my $pg_config = $self->pg_config) { }
638 0 0 unless open my $fh, '>', $conf_file
650 0 30 if @_ < 2
0 30 if @_ > 2
653 0 30 if $path
655 0 60 if -x "$sp/bin/$prog"
656 0 60 if -x "$sp/$prog"
662 0 0 if @_ < 2
0 0 if @_ > 3
0 0 if @_ < 2
664 0 0 if ($pid == 0) { }
666 0 0 if (defined $self->uid)
667 0 0 unless setuid($self->uid)
669 0 0 if $suppress_errors
670 0 0 unless exec @$cmd
677 0 0 if @_ < 1
699 0 0 unless $? == 0
702 0 0 if @_ < 1
708 0 0 if ($self->pg_version > 9.6) { }