2 Test the command history mechanism
5 from __future__ import print_function
10 from lldbsuite.test.decorators import *
11 from lldbsuite.test.lldbtest import *
12 from lldbsuite.test import lldbutil
15 class TestFormats(TestBase):
17 mydir = TestBase.compute_mydir(__file__)
20 hostoslist=["windows"],
21 bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
22 def test_formats(self):
23 """Test format string functionality."""
27 child = pexpect.spawn(
28 '%s %s -x -o "b main" -o r a.out' %
29 (lldbtest_config.lldbExec, self.lldbOption))
30 # Turn on logging for what the child sends back.
32 child.logfile_read = sys.stdout
33 # So that the spawned lldb session gets shutdown durng teardown.
36 # Substitute 'Help!' for 'help' using the 'commands regex' mechanism.
37 child.expect_exact(prompt + 'target create "a.out"')
38 child.expect_exact(prompt + 'b main')
39 child.expect_exact(prompt + 'r')
40 child.expect_exact(prompt)
42 # child.expect_exact(prompt + "target create")
44 # child.sendline("command regex 'Help__'")
45 # child.expect_exact(regex_prompt)
46 # child.sendline('s/^$/help/')
47 # child.expect_exact(regex_prompt1)
49 # child.expect_exact(prompt)
51 # child.sendline('Help__')
52 # # If we see the familiar 'help' output, the test is done.
53 # child.expect('Debugger commands:')
54 # # Try and incorrectly remove "Help__" using "command unalias" and verify we fail
55 # child.sendline('command unalias Help__')
56 # child.expect_exact("error: 'Help__' is not an alias, it is a debugger command which can be removed using the 'command delete' command")
57 # child.expect_exact(prompt)
59 # # Delete the regex command using "command delete"
60 # child.sendline('command delete Help__')
61 # child.expect_exact(prompt)
62 # # Verify the command was removed
63 # child.sendline('Help__')
64 # child.expect_exact("error: 'Help__' is not a valid command")
65 # child.expect_exact(prompt)