[PATCH 1/2] testbot/LogUtils: Pids are always present so simplify the regexes.

Francois Gouget fgouget at codeweavers.com
Fri Nov 15 05:55:24 CST 2019


Nowadays the tests themselves always put the pid on the unhandled
exception and test summary lines.
And both WineTest and TestLauncher always put it on the done lines.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/WineTestBot/LogUtils.pm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 99b1568e1..5e5af0e2c 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -414,9 +414,9 @@ sub ParseWineTestReport($$$)
 
       $Cur->{LineFailures}++;
     }
-    elsif ($Line =~ /^(?:([0-9a-f]+):)?([_.a-z0-9]+): unhandled exception [0-9a-fA-F]{8} at / or
+    elsif ($Line =~ /^([0-9a-f]+):([_.a-z0-9]+): unhandled exception [0-9a-fA-F]{8} at / or
            ($Cur->{Unit} ne "" and
-            $Line =~ /(?:([0-9a-f]+):)?($Cur->{UnitsRE}): unhandled exception [0-9a-fA-F]{8} at /))
+            $Line =~ /([0-9a-f]+):($Cur->{UnitsRE}): unhandled exception [0-9a-fA-F]{8} at /))
     {
       my ($Pid, $Unit) = ($1, $2);
 
@@ -429,9 +429,9 @@ sub ParseWineTestReport($$$)
       _CheckUnit($Parser, $Cur, $Unit, "unhandled exception");
       $Cur->{LineFailures}++;
     }
-    elsif ($Line =~ /^(?:([0-9a-f]+):)?([_a-z0-9]+): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./ or
+    elsif ($Line =~ /^([0-9a-f]+):([_a-z0-9]+): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./ or
            ($Cur->{Unit} ne "" and
-            $Line =~ /(?:([0-9a-f]+):)?($Cur->{Unit}): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./))
+            $Line =~ /([0-9a-f]+):($Cur->{Unit}): \d+ tests? executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\./))
     {
       my ($Pid, $Unit, $Todos, $Failures, $Skips) = ($1, $2, $3, $4, $5);
 
@@ -451,9 +451,9 @@ sub ParseWineTestReport($$$)
         _CheckUnit($Parser, $Cur, $Unit, "test summary") if ($Todos or $Failures);
       }
     }
-    elsif ($Line =~ /^([_.a-z0-9-]+):([_a-z0-9]*)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/ or
+    elsif ($Line =~ /^([_.a-z0-9-]+):([_a-z0-9]*):([0-9a-f]+) done \((-?\d+)\)(?:\r?$| in)/ or
            ($Cur->{Dll} ne "" and
-            $Line =~ /(\Q$Cur->{Dll}\E):([_a-z0-9]*)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/))
+            $Line =~ /(\Q$Cur->{Dll}\E):([_a-z0-9]*):([0-9a-f]+) done \((-?\d+)\)(?:\r?$| in)/))
     {
       my ($Dll, $Unit, $Pid, $Rc) = ($1, $2, $3, $4);
 
@@ -766,7 +766,7 @@ sub GetLogErrors($)
 
       next if ($GetCategory->($Line) !~ /error/);
 
-      if ($Line =~ m/^[^:]+:([^:]*)(?::[0-9a-f]+)? done \(258\)/)
+      if ($Line =~ m/^[^:]+:([^:]*):[0-9a-f]+ done \(258\)/)
       {
         my $Unit = $1;
         $Line = $Unit ne "" ? "$Unit: Timeout" : "Timeout";
-- 
2.20.1




More information about the wine-devel mailing list