Module: tools
Branch: master
Commit: c6f00ecf6767781726a5d0d79ca1765e38105ad3
URL: https://source.winehq.org/git/tools.git/?a=commit;h=c6f00ecf6767781726a5d0d…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Jan 27 03:57:27 2021 +0100
testbot/TestWTBS: Allow checking emails that don't contain a patch.
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(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/tests/TestWTBS | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index d0e7cab..67b1c8f 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);
+ }
}
}