@@ -111,15 +111,12 @@ sub installcheck
111111
112112sub check
113113{
114- chdir $startdir ;
115-
116114InstallTemp();
117115chdir " ${topdir} /src/test/regress" ;
118-
119116my @args = (
120- " ${tmp_installdir} /bin /pg_regress" ,
117+ " ../../../ $Config /pg_regress /pg_regress" ,
121118" --dlpath=." ,
122- " --bindir=${tmp_installdir} /bin " ,
119+ " --bindir=" ,
123120" --schedule=${schedule} _schedule" ,
124121" --encoding=SQL_ASCII" ,
125122" --no-locale" ,
@@ -139,11 +136,9 @@ sub ecpgcheck
139136exit $status if $status ;
140137InstallTemp();
141138chdir " $topdir /src/interfaces/ecpg/test" ;
142-
143- $ENV {PATH } =" ${tmp_installdir} /bin;${tmp_installdir} /lib;$ENV {PATH}" ;
144139$schedule =" ecpg" ;
145140my @args = (
146- " ${tmp_installdir} /bin /pg_regress_ecpg" ,
141+ " ../../../../ $Config /pg_regress_ecpg /pg_regress_ecpg" ,
147142" --bindir=" ,
148143" --dbname=regress1,connectdb" ,
149144" --create-role=connectuser,connectdb" ,
@@ -159,14 +154,12 @@ sub ecpgcheck
159154
160155sub isolationcheck
161156{
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" );
167160my @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 " ,
170163" --inputdir=." ,
171164" --schedule=./isolation_schedule" );
172165push (@args ,$maxconn )if $maxconn ;
@@ -180,8 +173,8 @@ sub tapcheck
180173InstallTemp();
181174
182175my @args = (" prove" ," --verbose" ," t/*.pl" );
176+ my $mstat = 0;
183177
184- $ENV {PATH } =" $tmp_installdir /bin;$ENV {PATH}" ;
185178$ENV {PERL5LIB } =" $topdir /src/test/perl;$ENV {PERL5LIB}" ;
186179$ENV {PG_REGRESS } =" $topdir /$Config /pg_regress/pg_regress" ;
187180
@@ -210,16 +203,14 @@ sub tapcheck
210203$ENV {TESTDIR } =" $dir " ;
211204system (@args );
212205my $status =$? >> 8;
213- exit $status if $status ;
206+ $mstat ||= $status ;
214207}
208+ exit $mstat if $mstat ;
215209}
216210
217211sub plcheck
218212{
219- chdir $startdir ;
220-
221- InstallTemp();
222- chdir " ${topdir} /src/pl" ;
213+ chdir " ../../pl" ;
223214
224215foreach my $pl (glob (" *" ))
225216{
@@ -256,8 +247,8 @@ sub plcheck
256247" ============================================================\n " ;
257248print " Checking$lang \n " ;
258249my @args = (
259- " ${tmp_installdir} /bin /pg_regress" ,
260- " --bindir=${tmp_installdir} /bin " ,
250+ " ../../../ $Config /pg_regress /pg_regress" ,
251+ " --bindir=../../../ $Config /psql " ,
261252" --dbname=pl_regression" ,@lang_args ,@tests );
262253system (@args );
263254my $status =$? >> 8;
@@ -272,7 +263,6 @@ sub subdircheck
272263{
273264my $subdir =shift ;
274265my $module =shift ;
275- my $mstat = 0;
276266
277267if ( !-d " $module /sql"
278268|| !-d " $module /expected"
@@ -319,24 +309,19 @@ sub subdircheck
319309print " ============================================================\n " ;
320310print " Checking$module \n " ;
321311my @args = (
322- " ${tmp_installdir} /bin /pg_regress" ,
323- " --bindir=${tmp_installdir} /bin " ,
312+ " $topdir / $Config /pg_regress /pg_regress" ,
313+ " --bindir=${topdir} / ${Config} /psql " ,
324314" --dbname=contrib_regression" ,@opts ,@tests );
325315system (@args );
326- my $status =$? >> 8;
327- $mstat ||=$status ;
328316chdir " .." ;
329-
330- exit $mstat if $mstat ;
331317}
332318
333319sub contribcheck
334320{
335- InstallTemp() ;
336- chdir " $topdir /contrib " ;
321+ chdir " ../../../contrib " ;
322+ my $mstat = 0 ;
337323foreach my $module (glob (" *" ))
338324{
339-
340325# these configuration-based exclusions must match Install.pm
341326next if ($module eq " uuid-ossp" && !defined ($config -> {uuid }));
342327next if ($module eq " sslinfo" && !defined ($config -> {openssl }));
@@ -347,26 +332,31 @@ sub contribcheck
347332next if ($module eq " sepgsql" );
348333
349334subdircheck(" $topdir /contrib" ,$module );
335+ my $status =$? >> 8;
336+ $mstat ||=$status ;
350337}
338+ exit $mstat if $mstat ;
351339}
352340
353341sub modulescheck
354342{
355- InstallTemp() ;
356- chdir " $topdir /src/test/modules " ;
343+ chdir " ../../../src/test/modules " ;
344+ my $mstat = 0 ;
357345foreach my $module (glob (" *" ))
358346{
359347subdircheck(" $topdir /src/test/modules" ,$module );
348+ my $status =$? >> 8;
349+ $mstat ||=$status ;
360350}
351+ exit $mstat if $mstat ;
361352}
362353
363-
364354# Run "initdb", then reconfigure authentication.
365355sub standard_initdb
366356{
367357return (
368- system (" ${tmp_installdir} /bin/ initdb" ,' -N' ) == 0and system (
369- " ${tmp_installdir} /bin /pg_regress" ,' --config-auth' ,
358+ system (' initdb' ,' -N' ) == 0and system (
359+ " $topdir / $Config /pg_regress /pg_regress" ,' --config-auth' ,
370360$ENV {PGDATA }) == 0);
371361}
372362
@@ -385,13 +375,14 @@ sub upgradecheck
385375$ENV {PGPORT } ||= 50432;
386376my $tmp_root =" $topdir /src/bin/pg_upgrade/tmp_check" ;
387377(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 );
390381
391382# Install does a chdir, so change back after that
392383chdir $cwd ;
393384my ($bindir ,$libdir ,$oldsrc ,$newsrc ) =
394- (" $tmp_installdir /bin" ," $tmp_installdir /lib" ,$topdir ,$topdir );
385+ (" $upg_tmp_install /bin" ," $upg_tmp_install /lib" ,$topdir ,$topdir );
395386$ENV {PATH } =" $bindir ;$ENV {PATH}" ;
396387my $data =" $tmp_root /data" ;
397388$ENV {PGDATA } =" $data .old" ;
@@ -530,6 +521,7 @@ sub InstallTemp
530521{
531522print " Setting up temp install\n\n " ;
532523Install(" $tmp_installdir " ," all" ,$config );
524+ $ENV {PATH } =" $tmp_installdir /bin;$ENV {PATH}" ;
533525}
534526
535527sub usage