[tools] testbot/TestWTBS: Automatically check the 'Task:' build and wine lines.

Francois Gouget fgouget at codeweavers.com
Thu Jan 28 22:03:04 CST 2021


The automatic checks only cover the simple cases which is the majority,
thus allowing to simplify the TestWTBS directives.

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

diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index 6f78406ad..bc4e0d9ba 100755
--- a/testbot/tests/TestWTBS
+++ b/testbot/tests/TestWTBS
@@ -362,14 +362,43 @@ sub LoadTestInfo($)
       foreach my $TaskType (@$TaskTypes)
       {
         my $TaskInfo = $TestInfo->{$TaskType};
-        if (!defined $TaskInfo->{$Field})
-        {
-          $TaskInfo->{$Field} = $SrcVal;
-        }
+        next if (defined $TaskInfo->{$Field});
+        # Copy arrays to avoid side-effects when adding built-in defaults
+        $TaskInfo->{$Field} = ref($SrcVal) eq "ARRAY" ? [ @$SrcVal ] : $SrcVal;
       }
     }
   }
 
+  # Automatically check the Task: lines in simple cases
+  # Make sure no test is run for build tasks
+  my $GrepV = ($TestInfo->{build}->{"report.GrepV"} ||= []);
+  push @$GrepV, '.';
+  $GrepV = ($TestInfo->{build}->{"log.GrepV"} ||= []);
+  push @$GrepV, '^Task: tests$';
+  if (($TestInfo->{build}->{Status} || "") =~ /^bad(?:build|patch)$/ or
+      $TestInfo->{build}->{HasTimeout})
+  {
+    push @$GrepV, '^Task: ok$';
+  }
+  else
+  {
+    my $Grep = ($TestInfo->{build}->{"log.Grep"} ||= []);
+    push @$Grep, '^Task: ok$';
+  }
+
+  # Note: Depending on where the timeout occurs, the wine task log may or
+  # may not have a 'Task: ok' line.
+  if (($TestInfo->{wine}->{Status} || "") eq "completed" and
+      !$TestInfo->{wine}->{HasTimeout})
+  {
+    my $Grep = ($TestInfo->{wine}->{"log.Grep"} ||= []);
+    if (CheckValue($TestInfo->{wine}->{TestUnits}))
+    {
+      push @$Grep, '^Task: tests$';
+    }
+    push @$Grep, '^Task: ok$';
+  }
+
   # Validate and fix the Grep* fields
   foreach my $GrepType ("Grep", "GrepV")
   {
-- 
2.20.1



More information about the wine-devel mailing list