From 7151ef25a91339f61b0d3e1dfec7d9a0d5589e03 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Tue, 28 Apr 2009 10:42:33 -0400 Subject: [PATCH] Minor testing tweaks. --- t/02_timesync.t | 7 ++++++- t/CP_Testing.pm | 10 ++++++++-- 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 { -- 2.39.5