2016-04-16 15:03:45 +08:00
|
|
|
@LIT_SITE_CFG_IN_HEADER@
|
2012-08-07 16:59:15 +08:00
|
|
|
|
2014-04-01 21:16:30 +08:00
|
|
|
import os
|
|
|
|
|
2013-06-06 20:48:20 +08:00
|
|
|
# Load common config for all compiler-rt unit tests.
|
2014-02-14 19:00:07 +08:00
|
|
|
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
|
2012-08-07 16:59:15 +08:00
|
|
|
|
2014-04-01 21:16:30 +08:00
|
|
|
def push_ld_library_path(config, new_path):
|
|
|
|
new_ld_library_path = os.path.pathsep.join(
|
2015-01-14 10:23:27 +08:00
|
|
|
(new_path, config.environment.get('LD_LIBRARY_PATH', '')))
|
2014-04-01 21:16:30 +08:00
|
|
|
config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
|
|
|
|
|
2013-06-06 21:48:20 +08:00
|
|
|
# Setup config name.
|
|
|
|
config.name = 'AddressSanitizer-Unit'
|
2013-01-30 20:18:49 +08:00
|
|
|
|
2013-06-06 21:48:20 +08:00
|
|
|
# Setup test source and exec root. For unit tests, we define
|
|
|
|
# it as build directory with ASan unit tests.
|
2014-02-14 22:06:10 +08:00
|
|
|
# FIXME: De-hardcode this path.
|
2014-12-18 07:14:01 +08:00
|
|
|
if @ASAN_TEST_DYNAMIC@:
|
|
|
|
test_dir = "dynamic"
|
|
|
|
else:
|
|
|
|
test_dir = "default"
|
|
|
|
config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
|
|
|
|
"lib", "asan", "tests", test_dir)
|
|
|
|
|
2013-06-06 21:48:20 +08:00
|
|
|
config.test_source_root = config.test_exec_root
|
2013-09-08 21:23:29 +08:00
|
|
|
|
2014-04-01 21:16:30 +08:00
|
|
|
# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
|
|
|
|
push_ld_library_path(config, config.compiler_rt_libdir)
|
2017-01-20 08:25:01 +08:00
|
|
|
|
|
|
|
if config.host_os == 'Darwin':
|
|
|
|
config.parallelism_group = config.darwin_sanitizer_parallelism_group_func
|