diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2017-04-23 09:39:43 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2017-04-23 09:39:43 -0400 |
commit | 11927e575dd2afc8361e785c34db2141156702d6 (patch) | |
tree | 2087a20f2d847407eaa85d82a10de5c8daed8e1b /src | |
parent | 9d5f0718d75772265b476e41f8a7e97dd8856710 (diff) |
Fix TAP infrastructure to support Mingw better
archive_command and restore_command need to refer to Windows paths, not
Msys virtual file system paths, as postgres is completely unaware of the
latter, so prefix them with the Windows path to the virtual file system
root. Clean psql output of carriage returns.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/perl/PostgresNode.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 20bc90b0075..65c4a880452 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -101,6 +101,15 @@ our @EXPORT = qw( our ($test_localhost, $test_pghost, $last_port_assigned, @all_nodes); +# Windows path to virtual file system root + +our $vfs_path = ''; +if ($Config{osname} eq 'msys') +{ + $vfs_path = `cd / && pwd -W`; + chomp $vfs_path; +} + INIT { @@ -755,7 +764,7 @@ standby_mode=on sub enable_restoring { my ($self, $root_node) = @_; - my $path = $root_node->archive_dir; + my $path = $vfs_path . $root_node->archive_dir; my $name = $self->name; print "### Enabling WAL restore for node \"$name\"\n"; @@ -783,7 +792,7 @@ standby_mode = on sub enable_archiving { my ($self) = @_; - my $path = $self->archive_dir; + my $path = $vfs_path. $self->archive_dir; my $name = $self->name; print "### Enabling WAL archiving for node \"$name\"\n"; @@ -971,6 +980,7 @@ sub safe_psql print "\n#### End standard error\n"; } + $stdout =~ s/\r//g if $TestLib::windows_os; return $stdout; } |