[compiler-rt] r201408 - Move LSan test suite under test/

Alexey Samsonov samsonov at google.com
Fri Feb 14 04:26:06 PST 2014


Author: samsonov
Date: Fri Feb 14 06:26:05 2014
New Revision: 201408

URL: http://llvm.org/viewvc/llvm-project?rev=201408&view=rev
Log:
Move LSan test suite under test/

Added:
    compiler-rt/trunk/test/lsan/
      - copied from r201399, compiler-rt/trunk/lib/lsan/lit_tests/
    compiler-rt/trunk/test/lsan/CMakeLists.txt
      - copied, changed from r201406, compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt
Removed:
    compiler-rt/trunk/lib/lsan/lit_tests/AsanConfig/
    compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt
    compiler-rt/trunk/lib/lsan/lit_tests/LsanConfig/
    compiler-rt/trunk/lib/lsan/lit_tests/TestCases/
    compiler-rt/trunk/lib/lsan/lit_tests/lit.common.cfg
    compiler-rt/trunk/test/lsan/Unit/
Modified:
    compiler-rt/trunk/CMakeLists.txt
    compiler-rt/trunk/lib/lsan/CMakeLists.txt
    compiler-rt/trunk/test/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=201408&r1=201407&r2=201408&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Fri Feb 14 06:26:05 2014
@@ -232,6 +232,7 @@ endif()
 filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
   x86_64 i386 powerpc64 arm)
 filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64)
+filter_available_targets(LSAN_SUPPORTED_ARCH x86_64)
 filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386)
 
 add_subdirectory(include)

Modified: compiler-rt/trunk/lib/lsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/CMakeLists.txt?rev=201408&r1=201407&r2=201408&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/lsan/CMakeLists.txt Fri Feb 14 06:26:05 2014
@@ -22,11 +22,7 @@ set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_
 filter_available_targets(LSAN_COMMON_SUPPORTED_ARCH
   x86_64 i386 powerpc64 arm)
 
-# Architectures supported by the standalone LSan.
-filter_available_targets(LSAN_SUPPORTED_ARCH
-  x86_64)
-
-set(LSAN_RUNTIME_LIBRARIES)
+add_custom_target(lsan)
 
 if(APPLE)
   foreach(os ${SANITIZER_COMMON_SUPPORTED_DARWIN_OS})
@@ -50,8 +46,6 @@ elseif(NOT ANDROID)
               $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
               $<TARGET_OBJECTS:RTLSanCommon.${arch}>
       CFLAGS ${LSAN_CFLAGS})
-    list(APPEND LSAN_RUNTIME_LIBRARIES clang_rt.lsan-${arch})
+    add_dependencies(lsan clang_rt.lsan-${arch})
   endforeach()
 endif()
-
-add_subdirectory(lit_tests)

Removed: compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt?rev=201407&view=auto
==============================================================================
--- compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt (removed)
@@ -1,28 +0,0 @@
-set(LSAN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
-set(LSAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
-
-set(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-
-configure_lit_site_cfg(
-  ${CMAKE_CURRENT_SOURCE_DIR}/LsanConfig/lit.site.cfg.in
-  ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig/lit.site.cfg
-  )
-
-configure_lit_site_cfg(
-  ${CMAKE_CURRENT_SOURCE_DIR}/AsanConfig/lit.site.cfg.in
-  ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig/lit.site.cfg
-  )
-
-if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT APPLE AND NOT ANDROID)
-  set(LSAN_TEST_DEPS
-    ${SANITIZER_COMMON_LIT_TEST_DEPS}
-    ${LSAN_RUNTIME_LIBRARIES})
-  foreach(arch ${LSAN_SUPPORTED_ARCH})
-    list(APPEND LSAN_TEST_DEPS clang_rt.asan-${arch})
-  endforeach()
-  add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
-    ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig
-    ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig
-    DEPENDS ${LSAN_TEST_DEPS})
-  set_target_properties(check-lsan PROPERTIES FOLDER "LSan tests")
-endif()

Removed: compiler-rt/trunk/lib/lsan/lit_tests/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/lit.common.cfg?rev=201407&view=auto
==============================================================================
--- compiler-rt/trunk/lib/lsan/lit_tests/lit.common.cfg (original)
+++ compiler-rt/trunk/lib/lsan/lit_tests/lit.common.cfg (removed)
@@ -1,43 +0,0 @@
-# -*- Python -*-
-
-# Common configuration for running leak detection tests under LSan/ASan.
-
-import os
-
-def get_required_attr(config, attr_name):
-  attr_value = getattr(config, attr_name, None)
-  if not attr_value:
-    lit_config.fatal(
-      "No attribute %r in test configuration! You may need to run "
-      "tests from your build directory or add this attribute "
-      "to lit.site.cfg " % attr_name)
-  return attr_value
-
-# Setup source root.
-lsan_lit_src_root = get_required_attr(config, 'lsan_lit_src_root')
-config.test_source_root = os.path.join(lsan_lit_src_root, 'TestCases')
-
-clang_cxxflags = ("--driver-mode=g++ "
-                      + "-g "
-                      + "-O0 "
-                      + "-m64 ")
-
-clang_cflags = ("-g "
-                      + "-O0 "
-                      + "-m64 ")
-
-config.clang_cxxflags = clang_cxxflags
-
-config.substitutions.append( ("%clangxx ", (" " + config.clang + " " +
-                                                clang_cxxflags + " ")) )
-
-config.clang_cflags = clang_cflags
-
-config.substitutions.append( ("%clang ", (" " + config.clang + " " +
-                                                clang_cflags + " ")) )
-
-# LeakSanitizer tests are currently supported on x86-64 Linux only.
-if config.host_os not in ['Linux'] or config.host_arch not in ['x86_64']:
-  config.unsupported = True
-
-config.suffixes = ['.c', '.cc', '.cpp']

Modified: compiler-rt/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/CMakeLists.txt?rev=201408&r1=201407&r2=201408&view=diff
==============================================================================
--- compiler-rt/trunk/test/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/CMakeLists.txt Fri Feb 14 06:26:05 2014
@@ -12,6 +12,9 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
   if(DFSAN_SUPPORTED_ARCH)
     add_subdirectory(dfsan)
   endif()
+  if(LSAN_SUPPORTED_ARCH)
+    add_subdirectory(lsan)
+  endif()
   if(UBSAN_SUPPORTED_ARCH)
     add_subdirectory(ubsan)
   endif()

Copied: compiler-rt/trunk/test/lsan/CMakeLists.txt (from r201406, compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/CMakeLists.txt?p2=compiler-rt/trunk/test/lsan/CMakeLists.txt&p1=compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt&r1=201406&r2=201408&rev=201408&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lit_tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/lsan/CMakeLists.txt Fri Feb 14 06:26:05 2014
@@ -1,6 +1,3 @@
-set(LSAN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
-set(LSAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
-
 set(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 
 configure_lit_site_cfg(
@@ -16,10 +13,8 @@ configure_lit_site_cfg(
 if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT APPLE AND NOT ANDROID)
   set(LSAN_TEST_DEPS
     ${SANITIZER_COMMON_LIT_TEST_DEPS}
-    ${LSAN_RUNTIME_LIBRARIES})
-  foreach(arch ${LSAN_SUPPORTED_ARCH})
-    list(APPEND LSAN_TEST_DEPS clang_rt.asan-${arch})
-  endforeach()
+    lsan
+    asan_runtime_libraries)
   add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
     ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig
     ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig





More information about the llvm-commits mailing list