[Lldb-commits] [PATCH] D138344: [test][lldb-vscode] Relax assertion to allow multiple compile units returned.

Jordan Rupprecht via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 18 17:57:20 PST 2022


rupprecht created this revision.
rupprecht added reviewers: wallace, clayborg.
Herald added a project: All.
rupprecht requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138344

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


Index: lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
===================================================================
--- lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
+++ lldb/test/API/tools/lldb-vscode/module/TestVSCode_module.py
@@ -73,7 +73,6 @@
 
     @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 @@
         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')


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138344.476642.patch
Type: text/x-patch
Size: 1166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221119/44d94520/attachment.bin>


More information about the lldb-commits mailing list