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 clang clang-headers FileCheck count not llvm-symbolizer 15 ${TSAN_RUNTIME_LIBRARIES} 16 ) 17 set(TSAN_TEST_PARAMS 18 tsan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg 19 ) 20 if(LLVM_INCLUDE_TESTS) 21 list(APPEND TSAN_TEST_DEPS TsanUnitTests) 22 endif() 23 add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" 24 ${CMAKE_CURRENT_BINARY_DIR} 25 PARAMS ${TSAN_TEST_PARAMS} 26 DEPENDS ${TSAN_TEST_DEPS} 27 ) 28 set_target_properties(check-tsan PROPERTIES FOLDER "TSan unittests") 29 elseif(LLVM_INCLUDE_TESTS) 30 # Otherwise run only TSan unit tests (they are linked using the 31 # host compiler). 32 add_lit_testsuite(check-tsan "Running ThreadSanitizer tests" 33 ${CMAKE_CURRENT_BINARY_DIR}/Unit 34 DEPENDS TsanUnitTests llvm-symbolizer) 35 set_target_properties(check-tsan PROPERTIES FOLDER "TSan unittests") 36 endif() 37