From d4b28fb7516c5a5ecded4154c207288da1949a6b Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 18 Jul 2024 18:33:24 -0700 Subject: [PATCH] [compiler-rt] Cleanup use of COMPILER_RT_INCLUDE_TESTS (#98246) 1. Move checks into parent test/CMakeLists.txt 2. COMPILER_RT_INCLUDE_TESTS disable both lit and gtests. Before it was very inconsistent between sanitizers. --- compiler-rt/cmake/base-config-ix.cmake | 4 +- compiler-rt/test/CMakeLists.txt | 2 +- compiler-rt/test/asan/CMakeLists.txt | 56 +++++++++---------- compiler-rt/test/ctx_profile/CMakeLists.txt | 20 +++---- compiler-rt/test/fuzzer/CMakeLists.txt | 18 +++--- compiler-rt/test/gwp_asan/CMakeLists.txt | 4 +- compiler-rt/test/interception/CMakeLists.txt | 2 +- compiler-rt/test/memprof/CMakeLists.txt | 20 +++---- compiler-rt/test/msan/CMakeLists.txt | 4 +- compiler-rt/test/nsan/CMakeLists.txt | 4 +- compiler-rt/test/rtsan/CMakeLists.txt | 22 ++++---- .../test/sanitizer_common/CMakeLists.txt | 16 +++--- .../test/scudo/standalone/CMakeLists.txt | 36 ++++++------ compiler-rt/test/tsan/CMakeLists.txt | 22 ++++---- 14 files changed, 104 insertions(+), 126 deletions(-) diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake index 80bbca1cbfce..5a97992756a9 100644 --- a/compiler-rt/cmake/base-config-ix.cmake +++ b/compiler-rt/cmake/base-config-ix.cmake @@ -43,7 +43,7 @@ if (LLVM_TREE_AVAILABLE) get_clang_resource_dir(COMPILER_RT_OUTPUT_DIR PREFIX ${LLVM_LIBRARY_OUTPUT_INTDIR}/..) set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) get_clang_resource_dir(COMPILER_RT_INSTALL_PATH) - option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt tests." ${LLVM_INCLUDE_TESTS}) option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" ${LLVM_ENABLE_WERROR}) @@ -70,7 +70,7 @@ else() "Path where built compiler-rt executables should be stored.") set(COMPILER_RT_INSTALL_PATH "" CACHE PATH "Prefix for directories where built compiler-rt artifacts should be installed.") - option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt tests." OFF) option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF) # Use a host compiler to compile/link tests. set(COMPILER_RT_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE PATH "Compiler to use for testing") diff --git a/compiler-rt/test/CMakeLists.txt b/compiler-rt/test/CMakeLists.txt index 83e443944c01..84a98f367474 100644 --- a/compiler-rt/test/CMakeLists.txt +++ b/compiler-rt/test/CMakeLists.txt @@ -48,7 +48,7 @@ umbrella_lit_testsuite_begin(check-compiler-rt) function(compiler_rt_test_runtime runtime) string(TOUPPER ${runtime} runtime_uppercase) - if(COMPILER_RT_HAS_${runtime_uppercase}) + if(COMPILER_RT_HAS_${runtime_uppercase} AND COMPILER_RT_INCLUDE_TESTS) if (${runtime} STREQUAL cfi AND NOT COMPILER_RT_HAS_UBSAN) # CFI tests require diagnostic mode, which is implemented in UBSan. elseif (${runtime} STREQUAL scudo_standalone) diff --git a/compiler-rt/test/asan/CMakeLists.txt b/compiler-rt/test/asan/CMakeLists.txt index 2d683e61d695..fb9e81bbe808 100644 --- a/compiler-rt/test/asan/CMakeLists.txt +++ b/compiler-rt/test/asan/CMakeLists.txt @@ -130,39 +130,37 @@ if(APPLE) endif() # Add unit tests. -if(COMPILER_RT_INCLUDE_TESTS) - foreach(arch ${ASAN_TEST_ARCH}) - string(TOUPPER ${arch} ARCH_UPPER_CASE) - set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) - set(CONFIG_NAME_DYNAMIC ${ARCH_UPPER_CASE}${OS_NAME}DynamicConfig) +foreach(arch ${ASAN_TEST_ARCH}) + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) + set(CONFIG_NAME_DYNAMIC ${ARCH_UPPER_CASE}${OS_NAME}DynamicConfig) - if(NOT MINGW) - # MinGW environments don't provide a statically linked CRT, so only the - # dynamic asan test configuration can be expected to work. - set(ASAN_TEST_DYNAMIC False) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}/lit.site.cfg.py) + if(NOT MINGW) + # MinGW environments don't provide a statically linked CRT, so only the + # dynamic asan test configuration can be expected to work. + set(ASAN_TEST_DYNAMIC False) + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}/lit.site.cfg.py) + endif() + if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) + set(ASAN_TEST_DYNAMIC True) + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME_DYNAMIC}/lit.site.cfg.py) + endif() + # FIXME: support unit test in the android test runner + if (NOT ANDROID) + if (NOT MINGW) + list(APPEND ASAN_TEST_DEPS AsanUnitTests) + list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}) endif() if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) - set(ASAN_TEST_DYNAMIC True) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME_DYNAMIC}/lit.site.cfg.py) + list(APPEND ASAN_DYNAMIC_TEST_DEPS AsanDynamicUnitTests) + list(APPEND ASAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME_DYNAMIC}) endif() - # FIXME: support unit test in the android test runner - if (NOT ANDROID) - if (NOT MINGW) - list(APPEND ASAN_TEST_DEPS AsanUnitTests) - list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}) - endif() - if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME) - list(APPEND ASAN_DYNAMIC_TEST_DEPS AsanDynamicUnitTests) - list(APPEND ASAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME_DYNAMIC}) - endif() - endif() - endforeach() -endif() + endif() +endforeach() if (SHADOW_MAPPING_UNRELIABLE) set(exclude_from_check_all.g "EXCLUDE_FROM_CHECK_ALL") diff --git a/compiler-rt/test/ctx_profile/CMakeLists.txt b/compiler-rt/test/ctx_profile/CMakeLists.txt index 371f1a2dcbb0..fc3b3f3ec431 100644 --- a/compiler-rt/test/ctx_profile/CMakeLists.txt +++ b/compiler-rt/test/ctx_profile/CMakeLists.txt @@ -25,17 +25,15 @@ foreach(arch ${CTX_PROFILE_SUPPORTED_ARCH}) endforeach() # Add unit tests. -if(COMPILER_RT_INCLUDE_TESTS) - foreach(arch ${CTX_PROFILE_SUPPORTED_ARCH}) - string(TOUPPER ${arch} ARCH_UPPER_CASE) - set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}/lit.site.cfg.py) - list(APPEND CTX_PROFILE_TEST_DEPS CtxProfileUnitTests) - list(APPEND CTX_PROFILE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}) - endforeach() -endif() +foreach(arch ${CTX_PROFILE_SUPPORTED_ARCH}) + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}/lit.site.cfg.py) + list(APPEND CTX_PROFILE_TEST_DEPS CtxProfileUnitTests) + list(APPEND CTX_PROFILE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}) +endforeach() add_lit_testsuite(check-ctx_profile "Running the Contextual Profiler tests" ${CTX_PROFILE_TESTSUITES} diff --git a/compiler-rt/test/fuzzer/CMakeLists.txt b/compiler-rt/test/fuzzer/CMakeLists.txt index 8d29a4bea5f3..b19f52e591fc 100644 --- a/compiler-rt/test/fuzzer/CMakeLists.txt +++ b/compiler-rt/test/fuzzer/CMakeLists.txt @@ -22,20 +22,16 @@ if (APPLE) darwin_filter_host_archs(FUZZER_SUPPORTED_ARCH FUZZER_TEST_ARCH) endif() -if(COMPILER_RT_INCLUDE_TESTS) - list(APPEND LIBFUZZER_TEST_DEPS FuzzerUnitTests) - list(APPEND LIBFUZZER_TEST_DEPS FuzzedDataProviderUnitTests) -endif() +list(APPEND LIBFUZZER_TEST_DEPS FuzzerUnitTests) +list(APPEND LIBFUZZER_TEST_DEPS FuzzedDataProviderUnitTests) set(LIBFUZZER_TESTSUITES) -if(COMPILER_RT_INCLUDE_TESTS) - # libFuzzer unit tests. - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg.py) - list(APPEND LIBFUZZER_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit) -endif() +# libFuzzer unit tests. +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg.py) +list(APPEND LIBFUZZER_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit) macro(test_fuzzer stdlib) cmake_parse_arguments(TEST "" "" "DEPS" ${ARGN}) diff --git a/compiler-rt/test/gwp_asan/CMakeLists.txt b/compiler-rt/test/gwp_asan/CMakeLists.txt index f9580e2592b2..6ffa36e7ebbd 100644 --- a/compiler-rt/test/gwp_asan/CMakeLists.txt +++ b/compiler-rt/test/gwp_asan/CMakeLists.txt @@ -14,7 +14,7 @@ set(GWP_ASAN_TEST_DEPS # exported libc++ from the Android NDK is x86-64, even though it's part of the # ARM[64] toolchain... See similar measures for ASan and sanitizer-common that # disable unit tests for Android. -if (COMPILER_RT_INCLUDE_TESTS AND NOT ANDROID) +if (NOT ANDROID) list(APPEND GWP_ASAN_TEST_DEPS GwpAsanUnitTests) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.py.in @@ -22,7 +22,7 @@ if (COMPILER_RT_INCLUDE_TESTS AND NOT ANDROID) list(APPEND GWP_ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit) endif() -if (COMPILER_RT_INCLUDE_TESTS AND COMPILER_RT_HAS_SCUDO_STANDALONE) +if (COMPILER_RT_HAS_SCUDO_STANDALONE) foreach(arch ${GWP_ASAN_SUPPORTED_ARCH}) set(GWP_ASAN_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}" GWP_ASAN_TEST_CONFIG_SUFFIX) diff --git a/compiler-rt/test/interception/CMakeLists.txt b/compiler-rt/test/interception/CMakeLists.txt index df69453c4fb4..8ed1a003c1b3 100644 --- a/compiler-rt/test/interception/CMakeLists.txt +++ b/compiler-rt/test/interception/CMakeLists.txt @@ -3,7 +3,7 @@ set(INTERCEPTION_TESTSUITES) # Unit tests. There are currently no unit tests capable to running on Apple or # Android targets. -if(COMPILER_RT_INCLUDE_TESTS AND NOT ANDROID AND NOT APPLE) +if(NOT ANDROID AND NOT APPLE) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) diff --git a/compiler-rt/test/memprof/CMakeLists.txt b/compiler-rt/test/memprof/CMakeLists.txt index 001245215201..4c50ae6b8371 100644 --- a/compiler-rt/test/memprof/CMakeLists.txt +++ b/compiler-rt/test/memprof/CMakeLists.txt @@ -44,17 +44,15 @@ foreach(arch ${MEMPROF_TEST_ARCH}) endforeach() # Add unit tests. -if(COMPILER_RT_INCLUDE_TESTS) - foreach(arch ${MEMPROF_TEST_ARCH}) - string(TOUPPER ${arch} ARCH_UPPER_CASE) - set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}/lit.site.cfg.py) - list(APPEND MEMPROF_TEST_DEPS MemProfUnitTests) - list(APPEND MEMPROF_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}) - endforeach() -endif() +foreach(arch ${MEMPROF_TEST_ARCH}) + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}/lit.site.cfg.py) + list(APPEND MEMPROF_TEST_DEPS MemProfUnitTests) + list(APPEND MEMPROF_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}) +endforeach() add_lit_testsuite(check-memprof "Running the MemProfiler tests" ${MEMPROF_TESTSUITES} diff --git a/compiler-rt/test/msan/CMakeLists.txt b/compiler-rt/test/msan/CMakeLists.txt index ff19c11971b2..df5719761e60 100644 --- a/compiler-rt/test/msan/CMakeLists.txt +++ b/compiler-rt/test/msan/CMakeLists.txt @@ -41,9 +41,7 @@ foreach(arch ${MSAN_TEST_ARCH}) endif() endforeach() -if(COMPILER_RT_INCLUDE_TESTS AND - COMPILER_RT_LIBCXX_PATH AND - COMPILER_RT_LIBCXXABI_PATH) +if(COMPILER_RT_LIBCXX_PATH AND COMPILER_RT_LIBCXXABI_PATH) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) diff --git a/compiler-rt/test/nsan/CMakeLists.txt b/compiler-rt/test/nsan/CMakeLists.txt index fb73587574fb..d702e122a85e 100644 --- a/compiler-rt/test/nsan/CMakeLists.txt +++ b/compiler-rt/test/nsan/CMakeLists.txt @@ -3,9 +3,7 @@ set(NSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(NSAN_TESTSUITES) set(NSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} nsan) -if(COMPILER_RT_INCLUDE_TESTS AND - COMPILER_RT_LIBCXX_PATH AND - COMPILER_RT_LIBCXXABI_PATH) +if(COMPILER_RT_LIBCXX_PATH AND COMPILER_RT_LIBCXXABI_PATH) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) diff --git a/compiler-rt/test/rtsan/CMakeLists.txt b/compiler-rt/test/rtsan/CMakeLists.txt index 2a59a57f2737..e1f9eb39408d 100644 --- a/compiler-rt/test/rtsan/CMakeLists.txt +++ b/compiler-rt/test/rtsan/CMakeLists.txt @@ -34,20 +34,18 @@ foreach(arch ${RTSAN_TEST_ARCH}) list(APPEND RTSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) endforeach() -if(COMPILER_RT_INCLUDE_TESTS) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) +if(COMPILER_RT_RTSAN_HAS_STATIC_RUNTIME) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) - if(COMPILER_RT_RTSAN_HAS_STATIC_RUNTIME) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic/lit.site.cfg.py) - endif() - list(APPEND RTSAN_TEST_DEPS RtsanUnitTests) - list(APPEND RTSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) - if(COMPILER_RT_RTSAN_HAS_STATIC_RUNTIME) - list(APPEND RTSAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic) - endif() + ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic/lit.site.cfg.py) +endif() +list(APPEND RTSAN_TEST_DEPS RtsanUnitTests) +list(APPEND RTSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) +if(COMPILER_RT_RTSAN_HAS_STATIC_RUNTIME) + list(APPEND RTSAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic) endif() add_lit_testsuite(check-rtsan "Running the Rtsan tests" diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt index edecc04d48c7..fa06b82acebd 100644 --- a/compiler-rt/test/sanitizer_common/CMakeLists.txt +++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt @@ -99,15 +99,13 @@ foreach(tool ${SUPPORTED_TOOLS}) endforeach() # Unit tests. -if(COMPILER_RT_INCLUDE_TESTS) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) - # FIXME: support unit test in the android test runner - if (NOT ANDROID) - list(APPEND SANITIZER_COMMON_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) - list(APPEND SANITIZER_COMMON_TEST_DEPS SanitizerUnitTests) - endif() +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) +# FIXME: support unit test in the android test runner +if (NOT ANDROID) + list(APPEND SANITIZER_COMMON_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) + list(APPEND SANITIZER_COMMON_TEST_DEPS SanitizerUnitTests) endif() if(SANITIZER_COMMON_TESTSUITES) diff --git a/compiler-rt/test/scudo/standalone/CMakeLists.txt b/compiler-rt/test/scudo/standalone/CMakeLists.txt index 0034cea360f3..3e6c8ab234b7 100644 --- a/compiler-rt/test/scudo/standalone/CMakeLists.txt +++ b/compiler-rt/test/scudo/standalone/CMakeLists.txt @@ -1,21 +1,19 @@ -if(COMPILER_RT_INCLUDE_TESTS) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg.py) +list(APPEND SCUDO_STANDALONE_TEST_DEPS ScudoUnitTests) +list(APPEND SCUDO_STANDALONE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit) +if (COMPILER_RT_HAS_GWP_ASAN) configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg.py) - list(APPEND SCUDO_STANDALONE_TEST_DEPS ScudoUnitTests) - list(APPEND SCUDO_STANDALONE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit) - if (COMPILER_RT_HAS_GWP_ASAN) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/unit/gwp_asan/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/unit/gwp_asan/lit.site.cfg.py) - list(APPEND SCUDO_STANDALONE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit/gwp_asan) - endif() - - add_lit_testsuite(check-scudo_standalone - "Running Scudo Standalone tests" - ${SCUDO_STANDALONE_TESTSUITES} - DEPENDS ${SCUDO_STANDALONE_TEST_DEPS}) - - set_target_properties(check-scudo_standalone - PROPERTIES FOLDER "Compiler-RT Tests") + ${CMAKE_CURRENT_SOURCE_DIR}/unit/gwp_asan/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/unit/gwp_asan/lit.site.cfg.py) + list(APPEND SCUDO_STANDALONE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/unit/gwp_asan) endif() + +add_lit_testsuite(check-scudo_standalone + "Running Scudo Standalone tests" + ${SCUDO_STANDALONE_TESTSUITES} + DEPENDS ${SCUDO_STANDALONE_TEST_DEPS}) + +set_target_properties(check-scudo_standalone + PROPERTIES FOLDER "Compiler-RT Tests") diff --git a/compiler-rt/test/tsan/CMakeLists.txt b/compiler-rt/test/tsan/CMakeLists.txt index 31cda53efd47..163355d68ebc 100644 --- a/compiler-rt/test/tsan/CMakeLists.txt +++ b/compiler-rt/test/tsan/CMakeLists.txt @@ -111,20 +111,18 @@ if(APPLE) endforeach() endif() -if(COMPILER_RT_INCLUDE_TESTS) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) +if(COMPILER_RT_TSAN_HAS_STATIC_RUNTIME) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py) - if(COMPILER_RT_TSAN_HAS_STATIC_RUNTIME) - configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic/lit.site.cfg.py) - endif() - list(APPEND TSAN_TEST_DEPS TsanUnitTests) - list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) - if(COMPILER_RT_TSAN_HAS_STATIC_RUNTIME) - list(APPEND TSAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic) - endif() + ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic/lit.site.cfg.py) +endif() +list(APPEND TSAN_TEST_DEPS TsanUnitTests) +list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) +if(COMPILER_RT_TSAN_HAS_STATIC_RUNTIME) + list(APPEND TSAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic) endif() add_lit_testsuite(check-tsan "Running ThreadSanitizer tests"