Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix win10 breakage in t/flexraw_fortran.t
Apparently, temp files were not being released after
use which was preventing the tests to pass.  This
adds per-file names to work around that problem.
  • Loading branch information
shawnlaffan authored and devel-chm committed Nov 8, 2015
1 parent 66878c6 commit 77a4911
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion t/flexraw_fortran.t
Expand Up @@ -9,7 +9,7 @@ use Test::More;
use File::Temp qw(tempfile);
use File::Spec;

my ($data,$head,$hdr);
my ($data,$head,$hdr, $prog_iter);

BEGIN {
(undef, $data) = tempfile("rawXXXX", SUFFIX=>'_data', TMPDIR=>1);
Expand Down Expand Up @@ -222,6 +222,20 @@ sub createData {
$fh->print( $code );
$fh->close;

if (-e "$prog$exec") {
my $success = unlink "$prog$exec";
if (!$success) {
# Antivirus might be holding on to the exec
# file so use a different name
# Poss path length issues?
# See $dalen in 2nd begin block$prog_iter++;
warn "Unable to delete $prog$exec, generating new name"
if $Verbose;
$prog_iter++;
$prog .= $prog_iter;
};
}

system("$F77 $F77flags -o $prog$exec $file".
(($Verbose || $DEBUG)?'': $null));

Expand Down

0 comments on commit 77a4911

Please sign in to comment.