Commit 431f1599 authored by Michael Paquier's avatar Michael Paquier

Add support for NO_INSTALLCHECK in MSVC scripts

When fetching a list of tests for a given extension in contrib/ or
src/test/modules/, NO_INSTALLCHECK now gets checked first.  If present,
an empty list of tests is returned to let the caller know that tests
for this module need to be bypassed.

This actually fixes a set of issues with MSVC with modules using
REGRESS_OPTS, as an incorrect parsing caused the launched command
to eat the first test listed.  The actual effect on the tree is that
several modules listed a single test, so regressions have been running
with no actual tests.  pg_stat_statements, test_rls_hooks and commit_ts
were impacted by that.  Some other modules like test_decoding (or
snapshot_too_old) don't use yet PGXS rules, but their makefiles will
soon be refactored with an upcoming patch.

Author: Michael Paquier
Reviewed-by: Andrew Dunstan
Discussion: https://postgr.es/m/20181126054302.GI1776@paquier.xyz
parent 2ac180c2
...@@ -361,6 +361,10 @@ sub plcheck ...@@ -361,6 +361,10 @@ sub plcheck
{ {
@lang_args = (); @lang_args = ();
} }
# Move on if no tests are listed.
next if (scalar @tests == 0);
print print
"============================================================\n"; "============================================================\n";
print "Checking $lang\n"; print "Checking $lang\n";
...@@ -391,6 +395,14 @@ sub subdircheck ...@@ -391,6 +395,14 @@ sub subdircheck
chdir $module; chdir $module;
my @tests = fetchTests(); my @tests = fetchTests();
# Leave if no tests are listed in the module.
if (scalar @tests == 0)
{
chdir "..";
return;
}
my @opts = fetchRegressOpts(); my @opts = fetchRegressOpts();
# Special processing for python transform modules, see their respective # Special processing for python transform modules, see their respective
...@@ -638,6 +650,8 @@ sub fetchRegressOpts ...@@ -638,6 +650,8 @@ sub fetchRegressOpts
return @opts; return @opts;
} }
# Fetch the list of tests by parsing a module's Makefile. An empty
# list is returned if the module does not need to run anything.
sub fetchTests sub fetchTests
{ {
...@@ -651,6 +665,14 @@ sub fetchTests ...@@ -651,6 +665,14 @@ sub fetchTests
my $t = ""; my $t = "";
$m =~ s{\\\r?\n}{}g; $m =~ s{\\\r?\n}{}g;
# A module specifying NO_INSTALLCHECK does not support installcheck,
# so bypass its run by returning an empty set of tests.
if ($m =~ /^\s*NO_INSTALLCHECK\s*=\s*\S+/m)
{
return ();
}
if ($m =~ /^REGRESS\s*=\s*(.*)$/gm) if ($m =~ /^REGRESS\s*=\s*(.*)$/gm)
{ {
$t = $1; $t = $1;
......
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