Francois Gouget : testbot: Build the list of test units impacted by module patches.

Alexandre Julliard julliard at winehq.org
Tue Oct 30 03:25:13 CDT 2018


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Oct 30 03:42:20 2018 +0100

testbot: Build the list of test units impacted by module patches.

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 444ffaf..fb4f886 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}++;
       }
     }
 




More information about the wine-cvs mailing list