Skip to content

Commit c489447

Browse files
author
Greg Sabino Mullane
committed
Better debug output: check for dbdir and datadir separately.
1 parent a01c44d commit c489447

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

t/CP_Testing.pm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,27 @@ sub test_database_handle {
7474

7575
## Create the test database directory if it does not exist
7676
my $dbdir = $arg->{dbdir} || $self->{dbdir};
77+
$DEBUG and warn qq{Datadir: $dbdir\n};
7778
if (! -d $dbdir) {
7879

7980
-e $dbdir and die qq{Oops: I cannot create "$dbdir", there is already a file there!\n};
8081

8182
Test::More::diag qq{Creating database in directory "$dbdir"\n};
8283

8384
mkdir $dbdir;
85+
}
86+
87+
my $datadir = "$dbdir/data space";
88+
if (! -e $datadir) {
8489

8590
my $initdb
8691
= $ENV{PGINITDB} ? $ENV{PGINITDB}
8792
: $ENV{PGBINDIR} ? "$ENV{PGBINDIR}/initdb"
8893
: 'initdb';
8994

90-
$com = qq{LC_ALL=en LANG=C $initdb --locale=C -E UTF8 -D "$dbdir/data space" 2>&1};
95+
$com = qq{LC_ALL=en LANG=C $initdb --locale=C -E UTF8 -D "$datadir" 2>&1};
9196
eval {
97+
$DEBUG and warn qq{About to run: $com\n};
9298
$info = qx{$com};
9399
};
94100
if ($@) {
@@ -189,6 +195,7 @@ sub test_database_handle {
189195

190196
$com = qq{LC_ALL=en LANG=C $pg_ctl -o '-k $sockdir' -l $logfile -D "$dbdir/data space" start};
191197
eval {
198+
$DEBUG and warn qq{About to run: $com\n};
192199
$info = qx{$com};
193200
};
194201
if ($@) {

0 commit comments

Comments
 (0)