commit ef2caa074edfa0f6124aecead56e8253f047819c
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Dec 29 11:59:05 2019 +0100

    autotest: create the temp dir in $TEMP
    
    on modern systems, this makes it likely to end up on tmpfs, which is a
    lot faster and ssd-friendlier.
    
    the symlink is not deleted at the end, to minimize fs churn. that means
    it will be dangling after a reboot, which gets fixed in the next run.

 src/run-tests.pl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/run-tests.pl b/src/run-tests.pl
index 539ad80..3618db5 100755
--- a/src/run-tests.pl
+++ b/src/run-tests.pl
@@ -20,11 +20,16 @@ use warnings;
 use strict;
 use Cwd;
 use File::Path;
+use File::Temp 'tempdir';
 
 my $use_vg = $ENV{USE_VALGRIND};
 my $mbsync = getcwd()."/mbsync";
 
--d "tmp" or mkdir "tmp";
+if (!-d "tmp") {
+  unlink "tmp";
+  my $tdir = tempdir();
+  symlink $tdir, "tmp" or die "Cannot symlink temp directory: $!\n";
+}
 chdir "tmp" or die "Cannot enter temp direcory.\n";
 
 sub show($$$);
@@ -236,8 +241,6 @@ test("max messages + expunge", \@x50, \@X51, @O51);
 
 
################################################################################
 
-chdir "..";
-rmdir "tmp";
 print "OK.\n";
 exit 0;
 


_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to