diff options
| author | Zachary Turner <zturner@google.com> | 2015-10-28 17:43:26 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2015-10-28 17:43:26 +0000 |
| commit | c432c8f856e0bd84de980a9d9bb2d31b06fa95b1 (patch) | |
| tree | 4efa528e074a6e2df782345e4cd97f5d85d038c4 /lldb/packages/Python/lldbsuite/test/functionalities/command_history | |
| parent | a8a3bd210086b50242903ed95048fe5e53897878 (diff) | |
| download | bcm5719-llvm-c432c8f856e0bd84de980a9d9bb2d31b06fa95b1.tar.gz bcm5719-llvm-c432c8f856e0bd84de980a9d9bb2d31b06fa95b1.zip | |
Move lldb/test to lldb/packages/Python/lldbsuite/test.
This is the conclusion of an effort to get LLDB's Python code
structured into a bona-fide Python package. This has a number
of benefits, but most notably the ability to more easily share
Python code between different but related pieces of LLDB's Python
infrastructure (for example, `scripts` can now share code with
`test`).
llvm-svn: 251532
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/command_history')
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/command_history/.categories | 1 | ||||
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py | 68 |
2 files changed, 69 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/command_history/.categories b/lldb/packages/Python/lldbsuite/test/functionalities/command_history/.categories new file mode 100644 index 00000000000..3a3f4df6416 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/command_history/.categories @@ -0,0 +1 @@ +cmdline diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py b/lldb/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py new file mode 100644 index 00000000000..e8a7ccdfa00 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py @@ -0,0 +1,68 @@ +""" +Test the command history mechanism +""" + +from __future__ import print_function + +import use_lldb_suite + +import os +import lldb +from lldbtest import * + +class CommandHistoryTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @no_debug_info_test + def test_history(self): + self.runCmd('command history --clear', inHistory=False) + self.runCmd('breakpoint list', check=False, inHistory=True) #0 + self.runCmd('register read', check=False, inHistory=True) #1 + self.runCmd('apropos hello', check=False, inHistory=True) #2 + self.runCmd('memory write', check=False, inHistory=True) #3 + self.runCmd('log list', check=False, inHistory=True) #4 + self.runCmd('disassemble', check=False, inHistory=True) #5 + self.runCmd('expression 1', check=False, inHistory=True) #6 + self.runCmd('type summary list -w default', check=False, inHistory=True) #7 + self.runCmd('version', check=False, inHistory=True) #8 + self.runCmd('frame select 1', check=False, inHistory=True) #9 + + self.expect ("command history -s 3 -c 3", inHistory=True, + substrs = ['3: memory write','4: log list','5: disassemble']) + + self.expect ("command history -s 3 -e 3", inHistory=True, + substrs = ['3: memory write']) + + self.expect ("command history -s 6 -e 7", inHistory=True, + substrs = ['6: expression 1','7: type summary list -w default']) + + self.expect ("command history -c 2", inHistory=True, + substrs = ['0: breakpoint list','1: register read']) + + self.expect ("command history -e 3 -c 1", inHistory=True, + substrs = ['3: memory write']) + + self.expect ("command history -e 2", inHistory=True, + substrs = ['0: breakpoint list','1: register read','2: apropos hello']) + + self.expect ("command history -s 12", inHistory=True, + substrs = ['12: command history -s 6 -e 7','13: command history -c 2','14: command history -e 3 -c 1','15: command history -e 2','16: command history -s 12']) + + self.expect ("command history -s end -c 3", inHistory=True, + substrs = ['15: command history -e 2','16: command history -s 12','17: command history -s end -c 3']) + + self.expect ("command history -s end -e 15", inHistory=True, + substrs = ['15: command history -e 2','16: command history -s 12','17: command history -s end -c 3','command history -s end -e 15']) + + self.expect ("command history -s 5 -c 1", inHistory=True, + substrs = ['5: disassemble']) + + self.expect ("command history -c 1 -s 5", inHistory=True, + substrs = ['5: disassemble']) + + self.expect ("command history -c 1 -e 3", inHistory=True, + substrs = ['3: memory write']) + + self.expect ("command history -c 1 -e 3 -s 5",error=True, inHistory=True, + substrs = ['error: --count, --start-index and --end-index cannot be all specified in the same invocation']) |

