test/lit.cfg: Seek sane tools(and bash) in directories and set to $PATH.

LitConfig.getBashPath() will not seek in $PATH after LitConfig.getToolsPath() was executed.

llvm-svn: 125176
This commit is contained in:
NAKAMURA Takumi 2011-02-09 04:19:21 +00:00
parent edfec9d04b
commit 0627147d12
1 changed files with 13 additions and 1 deletions

View File

@ -19,6 +19,18 @@ config.suffixes = []
# test_source_root: The root path where tests are located. # test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__) config.test_source_root = os.path.dirname(__file__)
# Tweak PATH for Win32
if sys.platform in ['win32']:
# Seek sane tools in directories and set to $PATH.
path = getattr(config, 'lit_tools_dir', None)
path = lit.getToolsPath(path,
config.environment['PATH'],
['cmp.exe', 'grep.exe', 'sed.exe'])
if path is not None:
path = os.path.pathsep.join((path,
config.environment['PATH']))
config.environment['PATH'] = path
# test_exec_root: The root path where tests should be run. # test_exec_root: The root path where tests should be run.
llvm_obj_root = getattr(config, 'llvm_obj_root', None) llvm_obj_root = getattr(config, 'llvm_obj_root', None)
if llvm_obj_root is not None: if llvm_obj_root is not None:
@ -273,7 +285,7 @@ config.on_clone = on_clone
### Features ### Features
# Shell execution # Shell execution
if sys.platform not in ['win32']: if sys.platform not in ['win32'] or lit.getBashPath() != '':
config.available_features.add('shell') config.available_features.add('shell')
# Loadable module # Loadable module