xref: /aosp_15_r20/external/compiler-rt/test/asan/Unit/lit.site.cfg.in (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot@LIT_SITE_CFG_IN_HEADER@
2*7c3d14c8STreehugger Robot
3*7c3d14c8STreehugger Robotimport os
4*7c3d14c8STreehugger Robot
5*7c3d14c8STreehugger Robot# Load common config for all compiler-rt unit tests.
6*7c3d14c8STreehugger Robotlit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
7*7c3d14c8STreehugger Robot
8*7c3d14c8STreehugger Robotdef push_ld_library_path(config, new_path):
9*7c3d14c8STreehugger Robot  new_ld_library_path = os.path.pathsep.join(
10*7c3d14c8STreehugger Robot    (new_path, config.environment.get('LD_LIBRARY_PATH', '')))
11*7c3d14c8STreehugger Robot  config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
12*7c3d14c8STreehugger Robot
13*7c3d14c8STreehugger Robot# Setup config name.
14*7c3d14c8STreehugger Robotconfig.name = 'AddressSanitizer-Unit'
15*7c3d14c8STreehugger Robot
16*7c3d14c8STreehugger Robot# Setup test source and exec root. For unit tests, we define
17*7c3d14c8STreehugger Robot# it as build directory with ASan unit tests.
18*7c3d14c8STreehugger Robot# FIXME: De-hardcode this path.
19*7c3d14c8STreehugger Robotif @ASAN_TEST_DYNAMIC@:
20*7c3d14c8STreehugger Robot  test_dir = "dynamic"
21*7c3d14c8STreehugger Robotelse:
22*7c3d14c8STreehugger Robot  test_dir = "default"
23*7c3d14c8STreehugger Robotconfig.test_exec_root = os.path.join("@COMPILER_RT_BINARY_DIR@",
24*7c3d14c8STreehugger Robot                                     "lib", "asan", "tests", test_dir)
25*7c3d14c8STreehugger Robot
26*7c3d14c8STreehugger Robotconfig.test_source_root = config.test_exec_root
27*7c3d14c8STreehugger Robot
28*7c3d14c8STreehugger Robot# Set LD_LIBRARY_PATH to pick dynamic runtime up properly.
29*7c3d14c8STreehugger Robotpush_ld_library_path(config, config.compiler_rt_libdir)
30