aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2015-04-29 13:49:24 -0400
committerAndrew Dunstan <andrew@dunslane.net>2015-04-29 13:49:24 -0400
commiteb010637dd47be65e5d8b22d6965c2e96f6937b8 (patch)
tree5c6774aa267c9c6a14084ceb5e902ac6319691de /src
parent5aa2350426c4fdb3d04568b65aadac397012bbcb (diff)
downloadpostgresql-eb010637dd47be65e5d8b22d6965c2e96f6937b8.tar.gz
postgresql-eb010637dd47be65e5d8b22d6965c2e96f6937b8.zip
Enable transforms tests for python 2 on MSVC builds
Currently regression tests for python 3 are disabled on MSVC, and these tests fail with python 3, too, so we have some work to do to enable both. Meanwhile, all the buildfarm hosts seem to be building with python 2 anyway, so this at least gets us some coverage. Original patch from Michael Paquier, significantly modified by me.
Diffstat (limited to 'src')
-rw-r--r--src/tools/msvc/vcregress.pl42
1 files changed, 38 insertions, 4 deletions
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 8c071a5edde..d73775c7430 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -238,12 +238,46 @@ sub subdircheck
{
return;
}
+
chdir $module;
+ my @tests = fetchTests();
+ my @opts = fetchRegressOpts();
+
+ # Add some options for transform modules, see their respective
+ # Makefile for more details regarding Python-version specific
+ # dependencies.
+ if ($module eq "hstore_plpython" ||
+ $module eq "ltree_plpython")
+ {
+ die "Python not enabled in configuration"
+ if !defined($config->{python});
+
+ # Attempt to get python version and location.
+ # Assume python.exe in specified dir.
+ my $pythonprog = "import sys;" .
+ "print(str(sys.version_info[0]))";
+ my $prefixcmd = $config->{python}
+ . "\\python -c \"$pythonprog\"";
+ my $pyver = `$prefixcmd`;
+ die "Could not query for python version!\n" if $?;
+ chomp($pyver);
+ if ($pyver eq "2")
+ {
+ push @opts, "--load-extension=plpythonu";
+ push @opts, '--load-extension=' . $module . 'u';
+ }
+ else
+ {
+ # disable tests on python3 for now.
+ chdir "..";
+ return;
+ }
+ }
+
+
print
"============================================================\n";
print "Checking $module\n";
- my @tests = fetchTests();
- my @opts = fetchRegressOpts();
my @args = (
"${tmp_installdir}/bin/pg_regress",
"--bindir=${tmp_installdir}/bin",
@@ -266,8 +300,8 @@ sub contribcheck
next if ($module eq "sslinfo" && !defined($config->{openssl}));
next if ($module eq "xml2" && !defined($config->{xml}));
next if ($module eq "hstore_plperl" && !defined($config->{perl}));
- next if ($module eq "hstore_plpython");
- next if ($module eq "ltree_plpython");
+ next if ($module eq "hstore_plpython" && !defined($config->{python}));
+ next if ($module eq "ltree_plpython" && !defined($config->{python}));
next if ($module eq "sepgsql");
subdircheck("$topdir/contrib", $module);