Francois Gouget : testbot/LogUtils: Reorder the functions to get a more logical grouping.

Alexandre Julliard julliard at winehq.org
Wed Feb 5 15:42:50 CST 2020


Module: tools
Branch: master
Commit: 08e407ef42f578d66e89fda1ed3125c73a6175a1
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=08e407ef42f578d66e89fda1ed3125c73a6175a1

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Feb  5 02:01:30 2020 +0100

testbot/LogUtils: Reorder the functions to get a more logical grouping.

Add headers to each section.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/WineTestBot/LogUtils.pm | 185 ++++++++++++++++++------------------
 1 file changed, 92 insertions(+), 93 deletions(-)

diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 0a98a5a..66359a9 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -63,6 +63,78 @@ sub _IsPerlError($)
          $Str =~ /^Possible precedence issue /;
 }
 
+=pod
+=over 12
+
+=item C<GetLogLineCategory()>
+
+Identifies the category of the given log line: an error message, a Wine
+diagnostic line, a TestBot error, etc.
+
+The category can then be used to decide whether to hide the line or, on
+the contrary, highlight it.
+
+=back
+=cut
+
+sub GetLogLineCategory($)
+{
+  my ($Line) = @_;
+
+  if (# Build messages
+      $Line =~ /^\+ \S/ or
+      $Line =~ /^LANG=/ or
+      $Line =~ /^Running (?:the tests|WineTest) / or
+      $Line =~ /^Task: (?:ok|tests|Updated)/)
+  {
+    return "info";
+  }
+  if (# Git errors
+      $Line =~ /^CONFLICT / or
+      $Line =~ /^error: patch failed:/ or
+      $Line =~ /^error: corrupt patch / or
+      # Build errors
+      $Line =~ /: error: / or
+      $Line =~ /: undefined reference to `/ or
+      $Line =~ /^make: [*]{3} No rule to make target / or
+      $Line =~ /^Makefile:[0-9]+: recipe for target .* failed$/ or
+      $Line =~ /^Task: / or
+      # Typical perl errors
+      _IsPerlError($Line))
+  {
+    return "error";
+  }
+  if ($Line =~ /:winediag:/)
+  {
+    if (# Normally CorIsLatestSvc() would not be called but mscoree:mscoree
+        # calls it as a test.
+        $Line =~ /CorIsLatestSvc If this function is called,/ or
+        # VMs and most test machines don't have a midi port.
+        $Line =~ /No software synthesizer midi port found,/ or
+        # Most VMs have limited OpenGL support.
+        $Line =~ /None of the requested D3D feature levels is supported / or
+        # The tests are not run as root.
+        $Line =~ /this requires special permissions/)
+    {
+      return "diag";
+    }
+    return "error";
+  }
+  if (# TestBot script error messages
+      $Line =~ /^[a-zA-Z.]+:error: / or
+      # TestBot error
+      $Line =~ /^BotError:/ or
+      $Line =~ /^Error:/ or
+      # X errors
+      $Line =~ /^X Error of failed request: / or
+      $Line =~ / opcode of failed request: /)
+  {
+    return "boterror";
+  }
+
+  return "none";
+}
+
 
 =pod
 =over 12
@@ -138,13 +210,17 @@ sub ParseTaskLog($)
 }
 
 
+#
+# WineTest report parser
+#
+
 =pod
 =over 12
 
-=item C<GetLogLineCategory()>
+=item C<GetReportLineCategory()>
 
-Identifies the category of the given log line: an error message, a Wine
-diagnostic line, a TestBot error, etc.
+Identifies the category of the given test report line: an error message,
+a todo, just an informational message or none of these.
 
 The category can then be used to decide whether to hide the line or, on
 the contrary, highlight it.
@@ -152,69 +228,36 @@ the contrary, highlight it.
 =back
 =cut
 
-sub GetLogLineCategory($)
+sub GetReportLineCategory($)
 {
   my ($Line) = @_;
 
-  if (# Build messages
-      $Line =~ /^\+ \S/ or
-      $Line =~ /^LANG=/ or
-      $Line =~ /^Running (?:the tests|WineTest) / or
-      $Line =~ /^Task: (?:ok|tests|Updated)/)
+  if ($Line =~ /: Test marked todo: /)
   {
-    return "info";
+    return "todo";
   }
-  if (# Git errors
-      $Line =~ /^CONFLICT / or
-      $Line =~ /^error: patch failed:/ or
-      $Line =~ /^error: corrupt patch / or
-      # Build errors
-      $Line =~ /: error: / or
-      $Line =~ /: undefined reference to `/ or
-      $Line =~ /^make: [*]{3} No rule to make target / or
-      $Line =~ /^Makefile:[0-9]+: recipe for target .* failed$/ or
-      $Line =~ /^Task: / or
-      # Typical perl errors
-      _IsPerlError($Line))
+  if ($Line =~ /: Tests skipped: / or
+      $Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* skipped /)
   {
-    return "error";
+    return "skip";
   }
-  if ($Line =~ /:winediag:/)
+  if ($Line =~ /: Test (?:failed|succeeded inside todo block): / or
+      $Line =~ /Fatal: test .* does not exist/ or
+      $Line =~ / done \(258\)/ or
+      $Line =~ /: unhandled exception [0-9a-fA-F]{8} at / or
+      $Line =~ /^Unhandled exception: /)
   {
-    if (# Normally CorIsLatestSvc() would not be called but mscoree:mscoree
-        # calls it as a test.
-        $Line =~ /CorIsLatestSvc If this function is called,/ or
-        # VMs and most test machines don't have a midi port.
-        $Line =~ /No software synthesizer midi port found,/ or
-        # Most VMs have limited OpenGL support.
-        $Line =~ /None of the requested D3D feature levels is supported / or
-        # The tests are not run as root.
-        $Line =~ /this requires special permissions/)
-    {
-      return "diag";
-    }
     return "error";
   }
-  if (# TestBot script error messages
-      $Line =~ /^[a-zA-Z.]+:error: / or
-      # TestBot error
-      $Line =~ /^BotError:/ or
-      $Line =~ /^Error:/ or
-      # X errors
-      $Line =~ /^X Error of failed request: / or
-      $Line =~ / opcode of failed request: /)
+  if ($Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* start /)
   {
-    return "boterror";
+    return "info";
   }
 
   return "none";
 }
 
 
