[Lldb-commits] [lldb] r137544 - /lldb/trunk/test/macosx/universal/TestUniversal.py

Johnny Chen johnny.chen at apple.com
Fri Aug 12 17:55:56 PDT 2011


Author: johnny
Date: Fri Aug 12 19:55:56 2011
New Revision: 137544

URL: http://llvm.org/viewvc/llvm-project?rev=137544&view=rev
Log:
Add a simple test case to exercise the SBDebugger.CreateTargetWithFileAndTargetTriple() API.

Modified:
    lldb/trunk/test/macosx/universal/TestUniversal.py

Modified: lldb/trunk/test/macosx/universal/TestUniversal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/macosx/universal/TestUniversal.py?rev=137544&r1=137543&r2=137544&view=diff
==============================================================================
--- lldb/trunk/test/macosx/universal/TestUniversal.py (original)
+++ lldb/trunk/test/macosx/universal/TestUniversal.py Fri Aug 12 19:55:56 2011
@@ -15,6 +15,25 @@
         # Find the line number to break inside main().
         self.line = line_number('main.c', '// Set break point at this line.')
 
+    @python_api_test
+    @unittest2.skipUnless(sys.platform.startswith("darwin") and os.uname()[4] in ['i386', 'x86_64'],
+                          "requires Darwin & i386")
+    def test_sbdebugger_create_target_with_file_and_target_triple(self):
+        """Test the SBDebugger.CreateTargetWithFileAndTargetTriple() API."""
+        # Invoke the default build rule.
+        self.buildDefault()
+
+        # Note that "testit" is a universal binary.
+        exe = os.path.join(os.getcwd(), "testit")
+
+        # Create a target by the debugger.
+        target = self.dbg.CreateTargetWithFileAndTargetTriple(exe, "i386-apple-darwin")
+        self.assertTrue(target, VALID_TARGET)
+
+        # Now launch the process, and do not stop at entry point.
+        process = target.LaunchSimple(None, None, os.getcwd())
+        self.assertTrue(process, PROCESS_IS_VALID)
+
     # rdar://problem/8972204 AddressByteSize of 32-bit process should be 4, got 8 instead.
     @unittest2.skipUnless(sys.platform.startswith("darwin") and os.uname()[4] in ['i386', 'x86_64'],
                           "requires Darwin & i386")





More information about the lldb-commits mailing list