aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/API')
-rw-r--r--lldb/test/API/lang/objc/synthesized-property-accessor/Makefile4
-rw-r--r--lldb/test/API/lang/objc/synthesized-property-accessor/TestSynthesizedPropertyAccessor.py30
-rw-r--r--lldb/test/API/lang/objc/synthesized-property-accessor/main.m14
-rw-r--r--lldb/test/API/lua_api/TestLuaAPI.py4
4 files changed, 51 insertions, 1 deletions
diff --git a/lldb/test/API/lang/objc/synthesized-property-accessor/Makefile b/lldb/test/API/lang/objc/synthesized-property-accessor/Makefile
new file mode 100644
index 0000000..89e6e79
--- /dev/null
+++ b/lldb/test/API/lang/objc/synthesized-property-accessor/Makefile
@@ -0,0 +1,4 @@
+OBJC_SOURCES := main.m
+LDFLAGS := -lobjc
+
+include Makefile.rules
diff --git a/lldb/test/API/lang/objc/synthesized-property-accessor/TestSynthesizedPropertyAccessor.py b/lldb/test/API/lang/objc/synthesized-property-accessor/TestSynthesizedPropertyAccessor.py
new file mode 100644
index 0000000..0a171e98
--- /dev/null
+++ b/lldb/test/API/lang/objc/synthesized-property-accessor/TestSynthesizedPropertyAccessor.py
@@ -0,0 +1,30 @@
+"""
+Test debug-info parsing of synthesized Objective-C properties.
+"""
+
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestSynthesizedPropertyAccessor(TestBase):
+ def test(self):
+ self.build()
+
+ (target, _, _, _) = lldbutil.run_to_source_breakpoint(
+ self, "return f.fooProp", lldb.SBFileSpec("main.m")
+ )
+
+ getters = target.FindFunctions("-[Foo fooProp]", lldb.eFunctionNameTypeSelector)
+ self.assertEqual(len(getters), 1)
+ getter = getters[0].function.GetType()
+ self.assertTrue(getter)
+ self.assertEqual(getter.GetDisplayTypeName(), "int ()")
+
+ setters = target.FindFunctions(
+ "-[Foo setFooProp:]", lldb.eFunctionNameTypeSelector
+ )
+ self.assertEqual(len(setters), 1)
+ setter = setters[0].function.GetType()
+ self.assertTrue(setter)
+ self.assertEqual(setter.GetDisplayTypeName(), "void (int)")
diff --git a/lldb/test/API/lang/objc/synthesized-property-accessor/main.m b/lldb/test/API/lang/objc/synthesized-property-accessor/main.m
new file mode 100644
index 0000000..4186162
--- /dev/null
+++ b/lldb/test/API/lang/objc/synthesized-property-accessor/main.m
@@ -0,0 +1,14 @@
+#import <Foundation/Foundation.h>
+
+@interface Foo : NSObject
+@property(readwrite) int fooProp;
+@end
+
+@implementation Foo
+@end
+
+int main() {
+ Foo *f = [Foo new];
+ [f setFooProp:10];
+ return f.fooProp;
+}
diff --git a/lldb/test/API/lua_api/TestLuaAPI.py b/lldb/test/API/lua_api/TestLuaAPI.py
index 4ac795d..e78ed9d 100644
--- a/lldb/test/API/lua_api/TestLuaAPI.py
+++ b/lldb/test/API/lua_api/TestLuaAPI.py
@@ -158,7 +158,9 @@ class TestLuaAPI(TestBase):
return tests
def test_lua_api(self):
- if "LUA_EXECUTABLE" not in os.environ or len(os.environ["LUA_EXECUTABLE"]) == 0:
+ if "LUA_EXECUTABLE" not in os.environ or not os.path.exists(
+ os.environ["LUA_EXECUTABLE"]
+ ):
self.skipTest("Lua API tests could not find Lua executable.")
return
lua_executable = os.environ["LUA_EXECUTABLE"]