summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/target_command/TestTargetCommand.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-12 23:18:03 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-12 23:18:03 +0000
commitaf6e82f6110f71d89e960109bfe7b1bc028cd16a (patch)
treeee3bfa41d225c34f20b7c0b96e7eb0092c60bd7c /lldb/test/functionalities/target_command/TestTargetCommand.py
parent10bc1e5452e121962fc4da7c9d31a9986a2b0ae6 (diff)
downloadbcm5719-llvm-af6e82f6110f71d89e960109bfe7b1bc028cd16a.tar.gz
bcm5719-llvm-af6e82f6110f71d89e960109bfe7b1bc028cd16a.zip
Add a test case to exercise 'target variable' command before and after running the inferior.
Currently it fails after the inferior is run. rdar://problem/9763907 llvm-svn: 135009
Diffstat (limited to 'lldb/test/functionalities/target_command/TestTargetCommand.py')
-rw-r--r--lldb/test/functionalities/target_command/TestTargetCommand.py38
1 files changed, 34 insertions, 4 deletions
diff --git a/lldb/test/functionalities/target_command/TestTargetCommand.py b/lldb/test/functionalities/target_command/TestTargetCommand.py
index eeb11f136b4..7b2648c6df1 100644
--- a/lldb/test/functionalities/target_command/TestTargetCommand.py
+++ b/lldb/test/functionalities/target_command/TestTargetCommand.py
@@ -1,5 +1,5 @@
"""
-Test some target commands: create, list, select.
+Test some target commands: create, list, select, variable.
"""
import unittest2
@@ -21,19 +21,31 @@ class targetCommandTestCase(TestBase):
def test_target_command_with_dwarf(self):
"""Test some target commands: create, list, select."""
da = {'C_SOURCES': 'a.c', 'EXE': 'a.out'}
- self.buildDefault(dictionary=da)
+ self.buildDwarf(dictionary=da)
self.addTearDownCleanup(dictionary=da)
db = {'C_SOURCES': 'b.c', 'EXE': 'b.out'}
- self.buildDefault(dictionary=db)
+ self.buildDwarf(dictionary=db)
self.addTearDownCleanup(dictionary=db)
dc = {'C_SOURCES': 'c.c', 'EXE': 'c.out'}
- self.buildDefault(dictionary=dc)
+ self.buildDwarf(dictionary=dc)
self.addTearDownCleanup(dictionary=dc)
self.do_target_command()
+ # rdar://problem/9763907
+ # 'target variable' command fails if the target program has been run
+ #@unittest2.expectedFailure
+ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+ def test_target_variable_command_with_dsym(self):
+ """Test 'target variable' command before and after starting the inferior."""
+ d = {'C_SOURCES': 'globals.c', 'EXE': 'globals'}
+ self.buildDsym(dictionary=d)
+ self.addTearDownCleanup(dictionary=d)
+
+ self.do_target_variable_command('globals')
+
def do_target_command(self):
"""Exercise 'target create', 'target list', 'target select' commands."""
exe_a = os.path.join(os.getcwd(), "a.out")
@@ -87,6 +99,24 @@ class targetCommandTestCase(TestBase):
self.runCmd("target list")
+ def do_target_variable_command(self, exe_name):
+ """Exercise 'target variable' command before and after starting the inferior."""
+ self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+
+ self.expect("target variable my_global_char", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ["my_global_char", "'X'"])
+ self.expect("target variable my_global_str", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ['my_global_str', '"abc"'])
+
+ self.runCmd("run")
+
+ # rdar://problem/9763907
+ # 'target variable' command fails if the target program has been run
+ self.expect("target variable my_global_char", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ["my_global_char", "'X'"])
+ self.expect("target variable my_global_str", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs = ['my_global_str', '"abc"'])
+
if __name__ == '__main__':
import atexit
OpenPOWER on IntegriCloud