Skip to content

Commit 4a827a0

Browse files
committed
[lldb][test] TestLocationListLookup.py: skip expr check on unsupported platforms (llvm#74818)
The `expect_expr` check was introduced in llvm#74772. It is failing on Linux and Windows, so skip this test to unblock the bots (cherry picked from commit 11a7e57)
1 parent f8e0f9b commit 4a827a0

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88

99
class LocationListLookupTestCase(TestBase):
10-
@skipIf(oslist=["linux"], archs=["arm"])
11-
def test_loclist(self):
12-
self.build()
13-
10+
def launch(self) -> lldb.SBProcess:
1411
exe = self.getBuildArtifact("a.out")
1512
target = self.dbg.CreateTarget(exe)
1613
self.assertTrue(target, VALID_TARGET)
@@ -22,15 +19,31 @@ def test_loclist(self):
2219
self.assertTrue(process.IsValid())
2320
self.assertTrue(process.is_stopped)
2421

22+
return process
23+
24+
def check_local_vars(self, process: lldb.SBProcess, check_expr: bool):
2525
# Find `bar` on the stack, then
2626
# make sure we can read out the local
2727
# variables (with both `frame var` and `expr`)
2828
for f in process.GetSelectedThread().frames:
29-
if f.GetDisplayFunctionName().startswith("Foo::bar"):
29+
frame_name = f.GetDisplayFunctionName()
30+
if frame_name is not None and frame_name.startswith("Foo::bar"):
3031
argv = f.GetValueForVariablePath("argv").GetChildAtIndex(0)
3132
strm = lldb.SBStream()
3233
argv.GetDescription(strm)
3334
self.assertNotEqual(strm.GetData().find("a.out"), -1)
3435

35-
process.GetSelectedThread().SetSelectedFrame(f.idx)
36-
self.expect_expr("this", result_type="Foo *")
36+
if check_expr:
37+
process.GetSelectedThread().SetSelectedFrame(f.idx)
38+
self.expect_expr("this", result_type="Foo *")
39+
40+
@skipIf(oslist=["linux"], archs=["arm"])
41+
@skipIfDarwin
42+
def test_loclist_frame_var(self):
43+
self.build()
44+
self.check_local_vars(self.launch(), check_expr=False)
45+
46+
@skipUnlessDarwin
47+
def test_loclist_expr(self):
48+
self.build()
49+
self.check_local_vars(self.launch(), check_expr=True)

0 commit comments

Comments
 (0)