[tools] testbot/TestWTBS: Allow checking emails that don't contain a patch.

Francois Gouget fgouget at codeweavers.com
Tue Jan 26 20:57:27 CST 2021


When an email contains no patch it is not saved in the patches folder,
which also makes putting TestWTBS directives in the email body pointless.
This patch allows telling TestWTBS this is expected by adding 'WTBS' and
'NoPatch' anywhere in the subject line. Conversely, if the subject
contains 'WTBS' but not 'NoPatch', TestWTBS expects to find a file in
the patches folder.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/tests/TestWTBS | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index d0e7cabca..67b1c8f96 100755
--- a/testbot/tests/TestWTBS
+++ b/testbot/tests/TestWTBS
@@ -1152,9 +1152,19 @@ sub CheckPatches()
   foreach my $Patch (sort { $b->Id <=> $a->Id } @{$Patches->GetItems()})
   {
     my $PatchFileName = "$DataDir/patches/". $Patch->Id;
-    next if (!-f $PatchFileName);
-    my $TestInfo = LoadTestInfo($PatchFileName);
-    CheckPatch($Jobs, $Patch, $TestInfo) if ($TestInfo);
+    if (-f $PatchFileName)
+    {
+      ok($Patch->Subject !~ /NoPatch/, "Found a file for patch ". $Patch->Id .": ". $Patch->Subject)
+          or diag("Disposition=". $Patch->Disposition);
+      my $TestInfo = LoadTestInfo($PatchFileName);
+      CheckPatch($Jobs, $Patch, $TestInfo) if ($TestInfo);
+    }
+    elsif ($Patch->Subject =~ /\bWTBS\b/)
+    {
+      ok(($Patch->Subject =~ /NoPatch/ or $Patch->Disposition eq "Reply to a patch series"),
+         "Found no file for patch ". $Patch->Id .": ". $Patch->Subject)
+          or diag("Disposition=". $Patch->Disposition);
+    }
   }
 }
 
-- 
2.20.1



More information about the wine-devel mailing list