X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTempDir.pm;h=2464ff3633a2b61fa931d76b72ff9947244cc6e0;hb=3c1de5966cff5c6c0323ecd04ecb81814b3e922c;hp=61a9de6559cb740f9fe7b45ae42a34f7f5c18d3a;hpb=663a867559c7781df1c6810ec07aa4a3bd3c58ce;p=p5sagit%2Flocal-lib.git diff --git a/t/lib/TempDir.pm b/t/lib/TempDir.pm index 61a9de6..2464ff3 100644 --- a/t/lib/TempDir.pm +++ b/t/lib/TempDir.pm @@ -2,18 +2,22 @@ package TempDir; use strict; use warnings; -use Exporter 'import'; +use base 'Exporter'; our @EXPORT = qw(mk_temp_dir); 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