summaryrefslogtreecommitdiffstats
path: root/utils/lit/LitConfig.py
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-10-23 14:19:52 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-10-23 14:19:52 +0000
commit9643cca39fb9fb3b49a8912926de98acf882283c (patch)
tree22cc59e4b240d84c3a5a60531119c4eca914a256 /utils/lit/LitConfig.py
parent1adacceba9c9ee0f16e54388e56c9a249b296f75 (diff)
downloadFreeBSD-src-9643cca39fb9fb3b49a8912926de98acf882283c.zip
FreeBSD-src-9643cca39fb9fb3b49a8912926de98acf882283c.tar.gz
Update LLVM to r84949.
Diffstat (limited to 'utils/lit/LitConfig.py')
-rw-r--r--utils/lit/LitConfig.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/lit/LitConfig.py b/utils/lit/LitConfig.py
index 4fb0ccc..c334109 100644
--- a/utils/lit/LitConfig.py
+++ b/utils/lit/LitConfig.py
@@ -29,6 +29,7 @@ class LitConfig:
self.noExecute = noExecute
self.debug = debug
self.isWindows = bool(isWindows)
+ self.bashPath = None
self.numErrors = 0
self.numWarnings = 0
@@ -41,6 +42,27 @@ class LitConfig:
mustExist = True,
config = config)
+ def getBashPath(self):
+ """getBashPath - Get the path to 'bash'"""
+ import os, Util
+
+ if self.bashPath is not None:
+ return self.bashPath
+
+ self.bashPath = Util.which('bash', os.pathsep.join(self.path))
+ if self.bashPath is None:
+ # Check some known paths.
+ for path in ('/bin/bash', '/usr/bin/bash'):
+ if os.path.exists(path):
+ self.bashPath = path
+ break
+
+ if self.bashPath is None:
+ self.warning("Unable to find 'bash', running Tcl tests internally.")
+ self.bashPath = ''
+
+ return self.bashPath
+
def _write_message(self, kind, message):
import inspect, os, sys
OpenPOWER on IntegriCloud