[Lldb-commits] [lldb] r228217 - Get test/types tests passing on remote targets

Vince Harron vharron at google.com
Wed Feb 4 14:25:35 PST 2015


Author: vharron
Date: Wed Feb  4 16:25:34 2015
New Revision: 228217

URL: http://llvm.org/viewvc/llvm-project?rev=228217&view=rev
Log:
Get test/types tests passing on remote targets

redirecting output to a path that will work well on host or target.
copying file from output location to location on local host that
test will read from


Modified:
    lldb/trunk/source/Commands/CommandObjectPlatform.cpp
    lldb/trunk/test/types/AbstractBase.py

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=228217&r1=228216&r2=228217&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Wed Feb  4 16:25:34 2015
@@ -2281,19 +2281,16 @@ CommandObjectPlatform::CommandObjectPlat
     LoadSubCommand ("connect", CommandObjectSP (new CommandObjectPlatformConnect (interpreter)));
     LoadSubCommand ("disconnect", CommandObjectSP (new CommandObjectPlatformDisconnect (interpreter)));
     LoadSubCommand ("settings", CommandObjectSP (new CommandObjectPlatformSettings (interpreter)));
-#ifdef LLDB_CONFIGURATION_DEBUG
     LoadSubCommand ("mkdir", CommandObjectSP (new CommandObjectPlatformMkDir (interpreter)));
     LoadSubCommand ("file", CommandObjectSP (new CommandObjectPlatformFile (interpreter)));
     LoadSubCommand ("get-file", CommandObjectSP (new CommandObjectPlatformGetFile (interpreter)));
     LoadSubCommand ("get-size", CommandObjectSP (new CommandObjectPlatformGetSize (interpreter)));
     LoadSubCommand ("put-file", CommandObjectSP (new CommandObjectPlatformPutFile (interpreter)));
-#endif
     LoadSubCommand ("process", CommandObjectSP (new CommandObjectPlatformProcess (interpreter)));
     LoadSubCommand ("shell", CommandObjectSP (new CommandObjectPlatformShell (interpreter)));
     LoadSubCommand ("target-install", CommandObjectSP (new CommandObjectPlatformInstall (interpreter)));
 }
 
-
 //----------------------------------------------------------------------
 // Destructor
 //----------------------------------------------------------------------

Modified: lldb/trunk/test/types/AbstractBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=228217&r1=228216&r2=228217&view=diff
==============================================================================
--- lldb/trunk/test/types/AbstractBase.py (original)
+++ lldb/trunk/test/types/AbstractBase.py Wed Feb  4 16:25:34 2015
@@ -50,7 +50,7 @@ class GenericTester(TestBase):
     #         True: build dSYM file                                            #
     #         False: build DWARF map                                           #
     # bc -> blockCaptured (defaulted to False)                                 #
-    #         True: testing vars of various basic types from isnide a block    #
+    #         True: testing vars of various basic types from inside a block    #
     #         False: testing vars of various basic types from a function       #
     # qd -> quotedDisplay (defaulted to False)                                 #
     #         True: the output from 'frame var' or 'expr var' contains a pair  #
@@ -81,6 +81,19 @@ class GenericTester(TestBase):
         else:
             self.generic_type_tester(self.exe_name, atoms, blockCaptured=bc, quotedDisplay=qd)
 
+    def process_launch_o(self, localPath):
+        # process launch command output redirect always goes to host the process is running on
+        if lldb.remote_platform:
+            # process launch -o requires a path that is valid on the target
+            self.assertIsNotNone(lldb.remote_platform.GetWorkingDirectory())
+            remote_path = os.path.join(lldb.remote_platform.GetWorkingDirectory(), "lldb-stdout-redirect.txt")
+            self.runCmd('process launch -o {remote}'.format(remote=remote_path))
+            # copy remote_path to local host
+            self.runCmd('platform get-file {remote} "{local}"'.format(
+                remote=remote_path, local=self.golden_filename))
+        else:
+            self.runCmd('process launch -o "{local}"'.format(local=self.golden_filename))
+
     def generic_type_tester(self, exe_name, atoms, quotedDisplay=False, blockCaptured=False):
         """Test that variables with basic types are displayed correctly."""
 
@@ -88,7 +101,9 @@ class GenericTester(TestBase):
 
         # First, capture the golden output emitted by the oracle, i.e., the
         # series of printf statements.
-        self.runCmd('process launch -o "%s"'%(self.golden_filename))
+
+        self.process_launch_o(self.golden_filename)
+
         with open(self.golden_filename) as f:
             go = f.read()
 
@@ -169,7 +184,9 @@ class GenericTester(TestBase):
 
         # First, capture the golden output emitted by the oracle, i.e., the
         # series of printf statements.
-        self.runCmd('process launch -o "%s"'%(self.golden_filename))
+
+        self.process_launch_o(self.golden_filename)
+
         with open(self.golden_filename) as f:
             go = f.read()
 





More information about the lldb-commits mailing list