blob: fc962021d7373599a8fcccd4d869c01f14b8b3c3 [file] [log] [blame]
Chandler Carruthf9dd7ed2015-02-14 07:11:25 +00001#!/usr/bin/env python
Daniel Dunbara19db352010-08-02 00:39:42 +00002
3import os
4import sys
5
6# Variables configured at build time.
7llvm_source_root = "@LLVM_SOURCE_DIR@"
8llvm_obj_root = "@LLVM_BINARY_DIR@"
9
10# Make sure we can find the lit package.
Daniel Dunbar58cfaf82012-04-19 16:31:08 +000011sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit'))
Daniel Dunbara19db352010-08-02 00:39:42 +000012
13# Set up some builtin parameters, so that by default the LLVM test suite
14# configuration file knows how to find the object tree.
15builtin_parameters = {
NAKAMURA Takumi3342a8b2013-12-30 07:02:12 +000016 'build_mode' : "@BUILD_MODE@",
Reid Kleckner341a1422013-12-17 00:55:31 +000017 'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg'),
Reid Kleckner8dcf9852013-12-17 00:33:36 +000018 'llvm_unit_site_config' : os.path.join(llvm_obj_root, 'test', 'Unit',
19 'lit.site.cfg')
Daniel Dunbara19db352010-08-02 00:39:42 +000020 }
21
David Blaikief1a9a562012-09-04 22:09:04 +000022clang_obj_root = os.path.join(llvm_obj_root, 'tools', 'clang')
23
24if os.path.exists(clang_obj_root):
25 builtin_parameters['clang_site_config'] = \
26 os.path.join(clang_obj_root, 'test', 'lit.site.cfg')
27 clang_tools_extra_obj_root = os.path.join(clang_obj_root, 'tools', 'extra')
28 if os.path.exists(clang_tools_extra_obj_root):
29 builtin_parameters['clang_tools_extra_site_config'] = \
30 os.path.join(clang_tools_extra_obj_root, 'test', 'lit.site.cfg')
NAKAMURA Takumibf0b3ae2011-02-09 04:17:54 +000031
Tim Northoveraeacbb12014-07-07 15:26:53 +000032lld_obj_root = os.path.join(llvm_obj_root, 'tools', 'lld')
Joey Goulyad07d082014-01-14 22:52:24 +000033if os.path.exists(lld_obj_root):
34 builtin_parameters['lld_site_config'] = \
35 os.path.join(lld_obj_root, 'test', 'lit.site.cfg')
36
Duncan P. N. Exon Smithacb367b2014-03-31 23:14:10 +000037compilerrt_obj_root = os.path.join(llvm_obj_root, 'projects', 'compiler-rt')
38if os.path.exists(compilerrt_obj_root):
39 builtin_parameters['compilerrt_site_basedir'] = \
40 os.path.join(compilerrt_obj_root, 'test')
41
Daniel Dunbara19db352010-08-02 00:39:42 +000042if __name__=='__main__':
43 import lit
44 lit.main(builtin_parameters)