summaryrefslogtreecommitdiffstats
path: root/lldb/test/command_source/TestCommandSource.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-07-29 21:42:28 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-07-29 21:42:28 +0000
commitb9e7c0aef62310f686f56756ec54a3c1e3dd9c5c (patch)
treef8332375c8acae2fed3b1c68b8f3e8f5c570c311 /lldb/test/command_source/TestCommandSource.py
parent60fbd7744fea5a0207efc5a872ec04decabf057e (diff)
downloadbcm5719-llvm-b9e7c0aef62310f686f56756ec54a3c1e3dd9c5c.tar.gz
bcm5719-llvm-b9e7c0aef62310f686f56756ec54a3c1e3dd9c5c.zip
Add a test case to test that lldb command "command source" works correctly.
llvm-svn: 109806
Diffstat (limited to 'lldb/test/command_source/TestCommandSource.py')
-rw-r--r--lldb/test/command_source/TestCommandSource.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/test/command_source/TestCommandSource.py b/lldb/test/command_source/TestCommandSource.py
new file mode 100644
index 00000000000..979f95c1ea6
--- /dev/null
+++ b/lldb/test/command_source/TestCommandSource.py
@@ -0,0 +1,31 @@
+"""
+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)
+ self.assertTrue(res.Succeeded())
+
+ time.sleep(1)
+
+if __name__ == '__main__':
+ lldb.SBDebugger.Initialize()
+ unittest.main()
+ lldb.SBDebugger.Terminate()
OpenPOWER on IntegriCloud