commit 22a1df73e46f32f1807f39c3d23ecc83741b4d0b
parent 03a38e48d3e8b555e55d5b2643dfdaf165ef5045
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Wed, 26 Jan 2022 18:46:58 +0100
autotest: add support for starting at a specific test
... which is often useful for continuation after test data fixes.
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git 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);