Commit e6ea46c3 authored by Noah Misch's avatar Noah Misch

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.
parent d6ab1467
...@@ -111,15 +111,12 @@ sub installcheck ...@@ -111,15 +111,12 @@ sub installcheck
sub check sub check
{ {
chdir $startdir;
InstallTemp(); InstallTemp();
chdir "${topdir}/src/test/regress"; chdir "${topdir}/src/test/regress";
my @args = ( my @args = (
"${tmp_installdir}/bin/pg_regress", "../../../$Config/pg_regress/pg_regress",
"--dlpath=.", "--dlpath=.",
"--bindir=${tmp_installdir}/bin", "--bindir=",
"--schedule=${schedule}_schedule", "--schedule=${schedule}_schedule",
"--encoding=SQL_ASCII", "--encoding=SQL_ASCII",
"--no-locale", "--no-locale",
...@@ -139,11 +136,9 @@ sub ecpgcheck ...@@ -139,11 +136,9 @@ sub ecpgcheck
exit $status if $status; exit $status if $status;
InstallTemp(); InstallTemp();
chdir "$topdir/src/interfaces/ecpg/test"; chdir "$topdir/src/interfaces/ecpg/test";
$ENV{PATH} = "${tmp_installdir}/bin;${tmp_installdir}/lib;$ENV{PATH}";
$schedule = "ecpg"; $schedule = "ecpg";
my @args = ( my @args = (
"${tmp_installdir}/bin/pg_regress_ecpg", "../../../../$Config/pg_regress_ecpg/pg_regress_ecpg",
"--bindir=", "--bindir=",
"--dbname=regress1,connectdb", "--dbname=regress1,connectdb",
"--create-role=connectuser,connectdb", "--create-role=connectuser,connectdb",
...@@ -159,14 +154,12 @@ sub ecpgcheck ...@@ -159,14 +154,12 @@ sub ecpgcheck
sub isolationcheck sub isolationcheck
{ {
chdir $startdir; chdir "../isolation";
copy("../../../$Config/isolationtester/isolationtester.exe",
InstallTemp(); "../../../$Config/pg_isolation_regress");
chdir "${topdir}/src/test/isolation";
my @args = ( my @args = (
"${tmp_installdir}/bin/pg_isolation_regress", "../../../$Config/pg_isolation_regress/pg_isolation_regress",
"--bindir=${tmp_installdir}/bin", "--bindir=../../../$Config/psql",
"--inputdir=.", "--inputdir=.",
"--schedule=./isolation_schedule"); "--schedule=./isolation_schedule");
push(@args, $maxconn) if $maxconn; push(@args, $maxconn) if $maxconn;
...@@ -180,8 +173,8 @@ sub tapcheck ...@@ -180,8 +173,8 @@ sub tapcheck
InstallTemp(); InstallTemp();
my @args = ( "prove", "--verbose", "t/*.pl"); my @args = ( "prove", "--verbose", "t/*.pl");
my $mstat = 0;
$ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}";
$ENV{PERL5LIB} = "$topdir/src/test/perl;$ENV{PERL5LIB}"; $ENV{PERL5LIB} = "$topdir/src/test/perl;$ENV{PERL5LIB}";
$ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress"; $ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress";
...@@ -210,16 +203,14 @@ sub tapcheck ...@@ -210,16 +203,14 @@ sub tapcheck
$ENV{TESTDIR} = "$dir"; $ENV{TESTDIR} = "$dir";
system(@args); system(@args);
my $status = $? >> 8; my $status = $? >> 8;
exit $status if $status; $mstat ||= $status;
} }
exit $mstat if $mstat;
} }
sub plcheck sub plcheck
{ {
chdir $startdir; chdir "../../pl";
InstallTemp();
chdir "${topdir}/src/pl";
foreach my $pl (glob("*")) foreach my $pl (glob("*"))
{ {
...@@ -256,8 +247,8 @@ sub plcheck ...@@ -256,8 +247,8 @@ sub plcheck
"============================================================\n"; "============================================================\n";
print "Checking $lang\n"; print "Checking $lang\n";
my @args = ( my @args = (
"${tmp_installdir}/bin/pg_regress", "../../../$Config/pg_regress/pg_regress",
"--bindir=${tmp_installdir}/bin", "--bindir=../../../$Config/psql",
"--dbname=pl_regression", @lang_args, @tests); "--dbname=pl_regression", @lang_args, @tests);
system(@args); system(@args);
my $status = $? >> 8; my $status = $? >> 8;
...@@ -272,7 +263,6 @@ sub subdircheck ...@@ -272,7 +263,6 @@ sub subdircheck
{ {
my $subdir = shift; my $subdir = shift;
my $module = shift; my $module = shift;
my $mstat = 0;
if ( !-d "$module/sql" if ( !-d "$module/sql"
|| !-d "$module/expected" || !-d "$module/expected"
...@@ -319,24 +309,19 @@ sub subdircheck ...@@ -319,24 +309,19 @@ sub subdircheck
print "============================================================\n"; print "============================================================\n";
print "Checking $module\n"; print "Checking $module\n";
my @args = ( my @args = (
"${tmp_installdir}/bin/pg_regress", "$topdir/$Config/pg_regress/pg_regress",
"--bindir=${tmp_installdir}/bin", "--bindir=${topdir}/${Config}/psql",
"--dbname=contrib_regression", @opts, @tests); "--dbname=contrib_regression", @opts, @tests);
system(@args); system(@args);
my $status = $? >> 8;
$mstat ||= $status;
chdir ".."; chdir "..";
exit $mstat if $mstat;
} }
sub contribcheck sub contribcheck
{ {
InstallTemp(); chdir "../../../contrib";
chdir "$topdir/contrib"; my $mstat = 0;
foreach my $module (glob("*")) foreach my $module (glob("*"))
{ {
# these configuration-based exclusions must match Install.pm # these configuration-based exclusions must match Install.pm
next if ($module eq "uuid-ossp" && !defined($config->{uuid})); next if ($module eq "uuid-ossp" && !defined($config->{uuid}));
next if ($module eq "sslinfo" && !defined($config->{openssl})); next if ($module eq "sslinfo" && !defined($config->{openssl}));
...@@ -347,26 +332,31 @@ sub contribcheck ...@@ -347,26 +332,31 @@ sub contribcheck
next if ($module eq "sepgsql"); next if ($module eq "sepgsql");
subdircheck("$topdir/contrib", $module); subdircheck("$topdir/contrib", $module);
my $status = $? >> 8;
$mstat ||= $status;
} }
exit $mstat if $mstat;
} }
sub modulescheck sub modulescheck
{ {
InstallTemp(); chdir "../../../src/test/modules";
chdir "$topdir/src/test/modules"; my $mstat = 0;
foreach my $module (glob("*")) foreach my $module (glob("*"))
{ {
subdircheck("$topdir/src/test/modules", $module); subdircheck("$topdir/src/test/modules", $module);
my $status = $? >> 8;
$mstat ||= $status;
} }
exit $mstat if $mstat;
} }
# Run "initdb", then reconfigure authentication. # Run "initdb", then reconfigure authentication.
sub standard_initdb sub standard_initdb
{ {
return ( return (
system("${tmp_installdir}/bin/initdb", '-N') == 0 and system( system('initdb', '-N') == 0 and system(
"${tmp_installdir}/bin/pg_regress", '--config-auth', "$topdir/$Config/pg_regress/pg_regress", '--config-auth',
$ENV{PGDATA}) == 0); $ENV{PGDATA}) == 0);
} }
...@@ -385,13 +375,14 @@ sub upgradecheck ...@@ -385,13 +375,14 @@ sub upgradecheck
$ENV{PGPORT} ||= 50432; $ENV{PGPORT} ||= 50432;
my $tmp_root = "$topdir/src/bin/pg_upgrade/tmp_check"; my $tmp_root = "$topdir/src/bin/pg_upgrade/tmp_check";
(mkdir $tmp_root || die $!) unless -d $tmp_root; (mkdir $tmp_root || die $!) unless -d $tmp_root;
my $upg_tmp_install = "$tmp_root/install"; # unshared temp install
InstallTemp(); print "Setting up temp install\n\n";
Install($upg_tmp_install, "all", $config);
# Install does a chdir, so change back after that # Install does a chdir, so change back after that
chdir $cwd; chdir $cwd;
my ($bindir, $libdir, $oldsrc, $newsrc) = my ($bindir, $libdir, $oldsrc, $newsrc) =
("$tmp_installdir/bin", "$tmp_installdir/lib", $topdir, $topdir); ("$upg_tmp_install/bin", "$upg_tmp_install/lib", $topdir, $topdir);
$ENV{PATH} = "$bindir;$ENV{PATH}"; $ENV{PATH} = "$bindir;$ENV{PATH}";
my $data = "$tmp_root/data"; my $data = "$tmp_root/data";
$ENV{PGDATA} = "$data.old"; $ENV{PGDATA} = "$data.old";
...@@ -530,6 +521,7 @@ sub InstallTemp ...@@ -530,6 +521,7 @@ sub InstallTemp
{ {
print "Setting up temp install\n\n"; print "Setting up temp install\n\n";
Install("$tmp_installdir", "all", $config); Install("$tmp_installdir", "all", $config);
$ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}";
} }
sub usage sub usage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment