summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2019-09-18 01:53:52 +0000
committerJim Ingham <jingham@apple.com>2019-09-18 01:53:52 +0000
commitd6cad39316359a8bebac830350b1d190ce9b0cee (patch)
tree66c6848b73a6d40ac5bd9807c92b542c56dd09b9 /lldb/packages/Python/lldbsuite
parentba2e752c520b4ba31c30846269f8331cc217054f (diff)
downloadbcm5719-llvm-d6cad39316359a8bebac830350b1d190ce9b0cee.tar.gz
bcm5719-llvm-d6cad39316359a8bebac830350b1d190ce9b0cee.zip
Clean up this test.
I don't know what the intent of parts of this test were. We set a bunch of breakpoints and ran from one to the other, doing "self.runCmd("thread backtrace")" then continuing to the next one. We didn't actually verify the contents of the backtrace, nor that we hit the breakpoints we set in any particular order. The only actual test was to run sel_getName at two of these stops. So I reduced the test to just stopping at the places where we were actually going to run an expression, and tested the expression. llvm-svn: 372196
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-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