diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-02 01:06:31 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-02 01:06:31 -0500 |
commit | 3b8d7215533ed3128b1b9174eae830d70c0453d0 (patch) | |
tree | d6781f116c3688ba90a4be3f6b980e51bdec47f5 | |
parent | a892234f830e832110f63fc0a2afce2fb21d1584 (diff) | |
download | postgresql-3b8d7215533ed3128b1b9174eae830d70c0453d0.tar.gz postgresql-3b8d7215533ed3128b1b9174eae830d70c0453d0.zip |
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
-rw-r--r-- | src/test/perl/TestLib.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index 4fb43fee21c..564936e5e57 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; } # |