diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
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.py | 205 |
1 files changed, 139 insertions, 66 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 126f6e4dab8..7d2900d6171 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py @@ -5,13 +5,13 @@ Test some target commands: create, list, select, variable. from __future__ import print_function - import lldb import sys from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class targetCommandTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -80,17 +80,19 @@ class targetCommandTestCase(TestBase): # We will start from (index + 1) .... base = int(match.group(1), 10) + 1 #print("base is:", base) - break; + break self.runCmd("target create " + exe_a, CURRENT_EXECUTABLE_SET) self.runCmd("run", RUN_SUCCEEDED) self.runCmd("target create " + exe_b, CURRENT_EXECUTABLE_SET) - lldbutil.run_break_set_by_file_and_line (self, 'b.c', self.line_b, num_expected_locations=1, loc_exact=True) + lldbutil.run_break_set_by_file_and_line( + self, 'b.c', self.line_b, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) self.runCmd("target create " + exe_c, CURRENT_EXECUTABLE_SET) - lldbutil.run_break_set_by_file_and_line (self, 'c.c', self.line_c, num_expected_locations=1, loc_exact=True) + lldbutil.run_break_set_by_file_and_line( + self, 'c.c', self.line_c, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) self.runCmd("target list") @@ -100,13 +102,13 @@ class targetCommandTestCase(TestBase): self.runCmd("target select %d" % (base + 2)) self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['c.c:%d' % self.line_c, - 'stop reason = breakpoint']) + substrs=['c.c:%d' % self.line_c, + 'stop reason = breakpoint']) self.runCmd("target select %d" % (base + 1)) self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['b.c:%d' % self.line_b, - 'stop reason = breakpoint']) + substrs=['b.c:%d' % self.line_b, + 'stop reason = breakpoint']) self.runCmd("target list") @@ -114,89 +116,160 @@ class targetCommandTestCase(TestBase): """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.expect("target variable my_static_int", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_static_int', '228']) + 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.expect( + "target variable my_static_int", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_static_int', + '228']) self.expect("target variable my_global_str_ptr", matching=False, - substrs = ['"abc"']) + substrs=['"abc"']) self.expect("target variable *my_global_str_ptr", matching=True, - substrs = ['"abc"']) - self.expect("target variable *my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['a']) + substrs=['"abc"']) + self.expect( + "target variable *my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=['a']) self.runCmd("b main") self.runCmd("run") - - self.expect("target variable my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_global_str', '"abc"']) - self.expect("target variable my_static_int", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_static_int', '228']) + + self.expect( + "target variable my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_global_str', + '"abc"']) + self.expect( + "target variable my_static_int", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_static_int', + '228']) self.expect("target variable my_global_str_ptr", matching=False, - substrs = ['"abc"']) + substrs=['"abc"']) self.expect("target variable *my_global_str_ptr", matching=True, - substrs = ['"abc"']) - self.expect("target variable *my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['a']) - self.expect("target variable my_global_char", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ["my_global_char", "'X'"]) + substrs=['"abc"']) + self.expect( + "target variable *my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=['a']) + self.expect( + "target variable my_global_char", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + "my_global_char", + "'X'"]) self.runCmd("c") # rdar://problem/9763907 # 'target variable' command fails if the target program has been run - self.expect("target variable my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_global_str', '"abc"']) - self.expect("target variable my_static_int", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_static_int', '228']) + self.expect( + "target variable my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_global_str', + '"abc"']) + self.expect( + "target variable my_static_int", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_static_int', + '228']) self.expect("target variable my_global_str_ptr", matching=False, - substrs = ['"abc"']) + substrs=['"abc"']) self.expect("target variable *my_global_str_ptr", matching=True, - substrs = ['"abc"']) - self.expect("target variable *my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['a']) - self.expect("target variable my_global_char", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ["my_global_char", "'X'"]) + substrs=['"abc"']) + self.expect( + "target variable *my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=['a']) + self.expect( + "target variable my_global_char", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + "my_global_char", + "'X'"]) def do_target_variable_command_no_fail(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.expect("target variable my_static_int", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_static_int', '228']) + 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.expect( + "target variable my_static_int", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_static_int', + '228']) self.expect("target variable my_global_str_ptr", matching=False, - substrs = ['"abc"']) + substrs=['"abc"']) self.expect("target variable *my_global_str_ptr", matching=True, - substrs = ['"abc"']) - self.expect("target variable *my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['a']) + substrs=['"abc"']) + self.expect( + "target variable *my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=['a']) self.runCmd("b main") self.runCmd("run") - + # New feature: you don't need to specify the variable(s) to 'target vaiable'. - # It will find all the global and static variables in the current compile unit. + # It will find all the global and static variables in the current + # compile unit. self.expect("target variable", - substrs = ['my_global_char', - 'my_global_str', - 'my_global_str_ptr', - 'my_static_int']) - - self.expect("target variable my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_global_str', '"abc"']) - self.expect("target variable my_static_int", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['my_static_int', '228']) + substrs=['my_global_char', + 'my_global_str', + 'my_global_str_ptr', + 'my_static_int']) + + self.expect( + "target variable my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_global_str', + '"abc"']) + self.expect( + "target variable my_static_int", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + 'my_static_int', + '228']) self.expect("target variable my_global_str_ptr", matching=False, - substrs = ['"abc"']) + substrs=['"abc"']) self.expect("target variable *my_global_str_ptr", matching=True, - substrs = ['"abc"']) - self.expect("target variable *my_global_str", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['a']) - self.expect("target variable my_global_char", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ["my_global_char", "'X'"]) + substrs=['"abc"']) + self.expect( + "target variable *my_global_str", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=['a']) + self.expect( + "target variable my_global_char", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + "my_global_char", + "'X'"]) |