2 Test that lldb command "command source" works correctly.
4 See also http://llvm.org/viewvc/llvm-project?view=rev&revision=109673.
7 from __future__ import print_function
13 from lldbsuite.test.lldbtest import *
15 class CommandSourceTestCase(TestBase):
17 mydir = TestBase.compute_mydir(__file__)
20 def test_command_source(self):
21 """Test that lldb command "command source" works correctly."""
23 # Sourcing .lldb in the current working directory, which in turn imports
24 # the "my" package that defines the date() function.
25 self.runCmd("command source .lldb")
27 # Python should evaluate "my.date()" successfully.
28 command_interpreter = self.dbg.GetCommandInterpreter()
29 self.assertTrue(command_interpreter, VALID_COMMAND_INTERPRETER)
30 result = lldb.SBCommandReturnObject()
31 command_interpreter.HandleCommand("script my.date()", result)
34 self.expect(result.GetOutput(), "script my.date() runs successfully",
36 substrs = [str(datetime.date.today())])