diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2017-04-23 09:21:38 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2017-04-23 09:21:38 -0400 |
commit | 33f3bbc6d37dde23f02cb1f73753791fb9e6c4a8 (patch) | |
tree | 8b9d28632cbcf3a55c668c8da053e0bab5adafc8 /src | |
parent | 7d68f2281a4b56834c8e5648fc7da0b73b674c45 (diff) | |
download | postgresql-33f3bbc6d37dde23f02cb1f73753791fb9e6c4a8.tar.gz postgresql-33f3bbc6d37dde23f02cb1f73753791fb9e6c4a8.zip |
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 and pg_recvlogical output of carriage returns.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/perl/PostgresNode.pm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index e42eb88896f..51cbec8e5d9 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 { @@ -763,7 +772,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"; @@ -791,7 +800,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"; @@ -979,6 +988,7 @@ sub safe_psql print "\n#### End standard error\n"; } + $stdout =~ s/\r//g if $TestLib::windows_os; return $stdout; } @@ -1579,6 +1589,9 @@ sub pg_recvlogical_upto } }; + $stdout =~ s/\r//g if $TestLib::windows_os; + $stderr =~ s/\r//g if $TestLib::windows_os; + if (wantarray) { return ($ret, $stdout, $stderr, $timeout); |