[tools] testbot/PatchUtils: Fix the module name for directories containing dots.

Francois Gouget fgouget at codeweavers.com
Mon Mar 8 06:40:51 CST 2021


Wine forces dlls that contain dots in their names to be implemented in
a folder ending in '.dll'. But the module name and test executables
don't have this extra 'extension' and thus deriving them from the
patched filename requires special treatment.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
This fixes the issue in the TestBot code.

However the TestBot uses winetest.exe to run the tests in Wine, 
specifically to run the lib.and.dot.dll tests it would run 'winetest.exe 
lib.and.dot'.

It turns out that winetest.exe has been checking the presence of the 
dlls by calling LoadLibrary("serialui") and not 
LoadLibrary("serialui.dll"). Surprisingly this works. But 
LoadLibrary("lib.and.dot") does not work, even if lib.and.dot.dll does 
exist, as confirmed by LoadLibrary("lib.and.dot.dll"). So this causes 
winetest.exe to skip the lib.and.dot tests because the dll is missing.

https://bugs.winehq.org/show_bug.cgi?id=50783
---
 testbot/lib/WineTestBot/PatchUtils.pm | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index aeb874321..51def0f66 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -44,6 +44,20 @@ use WineTestBot::Utils;
 # Source repository maintenance
 #
 
+sub _Dir2ModuleName($$)
+{
+  my ($Root, $Dir) = @_;
+
+  # Add a .exe extension to program directory names, but not if they already
+  # contain some other extension.
+  return "$Dir.exe" if ($Root eq "programs" and $Dir !~ /\./);
+
+  # Dll directory names can normally be used as is, except if a '.dll'
+  # extension was added because they contains dots.
+  $Dir =~ s/\.dll$//;
+  return $Dir;
+}
+
 =pod
 =over 12
 
@@ -107,7 +121,7 @@ sub _LoadWineFiles()
         my ($Root, $Module, $File) = ($1, $2, $3);
         next if ($File eq "testlist.c");
         next if ($File !~ /\.(?:c|spec)$/);
-        $Module .= ".exe" if ($Root eq "programs" and $Module !~ /\./);
+        $Module = _Dir2ModuleName($Root, $Module);
         $_TestList->{$Module}->{$File} = 1;
       }
     }
@@ -177,8 +191,7 @@ sub _CreateTestInfo($$$)
 {
   my ($Impacts, $Root, $Dir) = @_;
 
-  # Don't add an extension to programs that have one already
-  my $Module = ($Root eq "programs" and $Dir !~ /\./) ? "$Dir.exe" : $Dir;
+  my $Module = _Dir2ModuleName($Root, $Dir);
   $Impacts->{BuildModules}->{$Module} = 1;
   $Impacts->{IsWinePatch} = 1;
 
-- 
2.20.1



More information about the wine-devel mailing list