Branch Coverage

blib/lib/Module/Build/Database/PostgreSQL.pm
Criterion Covered Total %
branch 0 98 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 /alter table/i
424 0 0 if (@lines > 0 and not -s $outfile)
446 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")
450 0 0 unless rename "$tmpfile", $outfile
464 0 0 unless ($self->_database_exists)
486 0 0 unless $self->_database_exists
504 0 0 unless my $filename = $args{'outfile'}
541 0 0 unless $list
543 0 0 unless $self->_do_psql("create extension if not exists $lang")
554 0 0 unless ($self->_database_exists($database_name))
556 0 0 unless do_system($Bin{'Createdb'}, $database_name)
560 0 0 unless $database_schema eq 'public'
588 0 0 if (my $postgis = $self->database_extensions('postgis'))
590 0 0 unless my $postgis_schema = $$postgis{'schema'}
591 0 0 unless $postgis_schema eq 'public'
594 0 0 unless $self->_do_psql_file($self->postgis_base . '/postgis.sql')
595 0 0 unless $self->_do_psql_file($self->postgis_base . '/spatial_ref_sys.sql')
599 0 0 if (my $sql = $self->database_options('post_initdb'))
604 0 0 if (my $sql = $self->database_options('after_create'))
621 0 0 unless my $dir = $args{'dir'}
632 0 0 unless open my $fp, ">$filename"
643 0 0 unless my $fp = 'IO::File'->new("<$database_name.$type")
644 0 0 unless mkdir $type
647 0 0 unless $outfp = 'IO::File'->new(">$type/$1")
0 0 if (s/^_CUT: (.*)$//)
648 0 0 if (s/^_DB: (.*)$//)
649 0 0 if defined $outfp