summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index e67a6332d9d..cb4aeadbf93 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -24,12 +24,21 @@ class BreakpointCommandTestCase(TestBase):
cls.RemoveTempFile("output2.txt")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
- def test(self):
+ def test_breakpoint_command_sequence(self):
"""Test a sequence of breakpoint command add, list, and delete."""
self.build()
self.breakpoint_command_sequence()
+
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
+ def test_script_parameters(self):
+ """Test a sequence of breakpoint command add, list, and delete."""
+ self.build()
self.breakpoint_command_script_parameters()
+ def test_commands_on_creation(self):
+ self.build()
+ self.breakpoint_commands_on_creation()
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -268,3 +277,23 @@ class BreakpointCommandTestCase(TestBase):
# Now remove 'output-2.txt'
os.remove('output-2.txt')
+
+ def breakpoint_commands_on_creation(self):
+ """Test that setting breakpoint commands when creating the breakpoint works"""
+ exe = os.path.join(os.getcwd(), "a.out")
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target.IsValid(), "Created an invalid target.")
+
+ # Add a breakpoint.
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.c", self.line, num_expected_locations=1, loc_exact=True,
+ extra_options='-d bt -d "thread list" -d continue')
+
+ bkpt = target.FindBreakpointByID(1)
+ self.assertTrue(bkpt.IsValid(), "Couldn't find breakpoint 1")
+ com_list = lldb.SBStringList()
+ bkpt.GetCommandLineCommands(com_list)
+ self.assertEqual(com_list.GetSize(), 3, "Got the wrong number of commands")
+ self.assertEqual(com_list.GetStringAtIndex(0), "bt", "First bt")
+ self.assertEqual(com_list.GetStringAtIndex(1), "thread list", "Next thread list")
+ self.assertEqual(com_list.GetStringAtIndex(2), "continue", "Last continue")
OpenPOWER on IntegriCloud