From 127e93e4dcd06d6b965f66ae8eeab6ddc651b759 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 14 Feb 2014 12:13:59 +0000 Subject: [PATCH] Delete LSan unit tests llvm-svn: 201406 --- compiler-rt/lib/lsan/CMakeLists.txt | 3 -- compiler-rt/lib/lsan/lit_tests/CMakeLists.txt | 9 ---- .../lib/lsan/lit_tests/Unit/lit.site.cfg.in | 12 ----- compiler-rt/lib/lsan/tests/CMakeLists.txt | 58 ---------------------- compiler-rt/lib/lsan/tests/lsan_dummy_unittest.cc | 22 -------- compiler-rt/lib/lsan/tests/lsan_testlib.cc | 25 ---------- 6 files changed, 129 deletions(-) delete mode 100644 compiler-rt/lib/lsan/lit_tests/Unit/lit.site.cfg.in delete mode 100644 compiler-rt/lib/lsan/tests/CMakeLists.txt delete mode 100644 compiler-rt/lib/lsan/tests/lsan_dummy_unittest.cc delete mode 100644 compiler-rt/lib/lsan/tests/lsan_testlib.cc diff --git a/compiler-rt/lib/lsan/CMakeLists.txt b/compiler-rt/lib/lsan/CMakeLists.txt index 9606889..c9c0e22 100644 --- a/compiler-rt/lib/lsan/CMakeLists.txt +++ b/compiler-rt/lib/lsan/CMakeLists.txt @@ -54,7 +54,4 @@ elseif(NOT ANDROID) endforeach() endif() -if (LLVM_INCLUDE_TESTS) - add_subdirectory(tests) -endif() add_subdirectory(lit_tests) diff --git a/compiler-rt/lib/lsan/lit_tests/CMakeLists.txt b/compiler-rt/lib/lsan/lit_tests/CMakeLists.txt index 526d71b..9b26357 100644 --- a/compiler-rt/lib/lsan/lit_tests/CMakeLists.txt +++ b/compiler-rt/lib/lsan/lit_tests/CMakeLists.txt @@ -13,11 +13,6 @@ configure_lit_site_cfg( ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig/lit.site.cfg ) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg - ) - if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT APPLE AND NOT ANDROID) set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} @@ -25,13 +20,9 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT APPLE AND NOT ANDROID) foreach(arch ${LSAN_SUPPORTED_ARCH}) list(APPEND LSAN_TEST_DEPS clang_rt.asan-${arch}) endforeach() - if(LLVM_INCLUDE_TESTS) - list(APPEND LSAN_TEST_DEPS LsanUnitTests) - endif() add_lit_testsuite(check-lsan "Running the LeakSanitizer tests" ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig - ${CMAKE_CURRENT_BINARY_DIR}/Unit DEPENDS ${LSAN_TEST_DEPS}) set_target_properties(check-lsan PROPERTIES FOLDER "LSan tests") endif() diff --git a/compiler-rt/lib/lsan/lit_tests/Unit/lit.site.cfg.in b/compiler-rt/lib/lsan/lit_tests/Unit/lit.site.cfg.in deleted file mode 100644 index a3db63f..0000000 --- a/compiler-rt/lib/lsan/lit_tests/Unit/lit.site.cfg.in +++ /dev/null @@ -1,12 +0,0 @@ -## Autogenerated by LLVM/Clang configuration. -# Do not edit! - -# Load common config for all compiler-rt unit tests. -lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured") - -# Setup config name. -config.name = 'LeakSanitizer-Unit' -# Setup test source and exec root. For unit tests, we define -# it as build directory with LSan unit tests. -config.test_exec_root = "@LSAN_BINARY_DIR@/tests" -config.test_source_root = config.test_exec_root diff --git a/compiler-rt/lib/lsan/tests/CMakeLists.txt b/compiler-rt/lib/lsan/tests/CMakeLists.txt deleted file mode 100644 index 2221e06..0000000 --- a/compiler-rt/lib/lsan/tests/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -include(CheckCXXCompilerFlag) -include(CompilerRTCompile) -include(CompilerRTLink) - -include_directories(..) -include_directories(../..) - -set(LSAN_TESTS_SRC - lsan_dummy_unittest.cc) - -set(LSAN_TESTS_CFLAGS - ${SANITIZER_COMMON_CFLAGS} - ${COMPILER_RT_GTEST_INCLUDE_CFLAGS} - -I${COMPILER_RT_SOURCE_DIR}/lib - -I${LSAN_SRC_DIR}) - -set(LSAN_TEST_LINK_FLAGS_COMMON - -lstdc++ -ldl -lpthread -lm) - -add_custom_target(LsanUnitTests) -set_target_properties(LsanUnitTests PROPERTIES - FOLDER "LSan unit tests") - -# Compile source for the given architecture, using compiler -# options in ${ARGN}, and add it to the object list. -macro(lsan_compile obj_list source arch) - get_filename_component(basename ${source} NAME) - set(output_obj "${basename}.${arch}.o") - get_target_flags_for_arch(${arch} TARGET_CFLAGS) - clang_compile(${output_obj} ${source} - CFLAGS ${ARGN} ${TARGET_CFLAGS} - DEPS gtest ${LSAN_RUNTIME_LIBRARIES}) - list(APPEND ${obj_list} ${output_obj}) -endmacro() - -function(add_lsan_test test_suite test_name arch) - get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS) - add_compiler_rt_test(${test_suite} ${test_name} - OBJECTS ${ARGN} - DEPS ${LSAN_RUNTIME_LIBRARIES} ${ARGN} - LINK_FLAGS ${LSAN_TEST_LINK_FLAGS_COMMON} - ${TARGET_LINK_FLAGS}) -endfunction() - -macro(add_lsan_tests_for_arch arch) - set(LSAN_TESTS_OBJ) - set(LSAN_TEST_SOURCES ${LSAN_TESTS_SRC} - ${COMPILER_RT_GTEST_SOURCE}) - foreach(source ${LSAN_TEST_SOURCES}) - lsan_compile(LSAN_TESTS_OBJ ${source} ${arch} ${LSAN_TESTS_CFLAGS}) - endforeach() - add_lsan_test(LsanUnitTests Lsan-${arch}-Test ${arch} ${LSAN_TESTS_OBJ}) -endmacro() - -# Build tests for 64-bit Linux only. -if(UNIX AND NOT APPLE AND CAN_TARGET_x86_64) - add_lsan_tests_for_arch(x86_64) -endif() diff --git a/compiler-rt/lib/lsan/tests/lsan_dummy_unittest.cc b/compiler-rt/lib/lsan/tests/lsan_dummy_unittest.cc deleted file mode 100644 index 5468400..0000000 --- a/compiler-rt/lib/lsan/tests/lsan_dummy_unittest.cc +++ /dev/null @@ -1,22 +0,0 @@ -//===-- lsan_dummy_unittest.cc --------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file is a part of LeakSanitizer runtime. -// -//===----------------------------------------------------------------------===// -#include "gtest/gtest.h" - -TEST(LeakSanitizer, EmptyTest) { - // Empty test to suppress LIT warnings about lack of tests. -} - -int main(int argc, char **argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/compiler-rt/lib/lsan/tests/lsan_testlib.cc b/compiler-rt/lib/lsan/tests/lsan_testlib.cc deleted file mode 100644 index 8db6cf1..0000000 --- a/compiler-rt/lib/lsan/tests/lsan_testlib.cc +++ /dev/null @@ -1,25 +0,0 @@ -//===-- lsan_testlib.cc ---------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file is a part of LeakSanitizer. -// Standalone LSan tool as a shared library, to be used with LD_PRELOAD. -// -//===----------------------------------------------------------------------===// -/* Usage: -clang++ ../sanitizer_common/sanitizer_*.cc ../interception/interception_*.cc \ - lsan*.cc tests/lsan_testlib.cc -I. -I.. -g -ldl -lpthread -fPIC -shared -O2 \ - -DLSAN_USE_PREINIT_ARRAY=0 -o lsan.so -LD_PRELOAD=./lsan.so /your/app -*/ -#include "lsan.h" - -__attribute__((constructor)) -void constructor() { - __lsan_init(); -} -- 2.7.4