Skip to content

Commit 690ed2b

Browse files
committed
Allow TAP tests to run under Msys
The Msys DTK perl, which is required to run TAP tests under Msys as a native perl won't recognize the correct virtual paths, has its osname recorded in the Config module as 'msys' instead of 'MSWin32'. To avoid having to repeat the test a variable is created that is true iff the osname is either of these values, and is then used everywhere that matters.
1 parent 13bba02 commit 690ed2b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
# The following tests test symlinks. Windows doesn't have symlinks, so
9393
# skip on Windows.
9494
SKIP: {
95-
skip "symlinks not supported on Windows", 10 if ($Config{osname} eq "MSWin32");
95+
skip "symlinks not supported on Windows", 10 if ($windows_os);
9696

9797
# Create a temporary directory in the system location and symlink it
9898
# to our physical temp location. That way we can use shorter names

src/bin/pg_ctl/t/001_start_stop.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"$tempdir/data" ],
2121
'configure authentication');
2222
open CONF, ">>$tempdir/data/postgresql.conf";
23-
if ($Config{osname} ne "MSWin32")
23+
if (! $windows_os)
2424
{
2525
print CONF "listen_addresses = ''\n";
2626
print CONF "unix_socket_directories = '$tempdir_short'\n";

src/test/perl/TestLib.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ our @EXPORT = qw(
3030
3131
$tmp_check
3232
$log_path
33+
$windows_os
3334
);
3435

3536
use Cwd;
@@ -42,6 +43,8 @@ use SimpleTee;
4243

4344
use Test::More;
4445

46+
our $windows_os = $Config{osname} eq 'MSWin32' || $Config{osname} eq 'msys';
47+
4548
# Open log file. For each test, the log file name uses the name of the
4649
# file launching this module, without the .pl suffix.
4750
our ($tmp_check, $log_path);
@@ -140,7 +143,7 @@ sub standard_initdb
140143

141144
open CONF, ">>$pgdata/postgresql.conf";
142145
print CONF "\n# Added by TestLib.pm)\n";
143-
if ($Config{osname} eq "MSWin32")
146+
if ($windows_os)
144147
{
145148
print CONF "listen_addresses = '127.0.0.1'\n";
146149
}
@@ -151,7 +154,7 @@ sub standard_initdb
151154
}
152155
close CONF;
153156

154-
$ENV{PGHOST} = ($Config{osname} eq "MSWin32") ? "127.0.0.1" : $tempdir_short;
157+
$ENV{PGHOST} = $windows_os ? "127.0.0.1" : $tempdir_short;
155158
}
156159

157160
# Set up the cluster to allow replication connections, in the same way that
@@ -162,7 +165,7 @@ sub configure_hba_for_replication
162165

163166
open HBA, ">>$pgdata/pg_hba.conf";
164167
print HBA "\n# Allow replication (set up by TestLib.pm)\n";
165-
if ($Config{osname} ne "MSWin32")
168+
if (! $windows_os)
166169
{
167170
print HBA "local replication all trust\n";
168171
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy