Commit 3b8d7215 authored by Tom Lane's avatar Tom Lane

Fix TAP tests for older Perls.

Commit 7132810c (Retain tempdirs for failed tests) used Test::More's
is_passing method, but that was added in Test::More 0.89_01 which is
sometime later than Perl 5.10.1.  Popular platforms such as RHEL6 don't
have that, nevermind some of our older dinosaurs.  Do it the hard way.

Michael Paquier, based on research by Craig Ringer
parent a892234f
...@@ -110,7 +110,17 @@ INIT ...@@ -110,7 +110,17 @@ INIT
END END
{ {
# Preserve temporary directory for this test on failure # Preserve temporary directory for this test on failure
$File::Temp::KEEP_ALL = 1 unless Test::More->builder->is_passing; $File::Temp::KEEP_ALL = 1 unless all_tests_passing();
}
sub all_tests_passing
{
my $fail_count = 0;
foreach my $status (Test::More->builder->summary)
{
return 0 unless $status;
}
return 1;
} }
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment