1 set(GWP_ASAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
2 set(GWP_ASAN_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
4 set(GWP_ASAN_TESTSUITES)
6 set(GWP_ASAN_UNITTEST_DEPS)
8 ${SANITIZER_COMMON_LIT_TEST_DEPS}
12 # Longstanding issues in the Android test runner means that compiler-rt unit
13 # tests don't work on Android due to libc++ link-time issues. Looks like the
14 # exported libc++ from the Android NDK is x86-64, even though it's part of the
15 # ARM[64] toolchain... See similar measures for ASan and sanitizer-common that
16 # disable unit tests for Android.
17 if (COMPILER_RT_INCLUDE_TESTS AND COMPILER_RT_HAS_GWP_ASAN AND NOT ANDROID)
18 list(APPEND GWP_ASAN_TEST_DEPS GwpAsanUnitTests)
19 configure_lit_site_cfg(
20 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.py.in
21 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg.py)
22 list(APPEND GWP_ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit)
25 if (COMPILER_RT_INCLUDE_TESTS AND COMPILER_RT_HAS_SCUDO_STANDALONE AND COMPILER_RT_HAS_GWP_ASAN)
26 foreach(arch ${GWP_ASAN_SUPPORTED_ARCH})
27 set(GWP_ASAN_TEST_TARGET_ARCH ${arch})
28 string(TOLOWER "-${arch}" GWP_ASAN_TEST_CONFIG_SUFFIX)
29 get_test_cc_for_arch(${arch} GWP_ASAN_TEST_TARGET_CC GWP_ASAN_TEST_TARGET_CFLAGS)
30 string(TOUPPER ${arch} ARCH_UPPER_CASE)
31 set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
33 configure_lit_site_cfg(
34 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
35 ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
36 list(APPEND GWP_ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
40 add_lit_testsuite(check-gwp_asan "Running the GWP-ASan tests"
41 ${GWP_ASAN_TESTSUITES}
42 DEPENDS ${GWP_ASAN_TEST_DEPS})
43 set_target_properties(check-gwp_asan PROPERTIES FOLDER "Compiler-RT Misc")