TAP tests: retain temp dirs on test failure
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 1 Mar 2016 22:50:13 +0000 (19:50 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 1 Mar 2016 22:50:13 +0000 (19:50 -0300)
This makes it easier to study the reason for the failure.

Author: Kyotaro Horiguchi
Reviewed-By: Craig Ringer
src/test/perl/TestLib.pm

index 3d11cbb4535163ed22ba4ecd6c2efcbda41e8fba..4fb43fee21ca210416232b873cee3b9e94b78a65 100644 (file)
@@ -107,6 +107,12 @@ INIT
    autoflush TESTLOG 1;
 }
 
+END
+{
+   # Preserve temporary directory for this test on failure
+   $File::Temp::KEEP_ALL = 1 unless Test::More->builder->is_passing;
+}
+
 #
 # Helper functions
 #