From: Tom Lane Date: Wed, 2 Mar 2016 06:06:31 +0000 (-0500) Subject: Fix TAP tests for older Perls. X-Git-Tag: REL9_6_BETA1~621 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b8d7215533ed3128b1b9174eae830d70c0453d0;p=postgresql 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 --- diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index 4fb43fee21..564936e5e5 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -110,7 +110,17 @@ INIT END { # 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; } #