2015-02-14 08:11:25 +01:00
|
|
|
#!/usr/bin/env python
|
2010-08-02 02:39:42 +02:00
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
# Variables configured at build time.
|
|
|
|
llvm_source_root = "@LLVM_SOURCE_DIR@"
|
|
|
|
llvm_obj_root = "@LLVM_BINARY_DIR@"
|
|
|
|
|
|
|
|
# Make sure we can find the lit package.
|
2012-04-19 18:31:08 +02:00
|
|
|
sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit'))
|
2010-08-02 02:39:42 +02:00
|
|
|
|
|
|
|
# Set up some builtin parameters, so that by default the LLVM test suite
|
|
|
|
# configuration file knows how to find the object tree.
|
|
|
|
builtin_parameters = {
|
2013-12-30 08:02:12 +01:00
|
|
|
'build_mode' : "@BUILD_MODE@",
|
2013-12-17 01:55:31 +01:00
|
|
|
'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg'),
|
2013-12-17 01:33:36 +01:00
|
|
|
'llvm_unit_site_config' : os.path.join(llvm_obj_root, 'test', 'Unit',
|
|
|
|
'lit.site.cfg')
|
2010-08-02 02:39:42 +02:00
|
|
|
}
|
|
|
|
|
2012-09-05 00:09:04 +02:00
|
|
|
clang_obj_root = os.path.join(llvm_obj_root, 'tools', 'clang')
|
|
|
|
|
|
|
|
if os.path.exists(clang_obj_root):
|
|
|
|
builtin_parameters['clang_site_config'] = \
|
|
|
|
os.path.join(clang_obj_root, 'test', 'lit.site.cfg')
|
|
|
|
clang_tools_extra_obj_root = os.path.join(clang_obj_root, 'tools', 'extra')
|
|
|
|
if os.path.exists(clang_tools_extra_obj_root):
|
|
|
|
builtin_parameters['clang_tools_extra_site_config'] = \
|
|
|
|
os.path.join(clang_tools_extra_obj_root, 'test', 'lit.site.cfg')
|
2011-02-09 05:17:54 +01:00
|
|
|
|
2014-07-07 17:26:53 +02:00
|
|
|
lld_obj_root = os.path.join(llvm_obj_root, 'tools', 'lld')
|
2014-01-14 23:52:24 +01:00
|
|
|
if os.path.exists(lld_obj_root):
|
|
|
|
builtin_parameters['lld_site_config'] = \
|
|
|
|
os.path.join(lld_obj_root, 'test', 'lit.site.cfg')
|
|
|
|
|
2014-04-01 01:14:10 +02:00
|
|
|
compilerrt_obj_root = os.path.join(llvm_obj_root, 'projects', 'compiler-rt')
|
|
|
|
if os.path.exists(compilerrt_obj_root):
|
|
|
|
builtin_parameters['compilerrt_site_basedir'] = \
|
|
|
|
os.path.join(compilerrt_obj_root, 'test')
|
|
|
|
|
2017-01-17 08:10:55 +01:00
|
|
|
libcxx_obj_root = os.path.join(llvm_obj_root, 'projects', 'libcxx')
|
|
|
|
if os.path.exists(libcxx_obj_root):
|
|
|
|
builtin_parameters['libcxx_site_config'] = \
|
|
|
|
os.path.join(libcxx_obj_root, 'test', 'lit.site.cfg')
|
|
|
|
|
|
|
|
libcxxabi_obj_root = os.path.join(llvm_obj_root, 'projects', 'libcxxabi')
|
|
|
|
if os.path.exists(libcxxabi_obj_root):
|
|
|
|
builtin_parameters['libcxxabi_site_config'] = \
|
|
|
|
os.path.join(libcxxabi_obj_root, 'test', 'lit.site.cfg')
|
|
|
|
|
2010-08-02 02:39:42 +02:00
|
|
|
if __name__=='__main__':
|
2016-10-11 01:02:42 +02:00
|
|
|
from lit.main import main
|
|
|
|
main(builtin_parameters)
|