summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2013-02-11 21:22:25 +0000
committerGreg Sabino Mullane2013-02-11 21:22:25 +0000
commitc48944741d2b9724b5e849b2bbf77fa13d72e236 (patch)
tree691cfee52fa327854b9e838cdabc797966fbb05b
parenta01c44d016090a14f3707e0925659cd67c469323 (diff)
Better debug output: check for dbdir and datadir separately.
-rw-r--r--t/CP_Testing.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/CP_Testing.pm b/t/CP_Testing.pm
index cc472dae8..f12831f42 100644
--- a/t/CP_Testing.pm
+++ b/t/CP_Testing.pm
@@ -74,6 +74,7 @@ sub test_database_handle {
## Create the test database directory if it does not exist
my $dbdir = $arg->{dbdir} || $self->{dbdir};
+ $DEBUG and warn qq{Datadir: $dbdir\n};
if (! -d $dbdir) {
-e $dbdir and die qq{Oops: I cannot create "$dbdir", there is already a file there!\n};
@@ -81,14 +82,19 @@ sub test_database_handle {
Test::More::diag qq{Creating database in directory "$dbdir"\n};
mkdir $dbdir;
+ }
+
+ my $datadir = "$dbdir/data space";
+ if (! -e $datadir) {
my $initdb
= $ENV{PGINITDB} ? $ENV{PGINITDB}
: $ENV{PGBINDIR} ? "$ENV{PGBINDIR}/initdb"
: 'initdb';
- $com = qq{LC_ALL=en LANG=C $initdb --locale=C -E UTF8 -D "$dbdir/data space" 2>&1};
+ $com = qq{LC_ALL=en LANG=C $initdb --locale=C -E UTF8 -D "$datadir" 2>&1};
eval {
+ $DEBUG and warn qq{About to run: $com\n};
$info = qx{$com};
};
if ($@) {
@@ -189,6 +195,7 @@ sub test_database_handle {
$com = qq{LC_ALL=en LANG=C $pg_ctl -o '-k $sockdir' -l $logfile -D "$dbdir/data space" start};
eval {
+ $DEBUG and warn qq{About to run: $com\n};
$info = qx{$com};
};
if ($@) {