summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-10-15 17:43:23 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-10-15 17:43:23 +0000
commit59436556329d1f9f6c9f63ed94eab6ae70be34b5 (patch)
tree0fae89683ab932031363a5c3f567470402bd2a66 /bindings
parenteb078c91ceb8b9714fd4cfb193b0196d77b2d72a (diff)
downloadclang-59436556329d1f9f6c9f63ed94eab6ae70be34b5.tar.gz
[python] [tests] Disable python binding tests under LLVM_USE_SANITIZER=Address
They don't work yet. Patch by Dan Liew! rdar://problem/45242886 Differential Revision: https://reviews.llvm.org/D53239 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/tests/CMakeLists.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/bindings/python/tests/CMakeLists.txt b/bindings/python/tests/CMakeLists.txt
index 1e10f67ad7..12a385ce55 100644
--- a/bindings/python/tests/CMakeLists.txt
+++ b/bindings/python/tests/CMakeLists.txt
@@ -7,9 +7,24 @@ add_custom_target(check-clang-python
DEPENDS libclang
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
+# Check if we are building with ASan
+list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
+if (LLVM_USE_ASAN_INDEX EQUAL -1)
+ set(LLVM_USE_ASAN FALSE)
+else()
+ set(LLVM_USE_ASAN TRUE)
+endif()
+
# Tests fail on Windows, and need someone knowledgeable to fix.
# It's not clear whether it's a test or a valid binding problem.
-if(NOT WIN32)
+#
+# Do not try to run if libclang was built with ASan because
+# the sanitizer library will likely be loaded too late to perform
+# interception and will then fail.
+# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
+# portable so its easier just to not run the tests when building
+# with ASan.
+if((NOT WIN32) AND (NOT LLVM_USE_ASAN))
set_property(GLOBAL APPEND PROPERTY
LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
endif()