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:
1 parent
74dc7dca4d
commit
27815344e5
1 file changed
+4
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user