summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py')
-rw-r--r--lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py69
1 files changed, 20 insertions, 49 deletions
diff --git a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
index f653e08e737..c01a0314a5c 100644
--- a/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
+++ b/lldb/test/functionalities/abbreviation/TestCommonShortSpellings.py
@@ -1,6 +1,6 @@
"""
Test some lldb command abbreviations to make sure the common short spellings of
-many commands remain available even after we add/delte commands in the future.
+many commands remain available even after we add/delete commands in the future.
"""
import os, time
@@ -13,54 +13,25 @@ class CommonShortSpellingsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- def test_with_dsym (self):
- self.buildDsym ()
- self.run_abbrevs2 ()
-
- @dwarf_test
- def test_with_dwarf (self):
- self.buildDwarf ()
- self.run_abbrevs2 ()
-
- def run_abbrevs2 (self):
- exe = os.path.join (os.getcwd(), "a.out")
- self.expect("file " + exe,
- patterns = [ "Current executable set to .*a.out.*" ])
-
- # br s -> breakpoint set
-
- match_object = lldbutil.run_break_set_command (self, "br s -n sum")
- lldbutil.check_breakpoint_result (self, match_object, symbol_name='sum', symbol_match_exact=False, num_locations=1)
-
- self.runCmd("settings set interpreter.expand-regex-aliases true")
- self.addTearDownHook(
- lambda: self.runCmd("settings set interpreter.expand-regex-aliases false"))
-
- # disp -> display
- self.expect("disp a",
- startstr = "target stop-hook add -o")
- self.expect("disp b",
- startstr = "target stop-hook add -o")
-
- # di/dis -> disassemble
- self.expect("help di",
- substrs = ["disassemble"])
- self.expect("help dis",
- substrs = ["disassemble"])
-
- # ta st a -> target stop-hook add
- self.expect("help ta st a",
- substrs = ["target stop-hook add"])
-
- # fr v -> frame variable
- self.expect("help fr v",
- substrs = ["frame variable"])
-
- # ta st li -> target stop-hook list
- self.expect("ta st li",
- substrs = ["Hook: 1", "Hook: 2"])
+ 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, long) in abbrevs:
+ command_interpreter.ResolveCommand(short, result)
+ self.assertTrue(result.Succeeded())
+ self.assertEqual(long, result.GetOutput())
if __name__ == '__main__':
OpenPOWER on IntegriCloud