X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FTest-Valgrind.git;a=blobdiff_plain;f=t%2Flib%2FTest%2FValgrind%2FFakeValgrind.pm;h=067309b6a5cd708f0b04a8fc064673ffbe49740b;hp=3f61ba6c32f05d87321ccd0e7589bc47b509905d;hb=ca8eca27f27c14e65e67ffce2fa1447eee64c5c1;hpb=aa878ce1d2bcea2391756feff7a015a117083a57 diff --git a/t/lib/Test/Valgrind/FakeValgrind.pm b/t/lib/Test/Valgrind/FakeValgrind.pm index 3f61ba6..067309b 100644 --- a/t/lib/Test/Valgrind/FakeValgrind.pm +++ b/t/lib/Test/Valgrind/FakeValgrind.pm @@ -33,6 +33,15 @@ if (\@ARGV == 1 && \$ARGV[0] eq '--version') { FAKE_VG } +my $good_enough_file_temp; +BEGIN { + $good_enough_file_temp = do { + no warnings; + local $@; + eval { File::Temp->VERSION('0.19'); 1 } + } +} + sub new { my ($class, %args) = @_; @@ -43,6 +52,8 @@ sub new { my $self = { }; if (defined $exe_name) { + return 'File::Temp 0.19 is required to make a proper temporary directory' + unless $good_enough_file_temp; $self->{tmp_dir_obj} = File::Temp->newdir(CLEANUP => 1); $self->{tmp_dir} = $self->{tmp_dir_obj}->dirname; $self->{tmp_file} = File::Spec->catfile($self->{tmp_dir}, $exe_name);