Skip to content

Commit e6ea46c

Browse files
committed
MSVC: Revert most 9.5 changes to pre-9.5 vcregress.pl tests.
The reverted changes did not narrow the semantic gap between the MSVC build system and the GNU make build system. For targets old and new that run multiple suites (contribcheck, modulescheck, tapcheck), restore vcregress.pl to mimicking "make -k" rather than the "make -S" default. Lack of "-k" would be more burdensome than lack of "-S". Keep changes reflecting contemporary changes to the GNU make build system, and keep updates to Makefile parsing. Keep the loss of --psqldir in "check" and "ecpgcheck" targets; it had been a no-op when used alongside --temp-install. No log message mentioned any of the reverted changes. Based on a germ by Michael Paquier. Back-patch to 9.5.
1 parent d6ab146 commit e6ea46c

File tree

1 file changed

+33
-41
lines changed

1 file changed

+33
-41
lines changed

src/tools/msvc/vcregress.pl

+33-41
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,12 @@ sub installcheck
111111

112112
sub check
113113
{
114-
chdir $startdir;
115-
116114
InstallTemp();
117115
chdir "${topdir}/src/test/regress";
118-
119116
my @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
139136
exit $status if $status;
140137
InstallTemp();
141138
chdir "$topdir/src/interfaces/ecpg/test";
142-
143-
$ENV{PATH} = "${tmp_installdir}/bin;${tmp_installdir}/lib;$ENV{PATH}";
144139
$schedule = "ecpg";
145140
my @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

160155
sub 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");
167160
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",
170163
"--inputdir=.",
171164
"--schedule=./isolation_schedule");
172165
push(@args, $maxconn) if $maxconn;
@@ -180,8 +173,8 @@ sub tapcheck
180173
InstallTemp();
181174

182175
my @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";
211204
system(@args);
212205
my $status = $? >> 8;
213-
exit $status if $status;
206+
$mstat ||= $status;
214207
}
208+
exit $mstat if $mstat;
215209
}
216210

217211
sub plcheck
218212
{
219-
chdir $startdir;
220-
221-
InstallTemp();
222-
chdir "${topdir}/src/pl";
213+
chdir "../../pl";
223214

224215
foreach my $pl (glob("*"))
225216
{
@@ -256,8 +247,8 @@ sub plcheck
256247
"============================================================\n";
257248
print "Checking $lang\n";
258249
my @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);
262253
system(@args);
263254
my $status = $? >> 8;
@@ -272,7 +263,6 @@ sub subdircheck
272263
{
273264
my $subdir = shift;
274265
my $module = shift;
275-
my $mstat = 0;
276266

277267
if ( !-d "$module/sql"
278268
|| !-d "$module/expected"
@@ -319,24 +309,19 @@ sub subdircheck
319309
print "============================================================\n";
320310
print "Checking $module\n";
321311
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",
324314
"--dbname=contrib_regression", @opts, @tests);
325315
system(@args);
326-
my $status = $? >> 8;
327-
$mstat ||= $status;
328316
chdir "..";
329-
330-
exit $mstat if $mstat;
331317
}
332318

333319
sub contribcheck
334320
{
335-
InstallTemp();
336-
chdir "$topdir/contrib";
321+
chdir "../../../contrib";
322+
my $mstat = 0;
337323
foreach my $module (glob("*"))
338324
{
339-
340325
# these configuration-based exclusions must match Install.pm
341326
next if ($module eq "uuid-ossp" && !defined($config->{uuid}));
342327
next if ($module eq "sslinfo" && !defined($config->{openssl}));
@@ -347,26 +332,31 @@ sub contribcheck
347332
next if ($module eq "sepgsql");
348333

349334
subdircheck("$topdir/contrib", $module);
335+
my $status = $? >> 8;
336+
$mstat ||= $status;
350337
}
338+
exit $mstat if $mstat;
351339
}
352340

353341
sub modulescheck
354342
{
355-
InstallTemp();
356-
chdir "$topdir/src/test/modules";
343+
chdir "../../../src/test/modules";
344+
my $mstat = 0;
357345
foreach my $module (glob("*"))
358346
{
359347
subdircheck("$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.
365355
sub standard_initdb
366356
{
367357
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',
370360
$ENV{PGDATA}) == 0);
371361
}
372362

@@ -385,13 +375,14 @@ sub upgradecheck
385375
$ENV{PGPORT} ||= 50432;
386376
my $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
392383
chdir $cwd;
393384
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);
395386
$ENV{PATH} = "$bindir;$ENV{PATH}";
396387
my $data = "$tmp_root/data";
397388
$ENV{PGDATA} = "$data.old";
@@ -530,6 +521,7 @@ sub InstallTemp
530521
{
531522
print "Setting up temp install\n\n";
532523
Install("$tmp_installdir", "all", $config);
524+
$ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}";
533525
}
534526

535527
sub usage

0 commit comments

Comments
 (0)