From: Graham Knop Date: Wed, 30 Oct 2013 01:14:14 +0000 (-0400) Subject: better location for test temp files X-Git-Tag: 1.008025~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=243595dcdbff831b3a22684775ce461dc33f1971;p=p5sagit%2Flocal-lib.git better location for test temp files --- diff --git a/.gitignore b/.gitignore index 1fe4df0..3e0921a 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,4 @@ /t/dist/MB/Build.bat /t/dist/MB/_build/ /t/dist/MB/blib/ -/t/test_local_lib-* +/t/temp/ diff --git a/t/lib/TempDir.pm b/t/lib/TempDir.pm index ca995f6..2464ff3 100644 --- a/t/lib/TempDir.pm +++ b/t/lib/TempDir.pm @@ -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