Francois Gouget : testbot: Add support for running the tests with WINETEST_TIME.

Alexandre Julliard julliard at winehq.org
Fri Mar 12 14:28:32 CST 2021


Module: tools
Branch: master
Commit: bb6d3d7c5639b898e5d9df61e703216df380b608
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=bb6d3d7c5639b898e5d9df61e703216df380b608

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Mar 11 15:32:42 2021 +0100

testbot: Add support for running the tests with WINETEST_TIME.

This allows getting timing information on the tests.

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

---

 testbot/bin/WineRunTask.pl       | 4 ++++
 testbot/bin/WineRunWineTest.pl   | 4 ++++
 testbot/ddl/update44.sql         | 8 ++++++++
 testbot/ddl/winetestbot.sql      | 1 +
 testbot/lib/WineTestBot/Steps.pm | 2 ++
 testbot/web/Submit.pl            | 8 +++++++-
 6 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 6056806..36b3e68 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -425,6 +425,10 @@ my $Keepalive;
 my $Timeout = $Task->Timeout;
 my $Script = "set WINETEST_DEBUG=" . $Step->DebugLevel .
              "\r\n";
+if ($Step->LogTime)
+{
+  $Script .= "set WINETEST_TIME=1\r\n";
+}
 if ($Step->ReportSuccessfulTests)
 {
   $Script .= "set WINETEST_REPORT_SUCCESS=1\r\n";
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 7892bca..94757bf 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -422,6 +422,10 @@ if (defined $FileName)
 my $Script = "#!/bin/sh\n".
              "( set -x\n".
              "  export WINETEST_DEBUG=". $Step->DebugLevel ."\n";
+if ($Step->LogTime)
+{
+  $Script .= "  export WINETEST_TIME=1\n";
+}
 if ($Step->ReportSuccessfulTests)
 {
   $Script .= "  export WINETEST_REPORT_SUCCESS=1\n";
diff --git a/testbot/ddl/update44.sql b/testbot/ddl/update44.sql
new file mode 100644
index 0000000..670d3bc
--- /dev/null
+++ b/testbot/ddl/update44.sql
@@ -0,0 +1,8 @@
+USE winetestbot;
+
+ALTER TABLE Steps
+  ADD LogTime ENUM('Y', 'N') NULL DEFAULT 'N'
+      AFTER DebugLevel;
+
+ALTER TABLE Steps
+  ALTER LogTime DROP DEFAULT;
diff --git a/testbot/ddl/winetestbot.sql b/testbot/ddl/winetestbot.sql
index 533941d..1794b25 100644
--- a/testbot/ddl/winetestbot.sql
+++ b/testbot/ddl/winetestbot.sql
@@ -138,6 +138,7 @@ CREATE TABLE Steps
   FileName              VARCHAR(100) NULL,
   FileType              ENUM('none', 'exe32', 'exe64', 'patch') NOT NULL,
   DebugLevel            INT(2) NOT NULL,
+  LogTime               ENUM('Y', 'N') NOT NULL,
   ReportSuccessfulTests ENUM('Y', 'N') NOT NULL,
   PRIMARY KEY (JobId, No),
   FOREIGN KEY (JobId) REFERENCES Jobs(Id),
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 0943375..921077b 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -91,6 +91,7 @@ sub InitializeNew($$)
   $self->Type("single");
   $self->FileType("none");
   $self->DebugLevel(1);
+  $self->LogTime(!1);
   $self->ReportSuccessfulTests(!1);
 
   $self->SUPER::InitializeNew($Collection);
@@ -240,6 +241,7 @@ my @PropertyDescriptors = (
   CreateBasicPropertyDescriptor("FileName", "File",  !1, !1, "A", 100),
   CreateEnumPropertyDescriptor("FileType", "File type",  !1,  1, ['none', 'exe32', 'exe64', 'patch']),
   CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2),
+  CreateBasicPropertyDescriptor("LogTime", "Timestamp traces (WINETEST_TIME)", !1, 1, "B", 1),
   CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1),
   CreateDetailrefPropertyDescriptor("Tasks", "Tasks", !1, !1, \&CreateTasks),
 );
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 5e9a61e..68978f0 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -519,7 +519,8 @@ sub _initialize($$$)
 
   # Load the Page 3 parameters
   $self->_GetParams("TestExecutable", "CmdLineArg", "NoCmdLineArgWarn",
-                    "Run32", "Run64", "DebugLevel", "ReportSuccessfulTests");
+                    "Run32", "Run64", "DebugLevel", "LogTime",
+                    "ReportSuccessfulTests");
   $self->{DebugLevel} = 1 if (!defined $self->{DebugLevel});
 
   # Load the Page 4 parameters
@@ -585,6 +586,7 @@ sub _GenerateStateFields($)
     $self->_GenerateStateField("Run32");
     $self->_GenerateStateField("Run64");
     $self->_GenerateStateField("DebugLevel");
+    $self->_GenerateStateField("LogTime");
     $self->_GenerateStateField("ReportSuccessfulTests");
   }
 }
@@ -698,6 +700,7 @@ sub GetPropertyDescriptors($)
       CreateBasicPropertyDescriptor("Run32", "Run the 32 bit tests on Windows", !1, 1, "B", 1),
       CreateBasicPropertyDescriptor("Run64", "Run the 64 bit tests on Windows", !1, 1, "B", 1),
       CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2),
+      CreateBasicPropertyDescriptor("LogTime", "Timestamp traces (WINETEST_TIME)", !1, 1, "B", 1),
       CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1);
   }
 
@@ -1068,6 +1071,7 @@ sub OnPage3Prev($)
   # Set to 0 instead of undef to record the user preference
   $self->{Run32} ||= 0;
   $self->{Run64} ||= 0;
+  $self->{LogTime} ||= 0;
   $self->{ReportSuccessfulTests} ||= 0;
 
   $self->_SetPage(2);
@@ -1195,6 +1199,7 @@ sub _SubmitJob($$)
       $TestStep->FileType("exe$Bits");
       $TestStep->Type("single");
       $TestStep->DebugLevel($self->{DebugLevel});
+      $TestStep->LogTime(defined $self->{LogTime});
       $TestStep->ReportSuccessfulTests(defined $self->{ReportSuccessfulTests});
       my $Tasks = $TestStep->Tasks;
 
@@ -1218,6 +1223,7 @@ sub _SubmitJob($$)
     $WineStep->FileType($self->{FileType});
     $WineStep->Type("single");
     $WineStep->DebugLevel($self->{DebugLevel});
+    $WineStep->LogTime(defined $self->{LogTime});
     $WineStep->ReportSuccessfulTests(defined $self->{ReportSuccessfulTests});
     my $Tasks = $WineStep->Tasks;
 




More information about the wine-cvs mailing list