From 27815344e521c8dc44be31ecf74f298ef343fe4b Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Mon, 10 Apr 2017 02:13:42 +0000 Subject: [PATCH] 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. --- testsuite/CuTmpdir.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testsuite/CuTmpdir.pm b/testsuite/CuTmpdir.pm index a9e2a4e..c2048a0 100644 --- a/testsuite/CuTmpdir.pm +++ b/testsuite/CuTmpdir.pm @@ -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 {