Branch Coverage

blib/lib/Module/Build/Database/PostgreSQL.pm
Criterion Covered Total %
branch 0 96 0.0


line true false branch
238 0 0 unless (-e $filename)
242 0 0 unless (-s $filename)
258 0 0 $^O eq 'MSWin32' ? :
281 0 0 unless -d $thisdir and -w $thisdir
295 0 0 if (%{$self->scratch_database;}) { }
315 0 0 unless (do_system($Bin{'Initdb'}, '-D', "$dbdir", '>>', "$initlog", '2>&1'))
317 0 0 if -e $initlog
321 0 0 if (my $conf_append = $self->database_options('append_to_conf'))
322 0 0 unless -e "$dbdir/postgresql.conf"
323 0 0 unless open my $fp, ">> $dbdir/postgresql.conf"
331 0 0 unless (do_system($Bin{'Pgctl'}, qq[-o "$pmopts"], '-w', '-t', 120, '-D', "$dbdir", '-l', 'postmaster.log', 'start'))
333 0 0 if (-e "$dbdir/postmaster.log") { }
342 0 0 unless -e $domain
352 0 0 if $ENV{'MBD_DONT_STOP_TEST_DB'} or %{$self->scratch_database;}
360 0 0 if $ENV{'MBD_DONT_STOP_TEST_DB'} or %{$self->scratch_database;}
363 0 0 unless (-e $pid_file)
371 0 0 unless kill 0, $pid
372 0 0 unless kill 9, $pid
378 0 0 unless -e $filename
386 0 0 unless -e $filename
405 0 0 unless (do_system($Bin{'Pgdump'}, '-xOs', '-E', 'utf8', '-n', $database_schema, $database_name, '>', $tmpfile))
412 0 0 unless (@lines)
421 0 0 if (@lines > 0 and not -s $outfile)
443 0 0 unless do_system($Bin{'Pgdump'}, '--data-only', '-xO', '-E', 'utf8', '-n', $database_schema, $database_name, '|', q[egrep -v '^SET (lock_timeout|search_path)'], '>', "$tmpfile")
447 0 0 unless rename "$tmpfile", $outfile
461 0 0 unless ($self->_database_exists)
483 0 0 unless $self->_database_exists
501 0 0 unless my $filename = $args{'outfile'}
538 0 0 unless $list
540 0 0 unless $self->_do_psql("create extension if not exists $lang")
551 0 0 unless ($self->_database_exists($database_name))
553 0 0 unless do_system($Bin{'Createdb'}, $database_name)
557 0 0 unless $database_schema eq 'public'
585 0 0 if (my $postgis = $self->database_extensions('postgis'))
587 0 0 unless my $postgis_schema = $postgis->{'schema'}
588 0 0 unless $postgis_schema eq 'public'
591 0 0 unless $self->_do_psql_file($self->postgis_base . '/postgis.sql')
592 0 0 unless $self->_do_psql_file($self->postgis_base . '/spatial_ref_sys.sql')
596 0 0 if (my $sql = $self->database_options('post_initdb'))
601 0 0 if (my $sql = $self->database_options('after_create'))
618 0 0 unless my $dir = $args{'dir'}
629 0 0 unless open my $fp, ">$filename"
640 0 0 unless my $fp = 'IO::File'->new("<$database_name.$type")
641 0 0 unless mkdir $type
644 0 0 unless $outfp = 'IO::File'->new(">$type/$1")
0 0 if (s/^_CUT: (.*)$//)
645 0 0 if (s/^_DB: (.*)$//)
646 0 0 if defined $outfp