brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 1a7eb4a Raw
35 lines · python
1"""2Test some lldb command abbreviations to make sure the common short spellings of3many commands remain available even after we add/delete commands in the future.4"""5 6 7import lldb8from lldbsuite.test.decorators import *9from lldbsuite.test.lldbtest import *10from lldbsuite.test import lldbutil11 12 13class CommonShortSpellingsTestCase(TestBase):14    @no_debug_info_test15    def test_abbrevs2(self):16        command_interpreter = self.dbg.GetCommandInterpreter()17        self.assertTrue(command_interpreter, VALID_COMMAND_INTERPRETER)18        result = lldb.SBCommandReturnObject()19 20        abbrevs = [21            ("br s", "breakpoint set"),22            ("disp", "_regexp-display"),  # a.k.a., 'display'23            ("di", "disassemble"),24            ("dis", "disassemble"),25            ("ta st a", "target stop-hook add"),26            ("fr v", "frame variable"),27            ("f 1", "frame select 1"),28            ("ta st li", "target stop-hook list"),29        ]30 31        for short_val, long_val in abbrevs:32            command_interpreter.ResolveCommand(short_val, result)33            self.assertTrue(result.Succeeded())34            self.assertEqual(long_val, result.GetOutput())35