Module: tools Branch: master Commit: 34119af362f677d8e64be0577be3f8cdc1f340f6 URL: https://source.winehq.org/git/tools.git/?a=commit;h=34119af362f677d8e64be057...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu Mar 4 14:27:30 2021 +0100
testbot/LogUtils: Add support for IgnoreExceptions.
Any exception occurring while IgnoreExceptions=1 is expected and should be ignored. Note that this is made possible by the fact that ParseWineTestReport() is now the sole authority on what is a report error line, and thus won't be contradicted by GetReportLineCategory() (which lacks the context information to deal with IgnoreExceptions directives).
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/WineTestBot/LogUtils.pm | 56 ++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 20 deletions(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm index 0bd7d19..bdba8da 100644 --- a/testbot/lib/WineTestBot/LogUtils.pm +++ b/testbot/lib/WineTestBot/LogUtils.pm @@ -611,44 +611,60 @@ sub ParseWineTestReport($$$) _AddReportError($LogInfo, $Cur, $LineNo, $Line); $Cur->{LineFailures}++; } + elsif (($Cur->{Unit} ne "" and + $Line =~ /($Cur->{UnitsRE}).c:\d+: IgnoreExceptions=([01])/) or + $Line =~ /^([_.a-z0-9]+).c:\d+: IgnoreExceptions=([01])/) + { + my ($Unit, $Ignore) = ($1, $2); + _CheckUnit($LogInfo, $Cur, $Unit, "ignore exceptions"); + $Cur->{IgnoreExceptions} = $Ignore; + } elsif (($Cur->{Unit} ne "" and $Line =~ /([0-9a-f]+):($Cur->{UnitsRE}): unhandled exception [0-9a-fA-F]{8} at /) or $Line =~ /^([0-9a-f]+):([_.a-z0-9]+): unhandled exception [0-9a-fA-F]{8} at /) { my ($Pid, $Unit) = ($1, $2); - - if ($Cur->{Units}->{$Unit}) + _CheckUnit($LogInfo, $Cur, $Unit, "unhandled exception"); + if (!$Cur->{IgnoreExceptions}) { - # This also replaces a test summary line. - $Cur->{Pids}->{$Pid || 0} = 1; - $Cur->{SummaryFailures}++; + if ($Cur->{Units}->{$Unit}) + { + # This also replaces a test summary line. + $Cur->{Pids}->{$Pid || 0} = 1; + $Cur->{SummaryFailures}++; + } + _AddReportError($LogInfo, $Cur, $LineNo, $Line); + $Cur->{LineFailures}++; } - _CheckUnit($LogInfo, $Cur, $Unit, "unhandled exception"); - _AddReportError($LogInfo, $Cur, $LineNo, $Line); - $Cur->{LineFailures}++; } elsif ($Line =~ /Unhandled exception: .* in .* code /) { - # This also replaces a test summary line. The pid is unknown so use 0. - $Cur->{Pids}->{0} = 1; - $Cur->{SummaryFailures}++; - _AddReportError($LogInfo, $Cur, $LineNo, $Line); - $Cur->{LineFailures}++; + if (!$Cur->{IgnoreExceptions}) + { + # This also replaces a test summary line. The pid is unknown so use 0. + $Cur->{Pids}->{0} = 1; + $Cur->{SummaryFailures}++; + _AddReportError($LogInfo, $Cur, $LineNo, $Line); + $Cur->{LineFailures}++; + } } elsif (($Cur->{Unit} ne "" and $Line =~ /($Cur->{UnitsRE}).c:\d+: unhandled exception [0-9a-fA-F]{8} in child process ([0-9a-f]+)/) or $Line =~ /^([_.a-z0-9]+).c:\d+: unhandled exception [0-9a-fA-F]{8} in child process ([0-9a-f]+)/) { my ($Unit, $Pid) = ($1, $2); - if ($Cur->{Units}->{$Unit}) + _CheckUnit($LogInfo, $Cur, $Unit, "child exception"); + if (!$Cur->{IgnoreExceptions}) { - # This also replaces a test summary line. - $Cur->{Pids}->{$Pid || 0} = 1; - $Cur->{SummaryFailures}++; + if ($Cur->{Units}->{$Unit}) + { + # This also replaces a test summary line. + $Cur->{Pids}->{$Pid || 0} = 1; + $Cur->{SummaryFailures}++; + } + _AddReportError($LogInfo, $Cur, $LineNo, $Line); + $Cur->{LineFailures}++; } - _CheckUnit($LogInfo, $Cur, $Unit, "child exception"); - _AddReportError($LogInfo, $Cur, $LineNo, $Line); - $Cur->{LineFailures}++; } elsif (($Cur->{Unit} ne "" and $Line =~ /([0-9a-f]+):($Cur->{Unit}): \d+ tests? executed ((\d+) marked as todo, (\d+) failures?), (\d+) skipped./) or