@@ -23,6 +23,9 @@ our @EXPORT = qw(
23
23
program_options_handling_ok
24
24
command_like
25
25
issues_sql_like
26
+
27
+ $tmp_check
28
+ $log_path
26
29
) ;
27
30
28
31
use Cwd;
@@ -37,8 +40,10 @@ use Test::More;
37
40
38
41
# Open log file. For each test, the log file name uses the name of the
39
42
# file launching this module, without the .pl suffix.
40
- my $log_path = ' tmp_check/log' ;
41
- mkdir ' tmp_check' ;
43
+ our ($tmp_check , $log_path );
44
+ $tmp_check = $ENV {TESTDIR } ? " $ENV {TESTDIR}/tmp_check" : " tmp_check" ;
45
+ $log_path = " $tmp_check /log" ;
46
+ mkdir $tmp_check ;
42
47
mkdir $log_path ;
43
48
my $test_logfile = basename($0 );
44
49
$test_logfile =~ s /\. [^.]+$// ;
@@ -128,19 +133,19 @@ sub start_test_server
128
133
print (" ### Starting test server in $tempdir \n " );
129
134
standard_initdb " $tempdir /pgdata" ;
130
135
$ret = system_log(' pg_ctl' , ' -D' , " $tempdir /pgdata" , ' -w' , ' -l' ,
131
- " $tempdir /logfile " , ' -o' ,
136
+ " $log_path /postmaster.log " , ' -o' ,
132
137
" --fsync=off -k \" $tempdir_short \" --listen-addresses='' --log-statement=all" ,
133
138
' start' );
134
139
if ($ret != 0)
135
140
{
136
141
print " # pg_ctl failed; logfile:\n " ;
137
- system (' cat' , " $tempdir /logfile " );
142
+ system (' cat' , " $log_path /postmaster.log " );
138
143
BAIL_OUT(" pg_ctl failed" );
139
144
}
140
145
141
146
$ENV {PGHOST } = $tempdir_short ;
142
147
$test_server_datadir = " $tempdir /pgdata" ;
143
- $test_server_logfile = " $tempdir /logfile " ;
148
+ $test_server_logfile = " $log_path /postmaster.log " ;
144
149
}
145
150
146
151
sub restart_test_server
0 commit comments