[tools] testbot/LogUtils: Identify invalid line numbers in the .errors file.

Francois Gouget fgouget at codeweavers.com
Thu Feb 20 20:00:04 CST 2020


This should never happen but if it does this helps with diagnosis.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

This will hopefully never be needed again but identifying the 
troublesome line just makes sense as a general rule.

 testbot/lib/WineTestBot/LogUtils.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 9e6ab4463f..734d3225b8 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -848,9 +848,10 @@ sub LoadLogErrors($)
     return $LogInfo;
   }
 
-  my $CurGroup;
+  my ($LineNo, $CurGroup);
   foreach my $Line (<$ErrorsFile>)
   {
+    $LineNo++;
     chomp $Line;
     my ($Type, $Property, $Value) = split / /, $Line, 3;
     if ($Type eq "p")
@@ -861,7 +862,7 @@ sub LoadLogErrors($)
       }
       else
       {
-        $LogInfo->{BadLog} = "Cannot set $Property = $Value because it is already set to $LogInfo->{$Property}";
+        $LogInfo->{BadLog} = "$LineNo: Cannot set $Property = $Value because it is already set to $LogInfo->{$Property}";
         last;
       }
     }
@@ -871,7 +872,7 @@ sub LoadLogErrors($)
     }
     elsif (!$CurGroup)
     {
-      $LogInfo->{BadLog} = "Got a $Type line with no group";
+      $LogInfo->{BadLog} = "$LineNo: Got a $Type line with no group";
       last;
     }
     elsif ($Type eq "o")
@@ -884,7 +885,7 @@ sub LoadLogErrors($)
     }
     else
     {
-      $LogInfo->{BadLog} = "Found an unknown line type ($Type)";
+      $LogInfo->{BadLog} = "$LineNo: Found an unknown line type ($Type)";
       last;
     }
   }
-- 
2.20.1



More information about the wine-devel mailing list