summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-02-14 12:13:59 +0000
committerAlexey Samsonov <samsonov@google.com>2014-02-14 12:13:59 +0000
commit52c3664ccab19dd8d154b267ad8171b8b73e90df (patch)
treed1a621523012446b8c3eb99cec817914d55d75bf
parent0c4fa9907ba77a1a803ca9f7da4cb09901951991 (diff)
Delete LSan unit tests
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201406 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/lsan/CMakeLists.txt3
-rw-r--r--lib/lsan/lit_tests/CMakeLists.txt9
-rw-r--r--lib/lsan/lit_tests/Unit/lit.site.cfg.in12
-rw-r--r--lib/lsan/tests/CMakeLists.txt58
-rw-r--r--lib/lsan/tests/lsan_dummy_unittest.cc22
-rw-r--r--lib/lsan/tests/lsan_testlib.cc25
6 files changed, 0 insertions, 129 deletions
diff --git a/lib/lsan/CMakeLists.txt b/lib/lsan/CMakeLists.txt
index 960688977..c9c0e22f3 100644
--- a/lib/lsan/CMakeLists.txt
+++ b/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/lib/lsan/lit_tests/CMakeLists.txt b/lib/lsan/lit_tests/CMakeLists.txt
index 526d71bf3..9b26357fb 100644
--- a/lib/lsan/lit_tests/CMakeLists.txt
+++ b/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/lib/lsan/lit_tests/Unit/lit.site.cfg.in b/lib/lsan/lit_tests/Unit/lit.site.cfg.in
deleted file mode 100644
index a3db63fe6..000000000
--- a/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/lib/lsan/tests/CMakeLists.txt b/lib/lsan/tests/CMakeLists.txt
deleted file mode 100644
index 2221e0650..000000000
--- a/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/lib/lsan/tests/lsan_dummy_unittest.cc b/lib/lsan/tests/lsan_dummy_unittest.cc
deleted file mode 100644
index 546840077..000000000
--- a/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/lib/lsan/tests/lsan_testlib.cc b/lib/lsan/tests/lsan_testlib.cc
deleted file mode 100644
index 8db6cf1e2..000000000
--- a/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();
-}