1 #!/usr/bin/env python 2 3 import os 4 import sys 5 6 # Variables configured at build time. 7 llvm_source_root = "@LLVM_SOURCE_DIR@" 8 llvm_obj_root = "@LLVM_BINARY_DIR@" 9 10 # Make sure we can find the lit package. 11 sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit')) 12 13 # Set up some builtin parameters, so that by default the LLVM test suite 14 # configuration file knows how to find the object tree. 15 builtin_parameters = { 16 'build_mode' : "@CMAKE_CFG_INTDIR@", 17 'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg') 18 } 19 20 clang_obj_root = os.path.join(llvm_obj_root, 'tools', 'clang') 21 22 if os.path.exists(clang_obj_root): 23 builtin_parameters['clang_site_config'] = \ 24 os.path.join(clang_obj_root, 'test', 'lit.site.cfg') 25 clang_tools_extra_obj_root = os.path.join(clang_obj_root, 'tools', 'extra') 26 if os.path.exists(clang_tools_extra_obj_root): 27 builtin_parameters['clang_tools_extra_site_config'] = \ 28 os.path.join(clang_tools_extra_obj_root, 'test', 'lit.site.cfg') 29 30 if __name__=='__main__': 31 import lit 32 lit.main(builtin_parameters) 33