[tools] testbot/web: Tweak GenerateFullLog() in the job details page.

Francois Gouget fgouget at codeweavers.com
Tue Jun 14 08:59:45 CDT 2022


Rename %ErrLineNos to %ErrCategory since it contains the error's
category indexed by the full log line number.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/web/JobDetails.pl | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 36bba0d04..7860a4c9d 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -400,16 +400,14 @@ sub GenerateFullLog($$$$)
     print "<pre class='log-note'>Some WineTest results could not be used to detect new errors: $LogInfo->{BadRef}</pre>\n";
   }
 
-  my %ErrLineNos;
+  my %ErrCategory;
   foreach my $GroupName (@{$LogInfo->{ErrGroupNames}})
   {
     my $Group = $LogInfo->{ErrGroups}->{$GroupName};
-    my $ErrCount = @{$Group->{Errors}};
-    next if (!$ErrCount);
-    for my $ErrIndex (0..$ErrCount-1)
+    for my $ErrIndex (0..$#{$Group->{Errors}})
     {
-      $ErrLineNos{$Group->{LineNos}->[$ErrIndex]} = \
-          $Group->{IsNew}->[$ErrIndex] ? "fullnew" : "error";
+      my $LineNo = $Group->{LineNos}->[$ErrIndex];
+      $ErrCategory{$LineNo} = $Group->{IsNew}->[$ErrIndex] ? "fullnew" : "error";
     }
   }
 
@@ -432,7 +430,7 @@ sub GenerateFullLog($$$$)
       }
 
       my $Html = $self->escapeHTML($Line);
-      my $Category = $ErrLineNos{$LineNo} || $GetCategory->($Line);
+      my $Category = $ErrCategory{$LineNo} || $GetCategory->($Line);
       if ($Category ne "none")
       {
         $Html =~ s~^(.*\S)\s*\r?$~<span class='log-$Category'>$1</span>~;
-- 
2.30.2




More information about the wine-devel mailing list