diff options
author | Andrew Dunstan | 2015-08-03 00:58:18 +0000 |
---|---|---|
committer | Andrew Dunstan | 2015-08-03 00:58:18 +0000 |
commit | 690ed2b76ab91eb79ea04ee2bfbdc8a2693f2a37 (patch) | |
tree | 5dce2e0ab1ee2fe542e87df6187182ca8480eeaf /src/test/perl/TestLib.pm | |
parent | 13bba02271dce865cd20b6f49224889c73fed4e7 (diff) |
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.
Diffstat (limited to 'src/test/perl/TestLib.pm')
-rw-r--r-- | src/test/perl/TestLib.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index 6677a57990c..8fd6f2c92a8 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -30,6 +30,7 @@ our @EXPORT = qw( $tmp_check $log_path + $windows_os ); use Cwd; @@ -42,6 +43,8 @@ use SimpleTee; use Test::More; +our $windows_os = $Config{osname} eq 'MSWin32' || $Config{osname} eq 'msys'; + # Open log file. For each test, the log file name uses the name of the # file launching this module, without the .pl suffix. our ($tmp_check, $log_path); @@ -140,7 +143,7 @@ sub standard_initdb open CONF, ">>$pgdata/postgresql.conf"; print CONF "\n# Added by TestLib.pm)\n"; - if ($Config{osname} eq "MSWin32") + if ($windows_os) { print CONF "listen_addresses = '127.0.0.1'\n"; } @@ -151,7 +154,7 @@ sub standard_initdb } close CONF; - $ENV{PGHOST} = ($Config{osname} eq "MSWin32") ? "127.0.0.1" : $tempdir_short; + $ENV{PGHOST} = $windows_os ? "127.0.0.1" : $tempdir_short; } # Set up the cluster to allow replication connections, in the same way that @@ -162,7 +165,7 @@ sub configure_hba_for_replication open HBA, ">>$pgdata/pg_hba.conf"; print HBA "\n# Allow replication (set up by TestLib.pm)\n"; - if ($Config{osname} ne "MSWin32") + if (! $windows_os) { print HBA "local replication all trust\n"; } |