[Lldb-commits] [lldb] r124353 - in /lldb/trunk/test: lldbtest.py plugins/darwin.py

Johnny Chen johnny.chen at apple.com
Wed Jan 26 18:58:54 PST 2011


Author: johnny
Date: Wed Jan 26 20:58:54 2011
New Revision: 124353

URL: http://llvm.org/viewvc/llvm-project?rev=124353&view=rev
Log:
Some cleanup to plugins/darwin.py after the recent additions of '-A arch' and '-C compiler'
command line options to the test driver.  Replace TestBase.getRunSpec() with TestBase.getRunOptions().

Modified:
    lldb/trunk/test/lldbtest.py
    lldb/trunk/test/plugins/darwin.py

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=124353&r1=124352&r2=124353&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Wed Jan 26 20:58:54 2011
@@ -625,7 +625,7 @@
             print >> f, "Session info generated @", datetime.datetime.now().ctime()
             print >> f, self.session.getvalue()
             print >> f, "To rerun this test, issue the following command from the 'test' directory:\n"
-            print >> f, "%s ./dotest.py -v -t -f %s.%s" % (self.getRunSpec(),
+            print >> f, "./dotest.py %s -v -t -f %s.%s" % (self.getRunOptions(),
                                                            self.__class__.__name__,
                                                            self._testMethodName)
 
@@ -855,16 +855,27 @@
             # End of while loop.
 
 
+    def getArchitecture(self):
+        """Returns the architecture in effect the test suite is now running with."""
+        module = __import__(sys.platform)
+        return module.getArchitecture()
+
     def getCompiler(self):
         """Returns the compiler in effect the test suite is now running with."""
         module = __import__(sys.platform)
         return module.getCompiler()
 
-    def getRunSpec(self):
-        """Environment variable spec to run this test again, invoked from within
-        dumpSessionInfo()."""
+    def getRunOptions(self):
+        """Command line option for -A and -C to run this test again, called from
+        within dumpSessionInfo()."""
         module = __import__(sys.platform)
-        return module.getRunSpec()
+        arch = self.getArchitecture()
+        comp = self.getCompiler()
+        if not arch and not comp:
+            return ""
+        else:
+            return "%s %s" % ("-A "+arch if arch else "",
+                              "-C "+comp if comp else "")
 
     def buildDefault(self, architecture=None, compiler=None, dictionary=None):
         """Platform specific way to build the default binaries."""

Modified: lldb/trunk/test/plugins/darwin.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/plugins/darwin.py?rev=124353&r1=124352&r2=124353&view=diff
==============================================================================
--- lldb/trunk/test/plugins/darwin.py (original)
+++ lldb/trunk/test/plugins/darwin.py Wed Jan 26 20:58:54 2011
@@ -17,15 +17,14 @@
 
 #print "Hello, darwin plugin!"
 
+def getArchitecture():
+    """Returns the architecture in effect the test suite is now running with."""
+    return os.environ["ARCH"] if "ARCH" in os.environ else ""
+
 def getCompiler():
     """Returns the compiler in effect the test suite is now running with."""
     return os.environ["CC"] if "CC" in os.environ else ""
 
-def getRunSpec():
-    """Environment variable spec to run this test again, invoked from within
-    dumpSessionInfo()."""
-    return "%s%s" % (getArchSpec(None), getCCSpec(None))
-
 def getArchSpec(architecture):
     """
     Helper function to return the key-value string to specify the architecture





More information about the lldb-commits mailing list