diff --git a/src/bin/pg_checksums/t/002_actions.pl b/src/bin/pg_checksums/t/002_actions.pl index 97492caab4..2cc8b68c75 100644 --- a/src/bin/pg_checksums/t/002_actions.pl +++ b/src/bin/pg_checksums/t/002_actions.pl @@ -6,7 +6,6 @@ use strict; use warnings; -use Config; use PostgresNode; use TestLib; @@ -182,18 +181,13 @@ command_fails( # Test postgres -C for an offline cluster. # Run-time GUCs are safe to query here. Note that a lock file is created, # then unlinked, leading to an extra LOG entry showing in stderr. -SKIP: -{ - skip "unstable output generated with Msys", 3 - if ($Config{osname} eq 'msys'); - command_checks_all( - [ 'postgres', '-D', $pgdata, '-C', 'data_checksums' ], - 0, - [qr/^on$/], - # LOG entry when unlinking lock file. - [qr/database system is shut down/], - 'data_checksums=on is reported on an offline cluster'); -} +command_checks_all( + [ 'postgres', '-D', $pgdata, '-C', 'data_checksums' ], + 0, + [qr/^on$/], + # LOG entry when unlinking lock file. + [qr/database system is shut down/], + 'data_checksums=on is reported on an offline cluster'); # Checks cannot happen with an online cluster $node->start; diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index cbab1587cc..bde429e476 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -434,6 +434,8 @@ sub run_command my ($cmd) = @_; my ($stdout, $stderr); my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; + $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys'; + $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys'; chomp($stdout); chomp($stderr); return ($stdout, $stderr); @@ -878,6 +880,7 @@ 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; } @@ -909,6 +912,7 @@ sub command_like_safe $stderr = slurp_file($stderrfile); 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; } @@ -930,6 +934,7 @@ 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; } @@ -981,12 +986,14 @@ sub command_checks_all # check stdout for my $re (@$out) { + $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys'; like($stdout, $re, "$test_name stdout /$re/"); } # check stderr for my $re (@$err) { + $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys'; like($stderr, $re, "$test_name stderr /$re/"); }