Module: tools Branch: master Commit: 11b596f4425ff2c70da2f312529adabfe43a025d URL: https://source.winehq.org/git/tools.git/?a=commit;h=11b596f4425ff2c70da2f312...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Feb 3 03:32:20 2021 +0100
testbot/WinRun*: Simplify LogTaskError().
The TestBot engine redirects stderr to testbot.log so there is no need to manually open and append to that file. This also makes the Debug() call in LogTaskError() redundant. Add the "tool:error:" prefix. This clarifies which errors come from the script, and which come from the TestBot Engine.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48658 Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/bin/WineRunBuild.pl | 14 +------------- testbot/bin/WineRunReconfig.pl | 14 +------------- testbot/bin/WineRunTask.pl | 14 +------------- testbot/bin/WineRunWineTest.pl | 12 +----------- 4 files changed, 4 insertions(+), 50 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl index 2764ffc..ff13052 100755 --- a/testbot/bin/WineRunBuild.pl +++ b/testbot/bin/WineRunBuild.pl @@ -178,19 +178,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - my $OldUMask = umask(002); - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } - umask($OldUMask); + print STDERR "$Name0:error: ", $ErrMessage; }
sub WrapUpAndExit($;$$$) diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index 2d45ed5..49e7305 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -179,19 +179,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - my $OldUMask = umask(002); - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } - umask($OldUMask); + print STDERR "$Name0:error: ", $ErrMessage; }
sub WrapUpAndExit($;$$$) diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl index 3036488..6056806 100755 --- a/testbot/bin/WineRunTask.pl +++ b/testbot/bin/WineRunTask.pl @@ -207,19 +207,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - my $OldUMask = umask(002); - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } - umask($OldUMask); + print STDERR "$Name0:error: ", $ErrMessage; }
my $ReportNames; diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl index bcf89bf..7892bca 100755 --- a/testbot/bin/WineRunWineTest.pl +++ b/testbot/bin/WineRunWineTest.pl @@ -204,17 +204,7 @@ LogMsg "Task $JobId/$StepNo/$TaskNo started\n"; sub LogTaskError($) { my ($ErrMessage) = @_; - Debug("$Name0:error: ", $ErrMessage); - - if (open(my $ErrFile, ">>", "$TaskDir/testbot.log")) - { - print $ErrFile $ErrMessage; - close($ErrFile); - } - else - { - Error "Unable to open 'testbot.log' for writing: $!\n"; - } + print STDERR "$Name0:error: ", $ErrMessage; }
my $ReportNames;