Add an option to keep the working directory after a test has failed.
Also include the test name in the working directory name to make it
easier to figure out which test failed later.
---
 test/run |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/test/run
+++ b/test/run
@@ -69,7 +69,8 @@ my $last_status = 0;
 my $lineno;
 my $width = ($ENV{COLUMNS} || 80) >> 1;
 my $origdir = getcwd;
-my $workdir = "d.$$";
+my $workdir = defined $ARGV[0] ? "$ARGV[0].$$" : "d.$$";
+my $keep_workdir = $ENV{KEEP_WORKDIR_IF_FAILED} || 0;
 
 sub print_header($)
 {
@@ -302,7 +303,7 @@ close(SOURCE);
 
 # Clean up the mess
 chdir $origdir or die;
-system "rm -rf $workdir";
+system "rm -rf $workdir" unless $keep_workdir and $failed;
 
 my $status = sprintf("%d commands (%d passed, %d failed)",
        $tests, $tests - $failed, $failed);
-- 
Jean Delvare
SUSE L3 Support

_______________________________________________
Quilt-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to