[Lldb-commits] [PATCH] fix TestTargetAPI.py remote targets

Vince Harron vharron at google.com
Wed Jan 28 17:33:17 PST 2015


Hi clayborg,

In tests where stdio is redirected to a file, the file must be copied
back from the remote host for analysis by the test.

http://reviews.llvm.org/D7239

Files:
  test/python_api/target/TestTargetAPI.py

Index: test/python_api/target/TestTargetAPI.py
===================================================================
--- test/python_api/target/TestTargetAPI.py
+++ test/python_api/target/TestTargetAPI.py
@@ -373,10 +373,18 @@
 
         # Now launch the process, do not stop at entry point, and redirect stdout to "stdout.txt" file.
         # The inferior should run to completion after "process.Continue()" call.
+        local_path = "stdout.txt";
+        if lldb.remote_platform:
+            stdout_path = os.path.join(lldb.remote_platform.GetWorkingDirectory(), "lldb-stdout-redirect.txt")
+        else:
+            stdout_path = local_path
         error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, None, "stdout.txt", None, None, 0, False, error)
+        process = target.Launch (self.dbg.GetListener(), None, None, None, stdout_path, None, None, 0, False, error)
         process.Continue()
         #self.runCmd("process status")
+        if lldb.remote_platform:
+            # copy output file to host
+            lldb.remote_platform.Get(lldb.SBFileSpec(stdout_path), lldb.SBFileSpec(local_path))
 
         # The 'stdout.txt' file should now exist.
         self.assertTrue(os.path.isfile("stdout.txt"),

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7239.18933.patch
Type: text/x-patch
Size: 1265 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150129/80c090bb/attachment.bin>


More information about the lldb-commits mailing list