}
};
+ # 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 $TestLib::windows_os;
+ $$stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp $$stdout;
}
if (defined $$stderr)
{
- $$stderr =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $$stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp $$stderr;
}
{
my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
- $stdout =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp($stdout);
if ($stdout eq $expected)
# The query result didn't change in 180 seconds. Give up. Print the
# output from the last attempt, hopefully that's useful for debugging.
- $stderr =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
chomp($stderr);
diag qq(poll_query_until timed out executing this query:
$query
}
};
- $stdout =~ s/\r\n/\n/g if $TestLib::windows_os;
- $stderr =~ s/\r\n/\n/g if $TestLib::windows_os;
+ $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
+ $stderr =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
if (wantarray)
{