1 set(LSAN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) 2 set(LSAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..) 3 4 set(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 5 6 configure_lit_site_cfg( 7 ${CMAKE_CURRENT_SOURCE_DIR}/LsanConfig/lit.site.cfg.in 8 ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig/lit.site.cfg 9 ) 10 11 configure_lit_site_cfg( 12 ${CMAKE_CURRENT_SOURCE_DIR}/AsanConfig/lit.site.cfg.in 13 ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig/lit.site.cfg 14 ) 15 16 configure_lit_site_cfg( 17 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in 18 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg 19 ) 20 21 if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT APPLE AND NOT ANDROID) 22 set(LSAN_TEST_DEPS 23 ${SANITIZER_COMMON_LIT_TEST_DEPS} 24 ${LSAN_RUNTIME_LIBRARIES}) 25 foreach(arch ${LSAN_SUPPORTED_ARCH}) 26 list(APPEND LSAN_TEST_DEPS clang_rt.asan-${arch}) 27 endforeach() 28 if(LLVM_INCLUDE_TESTS) 29 list(APPEND LSAN_TEST_DEPS LsanUnitTests) 30 endif() 31 add_lit_testsuite(check-lsan "Running the LeakSanitizer tests" 32 ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig 33 ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig 34 ${CMAKE_CURRENT_BINARY_DIR}/Unit 35 DEPENDS ${LSAN_TEST_DEPS}) 36 set_target_properties(check-lsan PROPERTIES FOLDER "LSan tests") 37 endif() 38