[Lldb-commits] [lldb] r128575 - in /lldb/trunk: source/Commands/CommandObjectPlatform.cpp test/platform/TestPlatformCommand.py

Johnny Chen johnny.chen at apple.com
Wed Mar 30 14:19:59 PDT 2011


Author: johnny
Date: Wed Mar 30 16:19:59 2011
New Revision: 128575

URL: http://llvm.org/viewvc/llvm-project?rev=128575&view=rev
Log:
A a simple test file for some lldb 'platform' commands.
Add a missing result.SetStatus() stmt to the CommandObjectPlatformList::Execute() impl.

Added:
    lldb/trunk/test/platform/TestPlatformCommand.py
Modified:
    lldb/trunk/source/Commands/CommandObjectPlatform.cpp

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=128575&r1=128574&r2=128575&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Wed Mar 30 16:19:59 2011
@@ -206,6 +206,8 @@
             result.AppendError ("no platforms are available\n");
             result.SetStatus (eReturnStatusFailed);
         }
+        else
+            result.SetStatus (eReturnStatusSuccessFinishResult);
         return result.Succeeded();
     }
 };

Added: lldb/trunk/test/platform/TestPlatformCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/platform/TestPlatformCommand.py?rev=128575&view=auto
==============================================================================
--- lldb/trunk/test/platform/TestPlatformCommand.py (added)
+++ lldb/trunk/test/platform/TestPlatformCommand.py Wed Mar 30 16:19:59 2011
@@ -0,0 +1,34 @@
+"""
+Test some lldb platform commands.
+"""
+
+import os, time
+import unittest2
+import lldb
+from lldbtest import *
+
+class PlatformCommandTestCase(TestBase):
+
+    mydir = "platform"
+
+    def test_help_platform(self):
+        self.runCmd("help platform")
+
+    def test_list(self):
+        self.expect("platform list",
+            patterns = ['^Available platforms:'])
+
+    def test_process_list(self):
+        self.expect("platform process list",
+            substrs = ['PID', 'TRIPLE', 'NAME'])
+
+    def test_status(self):
+        self.expect("platform status",
+            substrs = ['Platform', 'Triple', 'OS Version', 'Kernel', 'Hostname'])
+
+
+if __name__ == '__main__':
+    import atexit
+    lldb.SBDebugger.Initialize()
+    atexit.register(lambda: lldb.SBDebugger.Terminate())
+    unittest2.main()





More information about the lldb-commits mailing list