[llvm-commits] [llvm] r125175 - /llvm/trunk/utils/lit/lit/LitConfig.py

NAKAMURA Takumi geek4civic at gmail.com
Tue Feb 8 20:19:15 PST 2011


Author: chapuni
Date: Tue Feb  8 22:19:15 2011
New Revision: 125175

URL: http://llvm.org/viewvc/llvm-project?rev=125175&view=rev
Log:
lit/LitConfig.py: Add the new method getToolsPath(dir,paths,tools).

It seeks tools(eg. [cmp, grep, sed]) in same directory, to be sane.

It seeks "bash" only in the directory found at last time. Or bash would be insane (against other tools).

Modified:
    llvm/trunk/utils/lit/lit/LitConfig.py

Modified: llvm/trunk/utils/lit/lit/LitConfig.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/LitConfig.py?rev=125175&r1=125174&r2=125175&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/LitConfig.py (original)
+++ llvm/trunk/utils/lit/lit/LitConfig.py Tue Feb  8 22:19:15 2011
@@ -85,6 +85,22 @@
 
         return self.bashPath
 
+    def getToolsPath(self, dir, paths, tools):
+        import os, Util
+        if dir is not None and os.path.isabs(dir) and os.path.isdir(dir):
+            if not Util.checkToolsPath(dir, tools):
+                return None
+        else:
+            dir = Util.whichTools(tools, paths)
+
+        # bash
+        self.bashPath = Util.which('bash', dir)
+        if self.bashPath is None:
+            self.warning("Unable to find 'bash.exe'.")
+            self.bashPath = ''
+
+        return dir
+
     def _write_message(self, kind, message):
         import inspect, os, sys
 





More information about the llvm-commits mailing list