better location for test temp files
[p5sagit/local-lib.git] / t / lib / TempDir.pm
index ca995f6..2464ff3 100644 (file)
@@ -9,11 +9,15 @@ use local::lib ();
 use Cwd;
 use File::Temp qw(tempdir);
 
+$File::Temp::KEEP_ALL = 1
+  if $ENV{LOCAL_LIB_TEST_DEBUG};
+
 sub mk_temp_dir
 {
     my $name_template = shift;
 
-    my $path = tempdir($name_template, DIR => Cwd::abs_path('t'), CLEANUP => 1);
+    mkdir 't/temp';
+    my $path = tempdir($name_template, DIR => Cwd::abs_path('t/temp'), CLEANUP => 1);
     local::lib->ensure_dir_structure_for($path);
     # On Win32 the path where the distribution is built usually contains
     # spaces. This is a problem for some parts of the CPAN toolchain, so