Files
clang-p2996/lldb/test/command_source/TestCommandSource.py
Johnny Chen 7dc2e4784e We can do better when reporting the status of one-liner script execution.
Change the prototype of ScriptInterpreter::ExecuteOneLine() to return bool
instead of void and take one additional parameter as CommandReturnObject *.

Propagate the status of one-liner execution back appropriately.

llvm-svn: 109899
2010-07-30 22:33:14 +00:00

34 lines
874 B
Python

"""
Test that lldb command "command source" works correctly.
"""
import os, time
import unittest
import lldb
import lldbtest
class TestCommandSource(lldbtest.TestBase):
mydir = "command_source"
def test_command_source(self):
"""Test that lldb command "command source" works correctly."""
res = self.res
# Sourcing .lldb in the current working directory, which in turn imports
# the "my" package that defines the date() function.
self.ci.HandleCommand("command source .lldb", res)
self.assertTrue(res.Succeeded())
self.ci.HandleCommand("script my.date()", res)
if (not res.Succeeded()):
print res.GetError()
self.assertTrue(res.Succeeded())
time.sleep(1)
if __name__ == '__main__':
lldb.SBDebugger.Initialize()
unittest.main()
lldb.SBDebugger.Terminate()