An issue with the use of tmp files during testing came up a week or so ago here, and it may be that a solution in that thread is going to be similar to the solution you will have to employ:
t/CVE-2015-1592.t uses File::Temp to create a temporary directory. Typically this will be in /tmp for linux, or wherever Windows thinks temp directories should go. File::Temp uses File::Spec's tmpdir function to tell it where to put tempfiles and tempdirs. On Windows, File::Spec gets that information from File::Spec::Win32, which has the following semantics:
=item tmpdir
Returns a string representation of the first existing directory
from the following list:
$ENV{TMPDIR}
$ENV{TEMP}
$ENV{TMP}
SYS:/temp
C:\system\temp
C:/temp
/tmp
/
In other words, you can set $ENV{TMPDIR} or one of several other environment variables to influence where the temporary directory will be created. By default it will be in SYS:/temp, or C:\system\temp, or C:/temp, or /tmp, or /, in that order. But you could specify an alternate location before running the tests. It's been years since I used Windows in any meaningful way, but Google seems to find for me that set or setx can be used to set the appropriate environment variable. I've found under Linux it's useful to create a ~/tmp/ for times when the systemwide /tmp is not appropriate. For example, on my centos7 box /tmp is mounted without executable set, so tests that must execute something in /tmp will fail (local::lib, for example) unless I hint the system to use a different temp directory with less restrictive execution privileges.
|