reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
@LIT_SITE_CFG_IN_HEADER@

import os
import platform

# Load common config for all compiler-rt unit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")

def push_ld_library_path(config, new_path):
  new_ld_library_path = os.path.pathsep.join(
    (new_path, config.environment.get('LD_LIBRARY_PATH', '')))
  config.environment['LD_LIBRARY_PATH'] = new_ld_library_path

  if platform.system() == 'FreeBSD':
    new_ld_32_library_path = os.path.pathsep.join(
      (new_path, config.environment.get('LD_32_LIBRARY_PATH', '')))
    config.environment['LD_32_LIBRARY_PATH'] = new_ld_32_library_path

# Setup config name.
config.name = 'AddressSanitizer-Unit'

# Setup test source and exec root. For unit tests, we define
# it as build directory with ASan unit tests.
# FIXME: De-hardcode this path.
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)

config.test_source_root = config.test_exec_root

# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
push_ld_library_path(config, config.compiler_rt_libdir)

if config.host_os == 'Darwin':
  config.parallelism_group = config.darwin_sanitizer_parallelism_group_func