[Lldb-commits] [lldb] fac5d05 - [lldb] Fix and enable Windows minidump tests

Jaroslav Sevcik via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 9 13:04:03 PDT 2020


Author: Jaroslav Sevcik
Date: 2020-06-09T20:03:44Z
New Revision: fac5d05eb75fab163dc316859fa5e7d255b98f7c

URL: https://github.com/llvm/llvm-project/commit/fac5d05eb75fab163dc316859fa5e7d255b98f7c
DIFF: https://github.com/llvm/llvm-project/commit/fac5d05eb75fab163dc316859fa5e7d255b98f7c.diff

LOG: [lldb] Fix and enable Windows minidump tests

SBFileSpec.fullpath always uses the forward slash to join the directory with the
base name. This causes mismatches when comparing Windows paths with backslashes
in two of the minidump tests. To get around that we just compare the directory
names separately from the filenames.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D81465

Added: 
    

Modified: 
    lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
index 601546b1dc8e..8cb7de9714e3 100644
--- a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
+++ b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
@@ -19,9 +19,14 @@ class MiniDumpUUIDTestCase(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
 
     def verify_module(self, module, verify_path, verify_uuid):
-        uuid = module.GetUUIDString()
-        self.assertEqual(verify_path, module.GetFileSpec().fullpath)
-        self.assertEqual(verify_uuid, uuid)
+        # Compare the filename and the directory separately. We are avoiding
+        # SBFileSpec.fullpath because it causes a slash/backslash confusion
+        # on Windows.
+        self.assertEqual(
+            os.path.basename(verify_path), module.GetFileSpec().basename)
+        self.assertEqual(
+            os.path.dirname(verify_path), module.GetFileSpec().dirname or "")
+        self.assertEqual(verify_uuid, module.GetUUIDString())
 
     def get_minidump_modules(self, yaml_file):
         minidump_path = self.getBuildArtifact(os.path.basename(yaml_file) + ".dmp")
@@ -130,7 +135,6 @@ def test_uuid_modules_elf_build_id_same(self):
         self.verify_module(modules[1], "/file/does/not/exist/b",
                            '11223344-1122-3344-1122-334411223344-11223344')
 
-    @expectedFailureAll(oslist=["windows"])
     def test_partial_uuid_match(self):
         """
             Breakpad has been known to create minidump files using CvRecord in each
@@ -248,7 +252,6 @@ def test_add_module_build_id_4(self):
                 "a", "", "01020304-0506-0708-090A-0B0C0D0E0F10").IsValid())
         self.assertFalse(self.target.AddModule("a", "", "01020305").IsValid())
 
-    @expectedFailureAll(oslist=["windows"])
     def test_remove_placeholder_add_real_module(self):
         """
             Test that removing a placeholder module and adding back the real


        


More information about the lldb-commits mailing list