summaryrefslogtreecommitdiff
path: root/src/tools/msvc
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-29 19:17:02 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-29 19:17:02 +0300
commit13d856e177e69083f543d6383eeda9e12ce3c55c (patch)
tree996a28e65f66ad64dd78f5b2495349a84db9040e /src/tools/msvc
parent5f1066074cd85b829371a4123839d16f52553c3d (diff)
downloadpostgresql-13d856e177e69083f543d6383eeda9e12ce3c55c.tar.gz
Make TAP tests work on Windows.
On Windows, use listen_address=127.0.0.1 to allow TCP connections. We were already using "pg_regress --config-auth" to set up HBA appropriately. The standard_initdb helper function now sets up the server's unix_socket_directories or listen_addresses in the config file, so that they don't need to be specified in the pg_ctl command line anymore. That way, the pg_ctl invocations in test programs don't need to differ between Windows and Unix. Add another helper function to configure the server's pg_hba.conf to allow replication connections. The configuration is done similarly to "pg_regress --config-auth": trust on domain sockets on Unix, and SSPI authentication on Windows. Replace calls to "cat" and "touch" programs with built-in perl code, as those programs don't normally exist on Windows. Add instructions in the docs on how to install IPC::Run on Windows. Adjust vcregress.pl to not replace PERL5LIB completely in vcregress.pl, because otherwise cannot install IPC::Run in a non-standard location easily. Michael Paquier, reviewed by Noah Misch, some additional tweaking by me.
Diffstat (limited to 'src/tools/msvc')
-rwxr-xr-xsrc/tools/msvc/clean.bat7
-rw-r--r--src/tools/msvc/vcregress.pl46
2 files changed, 51 insertions, 2 deletions
diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat
index fbe3cc6744..e3da6aa282 100755
--- a/src/tools/msvc/clean.bat
+++ b/src/tools/msvc/clean.bat
@@ -88,6 +88,13 @@ if exist src\test\regress\regress.dll del /q src\test\regress\regress.dll
if exist src\test\regress\refint.dll del /q src\test\regress\refint.dll
if exist src\test\regress\autoinc.dll del /q src\test\regress\autoinc.dll
+if exist src\bin\initdb\tmp_check rd /s /q src\bin\initdb\tmp_check
+if exist src\bin\pg_basebackup\tmp_check rd /s /q src\bin\pg_basebackup\tmp_check
+if exist src\bin\pg_config\tmp_check rd /s /q src\bin\pg_config\tmp_check
+if exist src\bin\pg_ctl\tmp_check rd /s /q src\bin\pg_ctl\tmp_check
+if exist src\bin\pg_rewind\tmp_check rd /s /q src\bin\pg_rewind\tmp_check
+if exist src\bin\scripts\tmp_check rd /s /q src\bin\scripts\tmp_check
+
REM Clean up datafiles built with contrib
REM cd contrib
REM for /r %%f in (*.sql) do if exist %%f.in del %%f
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 6196383615..92b98e765f 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -7,7 +7,9 @@ use strict;
our $config;
use Cwd;
+use File::Basename;
use File::Copy;
+use File::Find ();
use Install qw(Install);
@@ -32,7 +34,7 @@ if (-e "src/tools/msvc/buildenv.pl")
my $what = shift || "";
if ($what =~
-/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck)$/i
+/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|tapcheck)$/i
)
{
$what = uc $what;
@@ -59,7 +61,7 @@ unless ($schedule)
$schedule = "parallel" if ($what eq 'CHECK' || $what =~ /PARALLEL/);
}
-$ENV{PERL5LIB} = "$topdir/src/tools/msvc";
+$ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}";
my $maxconn = "";
$maxconn = "--max_connections=$ENV{MAX_CONNECTIONS}"
@@ -79,6 +81,7 @@ my %command = (
CONTRIBCHECK => \&contribcheck,
MODULESCHECK => \&modulescheck,
ISOLATIONCHECK => \&isolationcheck,
+ TAPCHECK => \&tapcheck,
UPGRADECHECK => \&upgradecheck,);
my $proc = $command{$what};
@@ -172,6 +175,45 @@ sub isolationcheck
exit $status if $status;
}
+sub tapcheck
+{
+ InstallTemp();
+
+ my @args = ( "prove", "--verbose", "t/*.pl");
+
+ $ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}";
+ $ENV{PERL5LIB} = "$topdir/src/test/perl;$ENV{PERL5LIB}";
+ $ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress";
+
+ # Find out all the existing TAP tests by looking for t/ directories
+ # in the tree.
+ my $tap_dirs = [];
+ my @top_dir = ($topdir);
+ File::Find::find(
+ { wanted => sub {
+ /^t\z/s
+ && push(@$tap_dirs, $File::Find::name);
+ }
+ },
+ @top_dir);
+
+ # Process each test
+ foreach my $test_path (@$tap_dirs)
+ {
+ # Like on Unix "make check-world", don't run the SSL test suite
+ # automatically.
+ next if ($test_path =~ /\/src\/test\/ssl\//);
+
+ my $dir = dirname($test_path);
+ chdir $dir;
+ # Reset those values, they may have been changed by another test.
+ $ENV{TESTDIR} = "$dir";
+ system(@args);
+ my $status = $? >> 8;
+ exit $status if $status;
+ }
+}
+
sub plcheck
{
chdir $startdir;