Francois Gouget : testbot/WineRunTask: Fix handling of tests with no argument.

Alexandre Julliard julliard at winehq.org
Wed Mar 22 15:52:02 CDT 2017


Module: tools
Branch: master
Commit: 106bdce720415a6626cc3675d61e96b16dbfbd4f
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=106bdce720415a6626cc3675d61e96b16dbfbd4f

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Mar 22 01:16:48 2017 +0100

testbot/WineRunTask: Fix handling of tests with no argument.

TestLauncher always shows the first argument as the test unit name. If
there is no argument the test unit name will be an empty string and yet
the test will succeed if there is only one test unit for that dll.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/bin/WineRunTask.pl | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 8799b0b..d364777 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -461,13 +461,14 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
   chmod 0664, $FullLogFileName;
   if (open(my $LogFile, "<", $FullLogFileName))
   {
-    # Note that for the TestBot we don't really care about the todos and skips
+    # There is more than one test unit when running the full test suite so keep
+    # track of the current one. Also note that for the TestBot we don't really
+    # care about the todos and skips
     my ($CurrentDll, $CurrentUnit, $LineFailures, $SummaryFailures) = ("", "", 0, 0);
     my ($CurrentIsPolluted, %CurrentPids, $LogFailures);
     foreach my $Line (<$LogFile>)
     {
-      # There may be more than one summary line due to child processes
-      if ($Line =~ m%([_.a-z0-9]+):([_a-z0-9]+) start (?:-|[/_.a-z0-9]+) (?:-|[.0-9a-f]+)\r?$%)
+      if ($Line =~ m%([_.a-z0-9]+):([_a-z0-9]*) start (?:-|[/_.a-z0-9]+) (?:-|[.0-9a-f]+)\r?$%)
       {
         my ($Dll, $Unit) = ($1, $2);
         if ($CurrentDll ne "")
@@ -519,9 +520,12 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
       {
         my ($Pid, $Unit, $Todo, $Failures) = ($1, $2, $3, $4);
 
-        # TestLauncher uses the wrong name in its test summary line
-        if ($Unit eq $CurrentUnit or $Unit eq $CurrentDll)
+        # Dlls that have only one test unit will run it even if there is
+        # no argument. Also TestLauncher uses the wrong name in its test
+        # summary line when skipping tests.
+        if ($Unit eq $CurrentUnit or $CurrentUnit eq "" or $Unit eq $CurrentDll)
         {
+          # There may be more than one summary line due to child processes
           $CurrentPids{$Pid || 0} = 1;
           $SummaryFailures += $Failures;
         }
@@ -535,7 +539,7 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
           }
         }
       }
-      elsif ($Line =~ /^([_.a-z0-9]+):([_a-z0-9]+)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/)
+      elsif ($Line =~ /^([_.a-z0-9]+):([_a-z0-9]*)(?::([0-9a-f]+))? done \((-?\d+)\)(?:\r?$| in)/)
       {
         my ($Dll, $Unit, $Pid, $Rc) = ($1, $2, $3, $4);
 




More information about the wine-cvs mailing list