From: Francois Gouget Subject: [19/25] testbot/LogUtils: Reorder the functions to get a more logical grouping. Message-Id: Date: Tue, 14 Jan 2020 16:42:57 +0100 (CET) In-Reply-To: References: Add headers to each section. --- 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 9f4035be2..da73423bd 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 + +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 +=item C -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 - -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 # -- 2.20.1