[Tools] testbot/WineRunTask: Better deal with single test unit executables.

Francois Gouget fgouget at codeweavers.com
Tue Jun 13 03:14:55 CDT 2017


If a Wine test executable has a single test unit, then one can upload
and run it without a parameter. In that case TestLauncher does not the
test unit name and thus does not print it on the start line. So
WineRunTask ends up with $CurrentUnit="" and must account for it when
it compares it to the test unit of skip lines.
This should also be factored when determining whether the test output
follows the Wine test standards.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/WineRunTask.pl | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 22c6236b..59e5cd0d 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -511,7 +511,7 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
     sub CheckUnit($$)
     {
       my ($Unit, $Type) = @_;
-      if ($Unit eq $CurrentUnit)
+      if ($Unit eq $CurrentUnit or $CurrentUnit eq "")
       {
         $IsWineTest = 1;
       }
@@ -634,10 +634,14 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
              ($CurrentUnit ne "" and
               $Line =~ /($CurrentUnit)(?:\.c)?:\d+:? Tests? skipped: /))
       {
+        my $Unit = $1;
         # Don't complain and don't count misplaced skips. Only complain if they
         # are misreported (see CloseTestUnit). Also TestLauncher uses the wrong
         # name in its skip message when skipping tests.
-        $LineSkips++ if ($1 eq $CurrentUnit or $1 eq $CurrentDll);
+        if ($Unit eq $CurrentUnit or $CurrentUnit eq "" or $Unit eq $CurrentDll)
+        {
+          $LineSkips++;
+        }
       }
       elsif ($Line =~ /^Fatal: test '([_a-z0-9]+)' does not exist/)
       {
-- 
2.11.0



More information about the wine-patches mailing list