Chandler Carruth | c9864d8 | 2015-02-14 07:11:25 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
George Karpenkov | 4b787d7 | 2019-01-14 20:02:11 +0000 | [diff] [blame] | 2 | # -*- coding: utf-8 -*- |
Daniel Dunbar | b7698a4 | 2010-08-02 00:39:42 +0000 | [diff] [blame] | 3 | |
| 4 | import os |
| 5 | import sys |
| 6 | |
Zachary Turner | a0f1ea3 | 2017-09-15 22:10:46 +0000 | [diff] [blame] | 7 | config_map = {} |
| 8 | |
| 9 | def map_config(source_dir, site_config): |
| 10 | global config_map |
Zachary Turner | 36409f3 | 2017-09-18 23:36:35 +0000 | [diff] [blame] | 11 | source_dir = os.path.realpath(source_dir) |
Zachary Turner | 215eafd | 2017-09-21 21:27:11 +0000 | [diff] [blame] | 12 | source_dir = os.path.normcase(source_dir) |
Zachary Turner | a0f1ea3 | 2017-09-15 22:10:46 +0000 | [diff] [blame] | 13 | site_config = os.path.normpath(site_config) |
| 14 | config_map[source_dir] = site_config |
| 15 | |
Daniel Dunbar | b7698a4 | 2010-08-02 00:39:42 +0000 | [diff] [blame] | 16 | # Variables configured at build time. |
| 17 | llvm_source_root = "@LLVM_SOURCE_DIR@" |
| 18 | llvm_obj_root = "@LLVM_BINARY_DIR@" |
| 19 | |
| 20 | # Make sure we can find the lit package. |
Daniel Dunbar | 90275ea | 2012-04-19 16:31:08 +0000 | [diff] [blame] | 21 | sys.path.insert(0, os.path.join(llvm_source_root, 'utils', 'lit')) |
Daniel Dunbar | b7698a4 | 2010-08-02 00:39:42 +0000 | [diff] [blame] | 22 | |
| 23 | # Set up some builtin parameters, so that by default the LLVM test suite |
| 24 | # configuration file knows how to find the object tree. |
Zachary Turner | a0f1ea3 | 2017-09-15 22:10:46 +0000 | [diff] [blame] | 25 | builtin_parameters = { 'build_mode' : "@BUILD_MODE@" } |
Daniel Dunbar | b7698a4 | 2010-08-02 00:39:42 +0000 | [diff] [blame] | 26 | |
Zachary Turner | a0f1ea3 | 2017-09-15 22:10:46 +0000 | [diff] [blame] | 27 | @LLVM_LIT_CONFIG_MAP@ |
David Blaikie | 7a9572f | 2012-09-04 22:09:04 +0000 | [diff] [blame] | 28 | |
Zachary Turner | a0f1ea3 | 2017-09-15 22:10:46 +0000 | [diff] [blame] | 29 | builtin_parameters['config_map'] = config_map |
Shoaib Meenai | 54d0430 | 2017-01-17 07:10:55 +0000 | [diff] [blame] | 30 | |
Daniel Dunbar | b7698a4 | 2010-08-02 00:39:42 +0000 | [diff] [blame] | 31 | if __name__=='__main__': |
NAKAMURA Takumi | cf0683e | 2016-10-10 23:02:42 +0000 | [diff] [blame] | 32 | from lit.main import main |
| 33 | main(builtin_parameters) |