summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/02_timesync.t7
-rw-r--r--t/CP_Testing.pm10
2 files changed, 14 insertions, 3 deletions
diff --git a/t/02_timesync.t b/t/02_timesync.t
index 7e7515e00..9cd9887bd 100644
--- a/t/02_timesync.t
+++ b/t/02_timesync.t
@@ -1,5 +1,10 @@
+#!perl
+
+## Test the "version" action
+
+use strict;
+use warnings;
use Data::Dumper;
-use DBI;
use Test::More tests => 20;
use lib 't','.';
use CP_Testing;
diff --git a/t/CP_Testing.pm b/t/CP_Testing.pm
index c76df0f08..f0280871e 100644
--- a/t/CP_Testing.pm
+++ b/t/CP_Testing.pm
@@ -67,7 +67,10 @@ sub test_database_handle {
mkdir $dbdir;
- my $initdb = $ENV{PGINITDB} || 'initdb';
+ 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 2>&1};
eval {
@@ -119,7 +122,10 @@ sub test_database_handle {
unlink $logfile;
- my $pg_ctl = $ENV{PG_CTL} || 'pg_ctl';
+ my $pg_ctl
+ = $ENV{PG_CTL} ? $ENV{PG_CTL}
+ : $ENV{PGBINDIR} ? "$ENV{PGBINDIR}/pg_ctl"
+ : 'pg_ctl';
$com = qq{LC_ALL=en LANG=C $pg_ctl -o '-k socket' -l $logfile -D "$dbdir/data" start};
eval {