[Lldb-commits] [lldb] [lldb][test] TestLocationListLookup.py: skip expr check on unsupported platforms (PR #74818)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 8 00:57:22 PST 2023
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/74818
>From 32b8d4102f73f7b42792f9c817742d1eba629351 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Fri, 8 Dec 2023 08:51:32 +0000
Subject: [PATCH 1/3] [lldb][test] TestLocationListLookup.py: skip expr check
on unsupported platforms
---
.../TestLocationListLookup.py | 24 ++++++++++++++-----
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
index 07f306a6ed78b..78fdaf939af1d 100644
--- a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
+++ b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
@@ -7,10 +7,7 @@
class LocationListLookupTestCase(TestBase):
- @skipIf(oslist=["linux"], archs=["arm"])
- def test_loclist(self):
- self.build()
-
+ def launch(self) -> lldb.SBProcess:
exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -22,6 +19,9 @@ def test_loclist(self):
self.assertTrue(process.IsValid())
self.assertTrue(process.is_stopped)
+ return process
+
+ def check_local_vars(self, process: lldb.SBProcess, check_expr: bool):
# Find `bar` on the stack, then
# make sure we can read out the local
# variables (with both `frame var` and `expr`)
@@ -32,5 +32,17 @@ def test_loclist(self):
argv.GetDescription(strm)
self.assertNotEqual(strm.GetData().find("a.out"), -1)
- process.GetSelectedThread().SetSelectedFrame(f.idx)
- self.expect_expr("this", result_type="Foo *")
+ if check_expr:
+ process.GetSelectedThread().SetSelectedFrame(f.idx)
+ self.expect_expr("this", result_type="Foo *")
+
+ @skipIf(oslist=["linux"], archs=["arm"])
+ @skipIfDarwin
+ def test_loclist_frame_var(self):
+ self.build()
+ self.check_local_vars(self.launch(), check_expr=False)
+
+ @skipUnlessDarwin
+ def test_loclist_expr(self):
+ self.build()
+ self.check_local_vars(self.launch(), check_expr=True)
>From 9f71e25c3729962da0ad9697ae077adb04e2b7f9 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Fri, 8 Dec 2023 08:56:41 +0000
Subject: [PATCH 2/3] fixup! skip on windows
---
.../location-list-lookup/TestLocationListLookup.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
index 78fdaf939af1d..7ff8934228e2c 100644
--- a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
+++ b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
@@ -38,6 +38,7 @@ def check_local_vars(self, process: lldb.SBProcess, check_expr: bool):
@skipIf(oslist=["linux"], archs=["arm"])
@skipIfDarwin
+ @skipIfWindows # GetDisplayFunctionName returns None
def test_loclist_frame_var(self):
self.build()
self.check_local_vars(self.launch(), check_expr=False)
>From 7e8fb51e25190a77ffcc5cb29e5aed9e0669d0fd Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Fri, 8 Dec 2023 08:57:10 +0000
Subject: [PATCH 3/3] fixup! format
---
.../location-list-lookup/TestLocationListLookup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
index 7ff8934228e2c..7eb790e5a3066 100644
--- a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
+++ b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py
@@ -38,7 +38,7 @@ def check_local_vars(self, process: lldb.SBProcess, check_expr: bool):
@skipIf(oslist=["linux"], archs=["arm"])
@skipIfDarwin
- @skipIfWindows # GetDisplayFunctionName returns None
+ @skipIfWindows # GetDisplayFunctionName returns None
def test_loclist_frame_var(self):
self.build()
self.check_local_vars(self.launch(), check_expr=False)
More information about the lldb-commits
mailing list