summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-08-22 13:09:02 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-08-22 13:09:02 +0000
commit5215770e88ee71321466a4904a4ab628af687673 (patch)
treed74e4075bd1267b850e0ecb02a07a45b6c0babb0 /lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
parent91208447d0a653871165c2139ac7030dc95022b3 (diff)
downloadbcm5719-llvm-5215770e88ee71321466a4904a4ab628af687673.tar.gz
bcm5719-llvm-5215770e88ee71321466a4904a4ab628af687673.zip
[lldb][NFC] Add test for target stop-hook disable/enable/delete
llvm-svn: 369646
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py33
1 files changed, 28 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py b/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
index 20343efb690..4b7a0805207 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
@@ -22,20 +22,25 @@ class targetCommandTestCase(TestBase):
self.line_b = line_number('b.c', '// Set break point at this line.')
self.line_c = line_number('c.c', '// Set break point at this line.')
- def test_target_command(self):
- """Test some target commands: create, list, select."""
+ def buildB(self):
+ db = {'C_SOURCES': 'b.c', 'EXE': self.getBuildArtifact('b.out')}
+ self.build(dictionary=db)
+ self.addTearDownCleanup(dictionary=db)
+
+ def buildAll(self):
da = {'C_SOURCES': 'a.c', 'EXE': self.getBuildArtifact('a.out')}
self.build(dictionary=da)
self.addTearDownCleanup(dictionary=da)
- db = {'C_SOURCES': 'b.c', 'EXE': self.getBuildArtifact('b.out')}
- self.build(dictionary=db)
- self.addTearDownCleanup(dictionary=db)
+ self.buildB()
dc = {'C_SOURCES': 'c.c', 'EXE': self.getBuildArtifact('c.out')}
self.build(dictionary=dc)
self.addTearDownCleanup(dictionary=dc)
+ def test_target_command(self):
+ """Test some target commands: create, list, select."""
+ self.buildAll()
self.do_target_command()
def test_target_variable_command(self):
@@ -270,3 +275,21 @@ class targetCommandTestCase(TestBase):
substrs=[
"my_global_char",
"'X'"])
+
+ @no_debug_info_test
+ def test_target_stop_hook_disable_enable(self):
+ self.buildB()
+ self.runCmd("file " + self.getBuildArtifact("b.out"), CURRENT_EXECUTABLE_SET)
+
+ self.expect("target stop-hook disable 1", error=True, substrs=['unknown stop hook id: "1"'])
+ self.expect("target stop-hook disable blub", error=True, substrs=['invalid stop hook id: "blub"'])
+ self.expect("target stop-hook enable 1", error=True, substrs=['unknown stop hook id: "1"'])
+ self.expect("target stop-hook enable blub", error=True, substrs=['invalid stop hook id: "blub"'])
+
+ @no_debug_info_test
+ def test_target_stop_hook_delete(self):
+ self.buildB()
+ self.runCmd("file " + self.getBuildArtifact("b.out"), CURRENT_EXECUTABLE_SET)
+
+ self.expect("target stop-hook delete 1", error=True, substrs=['unknown stop hook id: "1"'])
+ self.expect("target stop-hook delete blub", error=True, substrs=['invalid stop hook id: "blub"'])
OpenPOWER on IntegriCloud