@@ -111,15 +111,12 @@ sub installcheck
111
111
112
112
sub check
113
113
{
114
- chdir $startdir ;
115
-
116
114
InstallTemp();
117
115
chdir " ${topdir} /src/test/regress" ;
118
-
119
116
my @args = (
120
- " ${tmp_installdir} /bin /pg_regress" ,
117
+ " ../../../ $Config /pg_regress /pg_regress" ,
121
118
" --dlpath=." ,
122
- " --bindir=${tmp_installdir} /bin " ,
119
+ " --bindir=" ,
123
120
" --schedule=${schedule} _schedule" ,
124
121
" --encoding=SQL_ASCII" ,
125
122
" --no-locale" ,
@@ -139,11 +136,9 @@ sub ecpgcheck
139
136
exit $status if $status ;
140
137
InstallTemp();
141
138
chdir " $topdir /src/interfaces/ecpg/test" ;
142
-
143
- $ENV {PATH } = " ${tmp_installdir} /bin;${tmp_installdir} /lib;$ENV {PATH}" ;
144
139
$schedule = " ecpg" ;
145
140
my @args = (
146
- " ${tmp_installdir} /bin /pg_regress_ecpg" ,
141
+ " ../../../../ $Config /pg_regress_ecpg /pg_regress_ecpg" ,
147
142
" --bindir=" ,
148
143
" --dbname=regress1,connectdb" ,
149
144
" --create-role=connectuser,connectdb" ,
@@ -159,14 +154,12 @@ sub ecpgcheck
159
154
160
155
sub isolationcheck
161
156
{
162
- chdir $startdir ;
163
-
164
- InstallTemp();
165
- chdir " ${topdir} /src/test/isolation" ;
166
-
157
+ chdir " ../isolation" ;
158
+ copy(" ../../../$Config /isolationtester/isolationtester.exe" ,
159
+ " ../../../$Config /pg_isolation_regress" );
167
160
my @args = (
168
- " ${tmp_installdir} /bin /pg_isolation_regress" ,
169
- " --bindir=${tmp_installdir} /bin " ,
161
+ " ../../../ $Config /pg_isolation_regress /pg_isolation_regress" ,
162
+ " --bindir=../../../ $Config /psql " ,
170
163
" --inputdir=." ,
171
164
" --schedule=./isolation_schedule" );
172
165
push (@args , $maxconn ) if $maxconn ;
@@ -180,8 +173,8 @@ sub tapcheck
180
173
InstallTemp();
181
174
182
175
my @args = ( " prove" , " --verbose" , " t/*.pl" );
176
+ my $mstat = 0;
183
177
184
- $ENV {PATH } = " $tmp_installdir /bin;$ENV {PATH}" ;
185
178
$ENV {PERL5LIB } = " $topdir /src/test/perl;$ENV {PERL5LIB}" ;
186
179
$ENV {PG_REGRESS } = " $topdir /$Config /pg_regress/pg_regress" ;
187
180
@@ -210,16 +203,14 @@ sub tapcheck
210
203
$ENV {TESTDIR } = " $dir " ;
211
204
system (@args );
212
205
my $status = $? >> 8;
213
- exit $status if $status ;
206
+ $mstat ||= $status ;
214
207
}
208
+ exit $mstat if $mstat ;
215
209
}
216
210
217
211
sub plcheck
218
212
{
219
- chdir $startdir ;
220
-
221
- InstallTemp();
222
- chdir " ${topdir} /src/pl" ;
213
+ chdir " ../../pl" ;
223
214
224
215
foreach my $pl (glob (" *" ))
225
216
{
@@ -256,8 +247,8 @@ sub plcheck
256
247
" ============================================================\n " ;
257
248
print " Checking $lang \n " ;
258
249
my @args = (
259
- " ${tmp_installdir} /bin /pg_regress" ,
260
- " --bindir=${tmp_installdir} /bin " ,
250
+ " ../../../ $Config /pg_regress /pg_regress" ,
251
+ " --bindir=../../../ $Config /psql " ,
261
252
" --dbname=pl_regression" , @lang_args , @tests );
262
253
system (@args );
263
254
my $status = $? >> 8;
@@ -272,7 +263,6 @@ sub subdircheck
272
263
{
273
264
my $subdir = shift ;
274
265
my $module = shift ;
275
- my $mstat = 0;
276
266
277
267
if ( !-d " $module /sql"
278
268
|| !-d " $module /expected"
@@ -319,24 +309,19 @@ sub subdircheck
319
309
print " ============================================================\n " ;
320
310
print " Checking $module \n " ;
321
311
my @args = (
322
- " ${tmp_installdir} /bin /pg_regress" ,
323
- " --bindir=${tmp_installdir} /bin " ,
312
+ " $topdir / $Config /pg_regress /pg_regress" ,
313
+ " --bindir=${topdir} / ${Config} /psql " ,
324
314
" --dbname=contrib_regression" , @opts , @tests );
325
315
system (@args );
326
- my $status = $? >> 8;
327
- $mstat ||= $status ;
328
316
chdir " .." ;
329
-
330
- exit $mstat if $mstat ;
331
317
}
332
318
333
319
sub contribcheck
334
320
{
335
- InstallTemp() ;
336
- chdir " $topdir /contrib " ;
321
+ chdir " ../../../contrib " ;
322
+ my $mstat = 0 ;
337
323
foreach my $module (glob (" *" ))
338
324
{
339
-
340
325
# these configuration-based exclusions must match Install.pm
341
326
next if ($module eq " uuid-ossp" && !defined ($config -> {uuid }));
342
327
next if ($module eq " sslinfo" && !defined ($config -> {openssl }));
@@ -347,26 +332,31 @@ sub contribcheck
347
332
next if ($module eq " sepgsql" );
348
333
349
334
subdircheck(" $topdir /contrib" , $module );
335
+ my $status = $? >> 8;
336
+ $mstat ||= $status ;
350
337
}
338
+ exit $mstat if $mstat ;
351
339
}
352
340
353
341
sub modulescheck
354
342
{
355
- InstallTemp() ;
356
- chdir " $topdir /src/test/modules " ;
343
+ chdir " ../../../src/test/modules " ;
344
+ my $mstat = 0 ;
357
345
foreach my $module (glob (" *" ))
358
346
{
359
347
subdircheck(" $topdir /src/test/modules" , $module );
348
+ my $status = $? >> 8;
349
+ $mstat ||= $status ;
360
350
}
351
+ exit $mstat if $mstat ;
361
352
}
362
353
363
-
364
354
# Run "initdb", then reconfigure authentication.
365
355
sub standard_initdb
366
356
{
367
357
return (
368
- system (" ${tmp_installdir} /bin/ initdb" , ' -N' ) == 0 and system (
369
- " ${tmp_installdir} /bin /pg_regress" , ' --config-auth' ,
358
+ system (' initdb' , ' -N' ) == 0 and system (
359
+ " $topdir / $Config /pg_regress /pg_regress" , ' --config-auth' ,
370
360
$ENV {PGDATA }) == 0);
371
361
}
372
362
@@ -385,13 +375,14 @@ sub upgradecheck
385
375
$ENV {PGPORT } ||= 50432;
386
376
my $tmp_root = " $topdir /src/bin/pg_upgrade/tmp_check" ;
387
377
(mkdir $tmp_root || die $! ) unless -d $tmp_root ;
388
-
389
- InstallTemp();
378
+ my $upg_tmp_install = " $tmp_root /install" ; # unshared temp install
379
+ print " Setting up temp install\n\n " ;
380
+ Install($upg_tmp_install , " all" , $config );
390
381
391
382
# Install does a chdir, so change back after that
392
383
chdir $cwd ;
393
384
my ($bindir , $libdir , $oldsrc , $newsrc ) =
394
- (" $tmp_installdir /bin" , " $tmp_installdir /lib" , $topdir , $topdir );
385
+ (" $upg_tmp_install /bin" , " $upg_tmp_install /lib" , $topdir , $topdir );
395
386
$ENV {PATH } = " $bindir ;$ENV {PATH}" ;
396
387
my $data = " $tmp_root /data" ;
397
388
$ENV {PGDATA } = " $data .old" ;
@@ -530,6 +521,7 @@ sub InstallTemp
530
521
{
531
522
print " Setting up temp install\n\n " ;
532
523
Install(" $tmp_installdir " , " all" , $config );
524
+ $ENV {PATH } = " $tmp_installdir /bin;$ENV {PATH}" ;
533
525
}
534
526
535
527
sub usage
0 commit comments