summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py57
1 files changed, 11 insertions, 46 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
index 20137e3d118..28d3558126d 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
@@ -16,61 +16,26 @@ class FoundationTestCase2(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
def test_expr_commands(self):
"""More expression commands for objective-c."""
self.build()
- exe = self.getBuildArtifact("a.out")
- self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
- lines = []
- lines.append(
- line_number(
- 'main.m',
- '// Break here for selector: tests'))
- lines.append(
- line_number(
- 'main.m',
- '// Break here for NSArray tests'))
- lines.append(
- line_number(
- 'main.m',
- '// Break here for NSString tests'))
- lines.append(
- line_number(
- 'main.m',
- '// Break here for description test'))
- lines.append(
- line_number(
- 'main.m',
- '// Set break point at this line'))
-
- # Create a bunch of breakpoints.
- for line in lines:
- lldbutil.run_break_set_by_file_and_line(
- self, "main.m", line, num_expected_locations=1, loc_exact=True)
-
- self.runCmd("run", RUN_SUCCEEDED)
+ main_spec = lldb.SBFileSpec("main.m")
+ (target, process, thread, bp) = lldbutil.run_to_source_breakpoint(
+ self, "Break here for selector: tests", main_spec)
+
# Test_Selector:
- self.runCmd("thread backtrace")
self.expect("expression (char *)sel_getName(sel)",
substrs=["(char *)",
"length"])
- self.runCmd("process continue")
-
- # Test_NSArray:
- self.runCmd("thread backtrace")
- self.runCmd("process continue")
-
- # Test_NSString:
- self.runCmd("thread backtrace")
- self.runCmd("process continue")
-
- # Test_MyString:
- self.runCmd("thread backtrace")
+ desc_bkpt = target.BreakpointCreateBySourceRegex("Break here for description test",
+ main_spec)
+ self.assertEqual(desc_bkpt.GetNumLocations(), 1, "description breakpoint has a location")
+ lldbutil.continue_to_breakpoint(process, desc_bkpt)
+
self.expect("expression (char *)sel_getName(_cmd)",
substrs=["(char *)",
"description"])
-
- self.runCmd("process continue")
OpenPOWER on IntegriCloud