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
}
else
{
- $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
is($stdout, $expected_stdout, "$test_name: query result matches");
}
}
my $name = $self->name;
return unless defined $self->{_pid};
print "### Killing node \"$name\" using signal 9\n";
- kill(9, $self->{_pid}) or BAIL_OUT("kill(9, $self->{_pid}) failed");
+ kill(9, $self->{_pid});
$self->{_pid} = undef;
return;
}
}
};
- # 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;
}
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 '')
}
};
- $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);
$contents = <$fh>;
close $fh;
- $contents =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
return $contents;
}
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");
}
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");
}
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)");
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: $!";