brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 6ffa36e Raw
43 lines · plain
1set(GWP_ASAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})2set(GWP_ASAN_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})3 4set(GWP_ASAN_TESTSUITES)5 6set(GWP_ASAN_UNITTEST_DEPS)7set(GWP_ASAN_TEST_DEPS8  ${SANITIZER_COMMON_LIT_TEST_DEPS}9  gwp_asan10  scudo_standalone)11 12# Longstanding issues in the Android test runner means that compiler-rt unit13# tests don't work on Android due to libc++ link-time issues. Looks like the14# exported libc++ from the Android NDK is x86-64, even though it's part of the15# ARM[64] toolchain... See similar measures for ASan and sanitizer-common that16# disable unit tests for Android.17if (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.in21    ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg.py)22  list(APPEND GWP_ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit)23endif()24 25if (COMPILER_RT_HAS_SCUDO_STANDALONE)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)32 33    configure_lit_site_cfg(34      ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in35      ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)36    list(APPEND GWP_ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})37  endforeach()38 39  add_lit_testsuite(check-gwp_asan "Running the GWP-ASan tests"40    ${GWP_ASAN_TESTSUITES}41    DEPENDS ${GWP_ASAN_TEST_DEPS})42endif()43