Home | History | Annotate | Download | only in Unit
      1 @LIT_SITE_CFG_IN_HEADER@
      2 
      3 import os
      4 
      5 # Load common config for all compiler-rt unit tests.
      6 lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
      7 
      8 def push_ld_library_path(config, new_path):
      9   new_ld_library_path = os.path.pathsep.join(
     10     (new_path, config.environment.get('LD_LIBRARY_PATH', '')))
     11   config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
     12 
     13 # Setup config name.
     14 config.name = 'AddressSanitizer-Unit'
     15 
     16 # Setup test source and exec root. For unit tests, we define
     17 # it as build directory with ASan unit tests.
     18 # FIXME: De-hardcode this path.
     19 if @ASAN_TEST_DYNAMIC@:
     20   test_dir = "dynamic"
     21 else:
     22   test_dir = "default"
     23 config.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
     24                                      "lib", "asan", "tests", test_dir)
     25 
     26 config.test_source_root = config.test_exec_root
     27 
     28 # Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
     29 push_ld_library_path(config, config.compiler_rt_libdir)
     30