summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-02-09 04:19:15 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-02-09 04:19:15 +0000
commitedfec9d04bfab69ab4a83b62cc00aaebb51e0e0c (patch)
tree74f9eff19fab8b3966aed99c230d865f936ce71c /llvm/utils/lit
parentb5c0b4667ecc61b58ef39a089b0fce428c6f71c4 (diff)
downloadbcm5719-llvm-edfec9d04bfab69ab4a83b62cc00aaebb51e0e0c.tar.gz
bcm5719-llvm-edfec9d04bfab69ab4a83b62cc00aaebb51e0e0c.zip
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). llvm-svn: 125175
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r--llvm/utils/lit/lit/LitConfig.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/utils/lit/lit/LitConfig.py b/llvm/utils/lit/lit/LitConfig.py
index 43ed6f1a1f7..7ca1b9c4c63 100644
--- a/llvm/utils/lit/lit/LitConfig.py
+++ b/llvm/utils/lit/lit/LitConfig.py
@@ -85,6 +85,22 @@ class LitConfig:
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
OpenPOWER on IntegriCloud