commit 22a1df73e46f32f1807f39c3d23ecc83741b4d0b
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Jan 26 18:46:58 2022 +0100

    autotest: add support for starting at a specific test
    
    ... which is often useful for continuation after test data fixes.

 src/run-tests.pl | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/run-tests.pl b/src/run-tests.pl
index 128c20c3..e5a0de9c 100755
--- a/src/run-tests.pl
+++ b/src/run-tests.pl
@@ -18,6 +18,17 @@ use File::Temp 'tempdir';
 my $use_vg = $ENV{USE_VALGRIND};
 my $mbsync = getcwd()."/mbsync";
 
+my (@match, $start);
+for my $arg (@ARGV) {
+       if ($arg eq "+") {
+               $start = 1;
+       } else {
+               push @match, $arg;
+       }
+}
+die("Need exactly one test name when using start syntax.\n")
+       if ($start && (@match != 1));
+
 if (!-d "tmp") {
   unlink "tmp";
   my $tdir = tempdir();
@@ -789,7 +800,15 @@ sub test($$$$)
 {
        my ($ttl, $sx, $tx, $sfx) = @_;
 
-       return 0 if (scalar(@ARGV) && !grep { index($ttl, $_) >= 0 } @ARGV);
+       if (@match) {
+               if ($start) {
+                       return if (index($ttl, $match[0]) < 0);
+                       @match = ();
+               } else {
+                       return if (!grep { index($ttl, $_) >= 0 } @match);
+               }
+       }
+
        print "Testing: ".$ttl." ...\n";
        writecfg($sfx);
 


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

Reply via email to