1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/utils/llvm-lit/llvm-lit.in
Shoaib Meenai dc18fb4440 [utils] Add libc++ and libc++abi config to llvm-lit
This allows us to use bin/llvm-lit to run individual libc++ and
libc++abi tests without having to explicitly specify the site config
paths, similar to other projects.

Differential Revision: https://reviews.llvm.org/D28733

llvm-svn: 292203
2017-01-17 07:10:55 +00:00

55 lines
2.1 KiB
Python
Executable File

#!/usr/bin/env python
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.
sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit'))
# Set up some builtin parameters, so that by default the LLVM test suite
# configuration file knows how to find the object tree.
builtin_parameters = {
'build_mode' : "@BUILD_MODE@",
'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg'),
'llvm_unit_site_config' : os.path.join(llvm_obj_root, 'test', 'Unit',
'lit.site.cfg')
}
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')
lld_obj_root = os.path.join(llvm_obj_root, 'tools', 'lld')
if os.path.exists(lld_obj_root):
builtin_parameters['lld_site_config'] = \
os.path.join(lld_obj_root, 'test', 'lit.site.cfg')
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')
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')
if __name__=='__main__':
from lit.main import main
main(builtin_parameters)