-#
-# WineTest report parser
-#
-
 sub _NewCurrentUnit($$)
 {
   my ($Dll, $Unit) = @_;
@@ -553,50 +596,6 @@ sub ParseWineTestReport($$$)
 }
 
 
-=pod
-=over 12
-
-=item C<GetReportLineCategory()>
-
-Identifies the category of the given test report line: an error message,
-a todo, just an informational message or none of these.
-
-The category can then be used to decide whether to hide the line or, on
-the contrary, highlight it.
-
-=back
-=cut
-
-sub GetReportLineCategory($)
-{
-  my ($Line) = @_;
-
-  if ($Line =~ /: Test marked todo: /)
-  {
-    return "todo";
-  }
-  if ($Line =~ /: Tests skipped: / or
-      $Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* skipped /)
-  {
-    return "skip";
-  }
-  if ($Line =~ /: Test (?:failed|succeeded inside todo block): / or
-      $Line =~ /Fatal: test .* does not exist/ or
-      $Line =~ / done \(258\)/ or
-      $Line =~ /: unhandled exception [0-9a-fA-F]{8} at / or
-      $Line =~ /^Unhandled exception: /)
-  {
-    return "error";
-  }
-  if ($Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* start /)
-  {
-    return "info";
-  }
-
-  return "none";
-}
-
-
 #
 # Log querying and formatting
 #




More information about the wine-cvs mailing list