[PATCH] testbot: Build the list of test units impacted by module patches.
Francois Gouget
fgouget at codeweavers.com
Mon Oct 29 21:42:20 CDT 2018
A patch to a dll or program is likely to impact its test units. This
makes it possible to know which tests units to rerun.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
testbot/lib/WineTestBot/PatchUtils.pm | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index 444ffaf491..fb4f88650f 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -216,6 +216,7 @@ sub _HandleFile($$$)
my $Module = _CreateTestInfo($Impacts, $Root, $Dir);
$Impacts->{PatchedModules} = 1;
+ $Impacts->{Tests}->{$Module}->{PatchedModule} = 1;
if ($File eq "Makefile.in" and $Change ne "modify")
{
@@ -407,20 +408,23 @@ sub GetPatchImpacts($)
$TestInfo->{Units} = {};
foreach my $File (keys %{$TestInfo->{Files}})
{
- # Skip unmodified files
- next if (!$TestInfo->{All} and !$TestInfo->{Files}->{$File});
-
my $Base = $File;
# Non-C files are not test units
next if ($Base !~ s/(?:\.c|\.spec)$//);
# Helper dlls are not test units
next if (exists $TestInfo->{Files}->{"$Base.spec"});
+ # Don't try running a deleted test unit obviously
+ next if ($TestInfo->{Files}->{$File} eq "rm");
- if (($TestInfo->{All} or $TestInfo->{Files}->{$File}) and
- $TestInfo->{Files}->{$File} ne "rm")
+ if ($TestInfo->{All} or $TestInfo->{Files}->{$File})
{
- # Only new/modified test units are impacted
$TestInfo->{Units}->{$Base} = 1;
+ $Impacts->{ModuleUnitCount}++;
+ }
+ elsif ($TestInfo->{PatchedModule})
+ {
+ # The module has been patched so this test unit is impacted indirectly.
+ $Impacts->{ModuleUnitCount}++;
}
}
--
2.19.1
More information about the wine-devel
mailing list