1 configure_lit_site_cfg( 2 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in 3 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg 4 ) 5 6 configure_lit_site_cfg( 7 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in 8 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg 9 ) 10 11 if(COMPILER_RT_CAN_EXECUTE_TESTS) 12 # Run TSan output tests only if we're sure we can produce working binaries. 13 set(TSAN_TEST_DEPS 14 ${SANITIZER_COMMON_LIT_TEST_DEPS} 15 ${TSAN_RUNTIME_LIBRARIES}) 16 set(TSAN_TEST_PARAMS 17 tsan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg 18 ) 19 if(LLVM_INCLUDE_TESTS) 20 list(APPEND TSAN_TEST_DEPS TsanUnitTests) 21 endif() 22 add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" 23 ${CMAKE_CURRENT_BINARY_DIR} 24 PARAMS ${TSAN_TEST_PARAMS} 25 DEPENDS ${TSAN_TEST_DEPS} 26 ) 27 set_target_properties(check-tsan PROPERTIES FOLDER "TSan unittests") 28 elseif(LLVM_INCLUDE_TESTS) 29 # Otherwise run only TSan unit tests (they are linked using the 30 # host compiler). 31 add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" 32 ${CMAKE_CURRENT_BINARY_DIR}/Unit 33 DEPENDS TsanUnitTests llvm-symbolizer) 34 set_target_properties(check-tsan PROPERTIES FOLDER "TSan unittests") 35 endif() 36