[Lldb-commits] [lldb] r155463 - in /lldb/branches/lldb-platform-work/test: lldbtest.py macosx/universal/TestUniversal.py

Johnny Chen johnny.chen at apple.com
Tue Apr 24 11:27:18 PDT 2012


Author: johnny
Date: Tue Apr 24 13:27:18 2012
New Revision: 155463

URL: http://llvm.org/viewvc/llvm-project?rev=155463&view=rev
Log:
Decorator for the "file target" command did not take into consideration of possible options in between "file" and "target".
Fix that and make the options follow the "file" command in TestUniversal.

Modified:
    lldb/branches/lldb-platform-work/test/lldbtest.py
    lldb/branches/lldb-platform-work/test/macosx/universal/TestUniversal.py

Modified: lldb/branches/lldb-platform-work/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lldbtest.py?rev=155463&r1=155462&r2=155463&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lldbtest.py (original)
+++ lldb/branches/lldb-platform-work/test/lldbtest.py Tue Apr 24 13:27:18 2012
@@ -1163,10 +1163,18 @@
             cmd = cmd.replace("target create ", "file ")
         if cmd.startswith("file ") and lldb.lldbtest_remote_sandbox:
             with recording(self, trace) as sbuf:
-                target = cmd.split("file ")[1]
-                target = os.path.abspath(target)
-                print >> sbuf, "Found a file command, target (with absolute pathname)=%s" % target
-                fpath, fname = os.path.split(target)
+                the_rest = cmd.split("file ")[1]
+                # Split the rest of the command line.
+                atoms = the_rest.split()
+                #
+                # NOTE: This assumes that the options, if any, follow the file command,
+                # instead of follow the specified target.
+                #
+                target = atoms[-1]
+                # Now let's get the absolute pathname of our target.
+                abs_target = os.path.abspath(target)
+                print >> sbuf, "Found a file command, target (with absolute pathname)=%s" % abs_target
+                fpath, fname = os.path.split(abs_target)
                 parent_dir = os.path.split(fpath)[0]
                 platform_target_install_command = 'platform target-install %s %s' % (fpath, lldb.lldbtest_remote_sandbox)
                 print >> sbuf, "Insert this command to be run first: %s" % platform_target_install_command
@@ -1177,8 +1185,8 @@
                 # Populate the remote executable pathname into the lldb namespace,
                 # so that test cases can grab this thing out of the namespace.
                 #
-                lldb.lldbtest_remote_sandboxed_executable = target.replace(parent_dir, lldb.lldbtest_remote_sandbox)
-                cmd = "file -P %s %s" % (lldb.lldbtest_remote_sandboxed_executable, target)
+                lldb.lldbtest_remote_sandboxed_executable = abs_target.replace(parent_dir, lldb.lldbtest_remote_sandbox)
+                cmd = "file -P %s %s %s" % (lldb.lldbtest_remote_sandboxed_executable, the_rest.replace(target, ''), abs_target)
                 print >> sbuf, "And this is the replaced file command: %s" % cmd
 
         running = (cmd.startswith("run") or cmd.startswith("process launch"))

Modified: lldb/branches/lldb-platform-work/test/macosx/universal/TestUniversal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/macosx/universal/TestUniversal.py?rev=155463&r1=155462&r2=155463&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/macosx/universal/TestUniversal.py (original)
+++ lldb/branches/lldb-platform-work/test/macosx/universal/TestUniversal.py Tue Apr 24 13:27:18 2012
@@ -76,7 +76,7 @@
         self.runCmd("continue")
 
         # Now specify i386 as the architecture for "testit".
-        self.expect("file " + exe + " -a i386", CURRENT_EXECUTABLE_SET,
+        self.expect("file -a i386 " + exe, CURRENT_EXECUTABLE_SET,
             startstr = "Current executable set to ",
             substrs = ["testit' (i386)."])
 





More information about the lldb-commits mailing list