[tools 1/2] testbot/WineRun*: Standardize the WrapUpAndExit() functions.

Francois Gouget fgouget at codeweavers.com
Thu Apr 8 05:38:24 CDT 2021


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
With this patch the WineRun{Build,Reconfig} WrapUpAndExit() functions 
more closely match the ones in WineRun{Task,WineTest}.
And the next patch will make use of the extra TestFailures parameter.
---
 testbot/bin/WineRunBuild.pl    | 7 +++----
 testbot/bin/WineRunReconfig.pl | 7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 8a92f88d1..13f488bd9 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -181,16 +181,15 @@ sub LogTaskError($)
   print STDERR "$Name0:error: ", $ErrMessage;
 }
 
-sub WrapUpAndExit($;$$$)
+sub WrapUpAndExit($;$$$$)
 {
-  my ($Status, $Retry, $TimedOut, $Reason) = @_;
+  my ($Status, $TestFailures, $Retry, $TimedOut, $Reason) = @_;
   my $NewVMStatus = $Status eq 'queued' ? 'offline' : 'dirty';
   my $VMResult = defined $Reason ? $Reason :
                  $Status eq "boterror" ? "boterror" :
                  $Status eq "queued" ? "error" :
                  $TimedOut ? "timeout" : "";
 
-  my $TestFailures;
   my $Tries = $Task->TestFailures || 0;
   if ($Retry)
   {
@@ -490,4 +489,4 @@ $TA->Disconnect();
 # Wrap up
 #
 
-WrapUpAndExit($NewStatus, undef, $TaskTimedOut);
+WrapUpAndExit($NewStatus, undef, undef, $TaskTimedOut);
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 004987f5b..212a5d383 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -182,9 +182,9 @@ sub LogTaskError($)
   print STDERR "$Name0:error: ", $ErrMessage;
 }
 
-sub WrapUpAndExit($;$$$)
+sub WrapUpAndExit($;$$$$)
 {
-  my ($Status, $Retry, $TimedOut, $Reason) = @_;
+  my ($Status, $TestFailures, $Retry, $TimedOut, $Reason) = @_;
   my $NewVMStatus = $Status eq 'queued' ? 'offline' :
                     $Status eq 'completed' ? 'idle' : 'dirty';
   my $VMResult = defined $Reason ? $Reason :
@@ -192,7 +192,6 @@ sub WrapUpAndExit($;$$$)
                  $Status eq "queued" ? "error" :
                  $TimedOut ? "timeout" : "";
 
-  my $TestFailures;
   my $Tries = $Task->TestFailures || 0;
   if ($Retry)
   {
@@ -567,4 +566,4 @@ if ($NewStatus eq 'completed')
 # In case of a regular build failure retrying is pointless. But in case of a
 # timeout the VM host may be less busy next time and since the snapshot is
 # unchanged we can retry.
-WrapUpAndExit($NewStatus, $TaskTimedOut, $TaskTimedOut);
+WrapUpAndExit($NewStatus, undef, $TaskTimedOut, $TaskTimedOut);
-- 
2.20.1




More information about the wine-devel mailing list