blob: 70e496fde55f6546b35f176cc21f45de638019b4 [file] [log] [blame]
Johnny Chen9320d4a2010-06-25 23:15:47 +00001"""Test lldb help command."""
2
3import lldb
4import unittest
5
6class TestHelpCommand(unittest.TestCase):
7
8 def setUp(self):
9 self.debugger = lldb.SBDebugger.Create()
10 self.debugger.SetAsync(True)
11 self.ci = self.debugger.GetCommandInterpreter()
12 if not self.ci:
13 raise Exception('Could not get the command interpreter')
14
15 def tearDown(self):
16 pass
17
18 def test_simplehelp(self):
19 """A simple test of 'help' command and its output."""
20 res = lldb.SBCommandReturnObject()
Johnny Chen7e363f52010-06-28 20:55:57 +000021 self.ci.HandleCommand("help", res)
22 self.assertTrue(res.Succeeded())
23 self.assertTrue(res.GetOutput().startswith(
24 'The following is a list of built-in, permanent debugger commands'))
25 #print res.GetOutput()
26
27 def test_help_should_not_hang_emacsshell(self):
28 """'set term-width 0' should not hang the help command."""
29 res = lldb.SBCommandReturnObject()
30 self.ci.HandleCommand("set term-width 0", res)
31 self.assertTrue(res.Succeeded())
32 self.ci.HandleCommand("help", res)
Johnny Chen9320d4a2010-06-25 23:15:47 +000033 self.assertTrue(res.Succeeded())
34 self.assertTrue(res.GetOutput().startswith(
35 'The following is a list of built-in, permanent debugger commands'))
36 #print res.GetOutput()
37
38
39if __name__ == '__main__':
40 unittest.main()