aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2022-02-20 11:49:33 -0500
committerAndrew Dunstan <andrew@dunslane.net>2022-02-20 11:49:33 -0500
commita5716baac00b68e6cf0720047dddfe8892c8033e (patch)
tree138402b4337512b685bbda3093b6a1a51b1e63a9 /src
parentc27aa21e0dc89484fec38cd4e2189c6c1a5cf251 (diff)
downloadpostgresql-a5716baac00b68e6cf0720047dddfe8892c8033e.tar.gz
postgresql-a5716baac00b68e6cf0720047dddfe8892c8033e.zip
Remove most msys special processing in TAP tests
Following migration of Windows buildfarm members running TAP tests to use of ucrt64 perl for those tests, special processing for msys perl is no longer necessary and so is removed. Backpatch to release 10 Discussion: https://postgr.es/m/c65a8781-77ac-ea95-d185-6db291e1baeb@dunslane.net
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_ctl/t/001_start_stop.pl11
-rw-r--r--src/bin/pg_rewind/t/RewindTest.pm1
-rw-r--r--src/test/perl/PostgresNode.pm15
-rw-r--r--src/test/perl/TestLib.pm6
-rw-r--r--src/test/recovery/t/cp_history_files7
5 files changed, 2 insertions, 38 deletions
diff --git a/src/bin/pg_ctl/t/001_start_stop.pl b/src/bin/pg_ctl/t/001_start_stop.pl
index b1e419f02e9..9ca93144816 100644
--- a/src/bin/pg_ctl/t/001_start_stop.pl
+++ b/src/bin/pg_ctl/t/001_start_stop.pl
@@ -43,16 +43,7 @@ my $ctlcmd = [
'pg_ctl', 'start', '-D', "$tempdir/data", '-l',
"$TestLib::log_path/001_start_stop_server.log"
];
-if ($Config{osname} ne 'msys')
-{
- command_like($ctlcmd, qr/done.*server started/s, 'pg_ctl start');
-}
-else
-{
-
- # use the version of command_like that doesn't hang on Msys here
- command_like_safe($ctlcmd, qr/done.*server started/s, 'pg_ctl start');
-}
+command_like($ctlcmd, qr/done.*server started/s, 'pg_ctl start');
# sleep here is because Windows builds can't check postmaster.pid exactly,
# so they may mistake a pre-existing postmaster.pid for one created by the
diff --git a/src/bin/pg_rewind/t/RewindTest.pm b/src/bin/pg_rewind/t/RewindTest.pm
index 422a563517d..c0c236636ba 100644
--- a/src/bin/pg_rewind/t/RewindTest.pm
+++ b/src/bin/pg_rewind/t/RewindTest.pm
@@ -112,7 +112,6 @@ sub check_query
}
else
{
- $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
is($stdout, $expected_stdout, "$test_name: query result matches");
}
return;
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index d130d6fc817..05c7866709d 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -814,9 +814,7 @@ sub kill9
my $name = $self->name;
return unless defined $self->{_pid};
print "### Killing node \"$name\" using signal 9\n";
- # kill(9, ...) fails under msys Perl 5.8.8, so fall back on pg_ctl.
- kill(9, $self->{_pid})
- or TestLib::system_or_bail('pg_ctl', 'kill', 'KILL', $self->{_pid});
+ kill(9, $self->{_pid});
$self->{_pid} = undef;
return;
}
@@ -1558,19 +1556,13 @@ sub psql
}
};
- # Note: on Windows, IPC::Run seems to convert \r\n to \n in program output
- # if we're using native Perl, but not if we're using MSys Perl. So do it
- # by hand in the latter case, here and elsewhere.
-
if (defined $$stdout)
{
- $$stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp $$stdout;
}
if (defined $$stderr)
{
- $$stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp $$stderr;
}
@@ -1878,9 +1870,7 @@ sub poll_query_until
my $result = IPC::Run::run $cmd, '<', \$query,
'>', \$stdout, '2>', \$stderr;
- $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp($stdout);
- $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp($stderr);
if ($stdout eq $expected && $stderr eq '')
@@ -2337,9 +2327,6 @@ sub pg_recvlogical_upto
}
};
- $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
- $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
-
if (wantarray)
{
return ($ret, $stdout, $stderr, $timeout);
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 2a9c8c6df6f..57301514577 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -365,7 +365,6 @@ sub run_command
my ($cmd) = @_;
my ($stdout, $stderr);
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
- foreach ($stderr, $stdout) { s/\r\n/\n/g if $Config{osname} eq 'msys'; }
chomp($stdout);
chomp($stderr);
return ($stdout, $stderr);
@@ -450,7 +449,6 @@ sub slurp_file
$contents = <$fh>;
close $fh;
- $contents =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
return $contents;
}
@@ -776,7 +774,6 @@ sub command_like
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
ok($result, "$test_name: exit code 0");
is($stderr, '', "$test_name: no stderr");
- $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
like($stdout, $expected_stdout, "$test_name: matches");
return;
}
@@ -829,7 +826,6 @@ sub command_fails_like
print("# Running: " . join(" ", @{$cmd}) . "\n");
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
ok(!$result, "$test_name: exit code not 0");
- $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
like($stderr, $expected_stderr, "$test_name: matches");
return;
}
@@ -874,8 +870,6 @@ sub command_checks_all
if $ret & 127;
$ret = $ret >> 8;
- foreach ($stderr, $stdout) { s/\r\n/\n/g if $Config{osname} eq 'msys'; }
-
# check status
ok($ret == $expected_ret,
"$test_name status (got $ret vs expected $expected_ret)");
diff --git a/src/test/recovery/t/cp_history_files b/src/test/recovery/t/cp_history_files
index 66f1b598fea..cfeea41e5b9 100644
--- a/src/test/recovery/t/cp_history_files
+++ b/src/test/recovery/t/cp_history_files
@@ -7,11 +7,4 @@ use warnings;
die "wrong number of arguments" if @ARGV != 2;
my ($source, $target) = @ARGV;
exit if $source !~ /history/;
-if ($^O eq 'msys')
-{
- # make a windows path look like an msys path if necessary
- $source =~ s!^([A-Za-z]):!'/' . lc($1)!e;
- $source =~ s!\\!/!g;
-}
-
copy($source, $target) or die "couldn't copy $source to $target: $!";