The patchdlls / patchprograms Step::FileType distinction is obsolete since build steps may now have to handle patches that include both. So as a first step standardize on patchdlls to identify patch files. Later on support for patchprograms can be removed altogether.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/WineTestBot/PatchUtils.pm | 1 - testbot/web/Submit.pl | 19 +++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm index 14a598545..ec609d987 100644 --- a/testbot/lib/WineTestBot/PatchUtils.pm +++ b/testbot/lib/WineTestBot/PatchUtils.pm @@ -115,7 +115,6 @@ sub _AddTest($$$) my $ExeBase = ($Root eq "programs") ? "${Module}.exe_test" : "${Module}_test"; $Tests->{$Module} = { - "Type" => "patch$Root", "Module" => $Module, "Path" => "$Root/$Module/tests", "ExeBase" => $ExeBase, diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl index 97f31d10c..1425301ea 100644 --- a/testbot/web/Submit.pl +++ b/testbot/web/Submit.pl @@ -118,8 +118,7 @@ sub GetPropertyDescriptors($) } elsif ($self->{Page} == 3) { - my $IsPatch = ($self->GetParam("FileType") eq "patchdlls" || - $self->GetParam("FileType") eq "patchprograms"); + my $IsPatch = ($self->GetParam("FileType") eq "patchdlls"); $self->{PropertyDescriptors3}[0]->{IsRequired} = $IsPatch; return $self->{PropertyDescriptors3}; } @@ -386,8 +385,7 @@ sub DisplayProperty($$) if ($self->{Page} == 3) { my $PropertyName = $PropertyDescriptor->GetName(); - if ($self->GetParam("FileType") eq "patchdlls" || - $self->GetParam("FileType") eq "patchprograms") + if ($self->GetParam("FileType") eq "patchdlls") { if ($PropertyName eq "Run64") { @@ -477,8 +475,6 @@ sub Validate($) { if (($self->GetParam("FileType") eq "patchdlls" && $self->GetParam("TestExecutable") !~ m/^[\w_.]+_test.exe$/) || - ($self->GetParam("FileType") eq "patchprograms" && - $self->GetParam("TestExecutable") !~ m/^[\w_.]+.exe_test.exe$/) || ($self->GetParam("TestExecutable") =~ m=(?:[a-z]:|[/\])=i)) { $self->{ErrField} = "TestExecutable"; @@ -603,7 +599,7 @@ sub DetermineFileType($$) else { my $TestInfo = (values %{$Impacts->{Tests}})[0]; - $FileType = $TestInfo->{Type}; + $FileType = "patchdlls"; $ExeBase = $TestInfo->{ExeBase}; $TestUnit = (keys %{$TestInfo->{Units}})[0]; } @@ -651,8 +647,7 @@ sub OnPage1Next($) $self->{ErrMessage} = $ErrMessage; return !1; } - if ($FileType ne "patchdlls" && $FileType ne "patchprograms" && - $FileType ne "exe32" && $FileType ne "exe64") + if ($FileType !~ /^(?:exe32|exe64|patchdlls)$/) { $self->{ErrField} = "File"; $self->{ErrMessage} = "Unrecognized file type"; @@ -772,7 +767,7 @@ sub OnSubmit($)
my $BuildStep; my $FileType = $self->GetParam("FileType"); - if ($FileType eq "patchdlls" || $FileType eq "patchprograms") + if ($FileType eq "patchdlls") { # This is a patch so add a build step... $BuildStep = $Steps->Add(); @@ -805,7 +800,7 @@ sub OnSubmit($) { next if ($Bits eq "32" && $FileType eq "exe64"); next if ($Bits eq "64" && $FileType eq "exe32"); - next if ($Bits eq "64" && $FileType =~ /^patch/ && !defined($self->GetParam("Run64"))); + next if ($Bits eq "64" && $FileType eq "patchdlls" && !defined($self->GetParam("Run64"))); my $Tasks;
my $VMs = CreateVMs(); @@ -821,7 +816,7 @@ sub OnSubmit($) { # First create the test step my $TestStep = $Steps->Add(); - if ($FileType eq "patchdlls" || $FileType eq "patchprograms") + if ($FileType eq "patchdlls") { $TestStep->PreviousNo($BuildStep->No); my $TestExe = basename($self->GetParam("TestExecutable"));
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/web/Submit.pl | 65 ++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 32 deletions(-)
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl index 1425301ea..c16b99f1e 100644 --- a/testbot/web/Submit.pl +++ b/testbot/web/Submit.pl @@ -2,6 +2,7 @@ # WineTestBot job submit page # # Copyright 2009 Ge van Geldorp +# Copyright 2012-2014, 2017-2018 Francois Gouget # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -765,44 +766,16 @@ sub OnSubmit($) } my $Steps = $NewJob->Steps;
- my $BuildStep; - my $FileType = $self->GetParam("FileType"); - if ($FileType eq "patchdlls") - { - # This is a patch so add a build step... - $BuildStep = $Steps->Add(); - $BuildStep->FileName($BaseName); - $BuildStep->FileType($FileType); - $BuildStep->InStaging(!1); - $BuildStep->Type("build"); - $BuildStep->DebugLevel(0); - - # ...with a build task - my $VMs = CreateVMs(); - $VMs->AddFilter("Type", ["build"]); - $VMs->AddFilter("Role", ["base"]); - my $BuildVM = ${$VMs->GetItems()}[0]; - my $Task = $BuildStep->Tasks->Add(); - $Task->VM($BuildVM); - $Task->Timeout($BuildTimeout); - - # Save the build step so the others can reference it - my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save(); - if (defined($ErrMessage)) - { - $self->{ErrMessage} = $ErrMessage; - return !1; - } - } - # Add steps and tasks for the 32 and 64-bit tests + my $FileType = $self->GetParam("FileType"); + my $BuildStep; foreach my $Bits ("32", "64") { next if ($Bits eq "32" && $FileType eq "exe64"); next if ($Bits eq "64" && $FileType eq "exe32"); next if ($Bits eq "64" && $FileType eq "patchdlls" && !defined($self->GetParam("Run64"))); - my $Tasks;
+ my $Tasks; my $VMs = CreateVMs(); $VMs->AddFilter("Type", $Bits eq "32" ? ["win32", "win64"] : ["win64"]); my $SortedKeys = $VMs->SortKeysBySortOrder($VMs->GetKeys()); @@ -814,7 +787,35 @@ sub OnSubmit($)
if (!$Tasks) { - # First create the test step + if (!$BuildStep and $FileType eq "patchdlls") + { + # This is a patch so add a build step... + $BuildStep = $Steps->Add(); + $BuildStep->FileName($BaseName); + $BuildStep->FileType($FileType); + $BuildStep->InStaging(!1); + $BuildStep->Type("build"); + $BuildStep->DebugLevel(0); + + # ...with a build task + my $VMs = CreateVMs(); + $VMs->AddFilter("Type", ["build"]); + $VMs->AddFilter("Role", ["base"]); + my $BuildVM = ${$VMs->GetItems()}[0]; + my $Task = $BuildStep->Tasks->Add(); + $Task->VM($BuildVM); + $Task->Timeout($BuildTimeout); + + # Save the build step so the others can reference it + my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save(); + if (defined($ErrMessage)) + { + $self->{ErrMessage} = $ErrMessage; + return !1; + } + } + + # Then create the test step my $TestStep = $Steps->Add(); if ($FileType eq "patchdlls") {