tests: keep temporary directory if SAVE_TEMPS requested

When developers run 'make check SAVE_TEMPS=yes' the 'Coreutils.pm'
module does not delete the temporary files, but the CuTmpdir.pm still
deletes the temp directory. With this change, the temp directory is
kept, and printed to the log file (e.g. test-suite.log).

* testsuite/CuTmpdir.pm: if $EMV{SAVE_TEMPS} is not empty, don't
auto-delete the temp directory, and print it to the log.
This commit is contained in:
Assaf Gordon committed 2017-05-10 02:02:28 +00:00
1 parent 74dc7dca4d
commit 27815344e5
1 file changed
+4 -1
+4 -1
View File
@@ -92,9 +92,12 @@ sub import {
$SIG{$sig} = $on_sig_remove_tmpdir;
}
$dir = File::Temp::tempdir("$prefix.tmp-XXXX", CLEANUP => 1 );
my $cleanup = $ENV{SAVE_TEMPS} ? 0 : 1;
$dir = File::Temp::tempdir("$prefix.tmp-XXXX", CLEANUP => $cleanup );
chdir $dir
or warn "$ME: failed to chdir to $dir: $!\n";
warn "Temp directory: $dir\n" unless $cleanup;
}
END {