summaryrefslogtreecommitdiff
path: root/src/test/perl
diff options
context:
space:
mode:
authorTom Lane2017-09-08 17:36:13 +0000
committerTom Lane2017-09-08 17:36:13 +0000
commit77d63b7eafd44469c2766c1f29b75533981e4911 (patch)
treecd628ff0b69b079f6f5b3c36c29f7ee5ffe0ea59 /src/test/perl
parentee24d2b5cf059cab83711992c0cf110ad44df5f9 (diff)
Fix more portability issues in new pgbench TAP tests.
* Remove no-such-user test case, output isn't stable, and we really don't need to be testing such cases here anyway. * Fix the process exit code test logic to match PostgresNode::psql (but I didn't bother with looking at the "core" flag). * Give up on inf/nan tests. Per buildfarm.
Diffstat (limited to 'src/test/perl')
-rw-r--r--src/test/perl/TestLib.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 0e73c991306..d1a2eb58837 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -340,20 +340,22 @@ sub command_fails_like
# - test_name: name of test
sub command_checks_all
{
- my ($cmd, $ret, $out, $err, $test_name) = @_;
+ my ($cmd, $expected_ret, $out, $err, $test_name) = @_;
# run command
my ($stdout, $stderr);
print("# Running: " . join(" ", @{$cmd}) . "\n");
IPC::Run::run($cmd, '>', \$stdout, '2>', \$stderr);
- # On Windows, the exit status of the process is returned directly as the
- # process's exit code, while on Unix, it's returned in the high bits
- # of the exit code.
- my $status = $windows_os ? $? : $? >> 8;
+ # See http://perldoc.perl.org/perlvar.html#%24CHILD_ERROR
+ my $ret = $?;
+ die "command exited with signal " . ($ret & 127)
+ if $ret & 127;
+ $ret = $ret >> 8;
# check status
- ok($ret == $status, "$test_name status (got $status vs expected $ret)");
+ ok($ret == $expected_ret,
+ "$test_name status (got $ret vs expected $expected_ret)");
# check stdout
for my $re (@$out)