Commit 4cb7d671 authored by Alvaro Herrera's avatar Alvaro Herrera

Add new target modulescheck in vcregress.pl

This allows an MSVC build to run regression tests related to modules in
src/test/modules.

Author: Michael Paquier
Reviewed by: Andrew Dunstan
parent 2e5d52a6
...@@ -436,6 +436,7 @@ $ENV{CONFIG}="Debug"; ...@@ -436,6 +436,7 @@ $ENV{CONFIG}="Debug";
<userinput>vcregress installcheck</userinput> <userinput>vcregress installcheck</userinput>
<userinput>vcregress plcheck</userinput> <userinput>vcregress plcheck</userinput>
<userinput>vcregress contribcheck</userinput> <userinput>vcregress contribcheck</userinput>
<userinput>vcregress modulescheck</userinput>
<userinput>vcregress ecpgcheck</userinput> <userinput>vcregress ecpgcheck</userinput>
<userinput>vcregress isolationcheck</userinput> <userinput>vcregress isolationcheck</userinput>
<userinput>vcregress upgradecheck</userinput> <userinput>vcregress upgradecheck</userinput>
......
...@@ -31,7 +31,7 @@ if (-e "src/tools/msvc/buildenv.pl") ...@@ -31,7 +31,7 @@ if (-e "src/tools/msvc/buildenv.pl")
my $what = shift || ""; my $what = shift || "";
if ($what =~ if ($what =~
/^(check|installcheck|plcheck|contribcheck|ecpgcheck|isolationcheck|upgradecheck)$/i /^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck)$/i
) )
{ {
$what = uc $what; $what = uc $what;
...@@ -49,7 +49,7 @@ copy("$Config/autoinc/autoinc.dll", "src/test/regress"); ...@@ -49,7 +49,7 @@ copy("$Config/autoinc/autoinc.dll", "src/test/regress");
copy("$Config/regress/regress.dll", "src/test/regress"); copy("$Config/regress/regress.dll", "src/test/regress");
copy("$Config/dummy_seclabel/dummy_seclabel.dll", "src/test/regress"); copy("$Config/dummy_seclabel/dummy_seclabel.dll", "src/test/regress");
$ENV{PATH} = "../../../$Config/libpq;../../$Config/libpq;$ENV{PATH}"; $ENV{PATH} = "$topdir/$Config/libpq;$topdir/$Config/libpq;$ENV{PATH}";
my $schedule = shift; my $schedule = shift;
unless ($schedule) unless ($schedule)
...@@ -76,6 +76,7 @@ my %command = ( ...@@ -76,6 +76,7 @@ my %command = (
INSTALLCHECK => \&installcheck, INSTALLCHECK => \&installcheck,
ECPGCHECK => \&ecpgcheck, ECPGCHECK => \&ecpgcheck,
CONTRIBCHECK => \&contribcheck, CONTRIBCHECK => \&contribcheck,
MODULESCHECK => \&modulescheck,
ISOLATIONCHECK => \&isolationcheck, ISOLATIONCHECK => \&isolationcheck,
UPGRADECHECK => \&upgradecheck,); UPGRADECHECK => \&upgradecheck,);
...@@ -213,22 +214,18 @@ sub plcheck ...@@ -213,22 +214,18 @@ sub plcheck
chdir "../../.."; chdir "../../..";
} }
sub contribcheck sub subdircheck
{ {
chdir "../../../contrib"; my $subdir = shift;
my $module = shift;
my $mstat = 0; my $mstat = 0;
foreach my $module (glob("*"))
{
# these configuration-based exclusions must match Install.pm
next if ($module eq "uuid-ossp" && !defined($config->{uuid}));
next if ($module eq "sslinfo" && !defined($config->{openssl}));
next if ($module eq "xml2" && !defined($config->{xml}));
next if ($module eq "sepgsql");
next if ( ! -d "$module/sql" ||
unless -d "$module/sql" ! -d "$module/expected" ||
&& -d "$module/expected" ( ! -f "$module/GNUmakefile" && ! -f "$module/Makefile"))
&& (-f "$module/GNUmakefile" || -f "$module/Makefile"); {
return;
}
chdir $module; chdir $module;
print print
"============================================================\n"; "============================================================\n";
...@@ -236,17 +233,42 @@ sub contribcheck ...@@ -236,17 +233,42 @@ sub contribcheck
my @tests = fetchTests(); my @tests = fetchTests();
my @opts = fetchRegressOpts(); my @opts = fetchRegressOpts();
my @args = ( my @args = (
"../../$Config/pg_regress/pg_regress", "$topdir/$Config/pg_regress/pg_regress",
"--psqldir=../../$Config/psql", "--psqldir=$topdir/$Config/psql",
"--dbname=contrib_regression", @opts, @tests); "--dbname=contrib_regression", @opts, @tests);
system(@args); system(@args);
my $status = $? >> 8; my $status = $? >> 8;
$mstat ||= $status; $mstat ||= $status;
chdir ".."; chdir "..";
}
exit $mstat if $mstat; exit $mstat if $mstat;
} }
sub contribcheck
{
chdir "$topdir/contrib";
foreach my $module (glob("*"))
{
# these configuration-based exclusions must match Install.pm
next if ($module eq "uuid-ossp" && !defined($config->{uuid}));
next if ($module eq "sslinfo" && !defined($config->{openssl}));
next if ($module eq "xml2" && !defined($config->{xml}));
next if ($module eq "sepgsql");
subdircheck("$topdir/contrib", $module);
}
}
sub modulescheck
{
chdir "$topdir/src/test/modules";
foreach my $module (glob("*"))
{
subdircheck("$topdir/src/test/modules", $module);
}
}
# Run "initdb", then reconfigure authentication. # Run "initdb", then reconfigure authentication.
sub standard_initdb sub standard_initdb
{ {
......
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