From 22a1df73e46f32f1807f39c3d23ecc83741b4d0b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 26 Jan 2022 18:46:58 +0100 Subject: [PATCH] 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 128c20c..e5a0de9 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);