Zachary Turner c432c8f856 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
2015-10-28 17:43:26 +00:00

39 lines
1.2 KiB
Python

"""
Test some lldb command abbreviations to make sure the common short spellings of
many commands remain available even after we add/delete commands in the future.
"""
from __future__ import print_function
import use_lldb_suite
import os, time
import lldb
from lldbtest import *
import lldbutil
class CommonShortSpellingsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@no_debug_info_test
def test_abbrevs2 (self):
command_interpreter = self.dbg.GetCommandInterpreter()
self.assertTrue(command_interpreter, VALID_COMMAND_INTERPRETER)
result = lldb.SBCommandReturnObject()
abbrevs = [
('br s', 'breakpoint set'),
('disp', '_regexp-display'), # a.k.a., 'display'
('di', 'disassemble'),
('dis', 'disassemble'),
('ta st a', 'target stop-hook add'),
('fr v', 'frame variable'),
('ta st li', 'target stop-hook list'),
]
for (short_val, long_val) in abbrevs:
command_interpreter.ResolveCommand(short_val, result)
self.assertTrue(result.Succeeded())
self.assertEqual(long_val, result.GetOutput())