[Lldb-commits] [lldb] 3afe296 - [test][lldb-vscode] Relax assertion to allow multiple compile units returned.

Jordan Rupprecht via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 22 05:19:36 PST 2022


Author: Jordan Rupprecht
Date: 2022-12-22T05:19:29-08:00
New Revision: 3afe296c81b93473c1e5008514d6225a2200ad19

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

LOG: [test][lldb-vscode] Relax assertion to allow multiple compile units returned.

I don't think the intent of this test is to make sure we only have one compile unit; it's to make sure request_compileUnits returns something sensible. Relax the test case to just make sure that the main source file is one of the compile units returned, even if there are others.

Fixes llvm.org/pr49418.

Reviewed By: labath

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

Added: 
    

Modified: 
    lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py b/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
index b56bf9886abb4..fe168adba4158 100644
--- a/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
+++ b/lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
@@ -73,7 +73,6 @@ def test_modules_dsym(self):
 
     @skipIfWindows
     @skipIfRemote
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr49418")
     def test_compile_units(self):
         program = self.getBuildArtifact("a.out")
         self.build_and_launch(program)
@@ -86,7 +85,5 @@ def test_compile_units(self):
         moduleId = self.vscode.get_modules()['a.out']['id']
         response = self.vscode.request_compileUnits(moduleId)
         self.assertTrue(response['body'])
-        self.assertEqual(len(response['body']['compileUnits']), 1,
-                        'Only one source file should exist')
-        self.assertEqual(response['body']['compileUnits'][0]['compileUnitPath'], main_source_path,
-                        'Real path to main.cpp matches')
+        cu_paths = [cu['compileUnitPath'] for cu in response['body']['compileUnits']]
+        self.assertIn(main_source_path, cu_paths, 'Real path to main.cpp matches')


        


More information about the lldb-commits mailing list