summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-10-17 03:05:39 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-10-17 03:05:39 +0000
commit0f4382eff8a58ab1d232f336ea0c58ef82e763a2 (patch)
tree0c5f766e56a89c5577e59cd9b8862b9d9c18bee6 /bindings
parentf6fcf841ff6ef4eca98ab56e1aee7b98e7175503 (diff)
[python] [tests] Disable on known-broken arches
Disable the Python binding tests on AArch64, Hexagon and SystemZ following reports on test failures. The first two yield different results, possibly indicating test case problems. The last one seems to have broken FFI in Python. While at it, refactor the code to make adding future test restrictions easier. Differential Revision: https://reviews.llvm.org/D53326 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/tests/CMakeLists.txt32
1 files changed, 21 insertions, 11 deletions
diff --git a/bindings/python/tests/CMakeLists.txt b/bindings/python/tests/CMakeLists.txt
index 12a385ce55..1b8f0eacd6 100644
--- a/bindings/python/tests/CMakeLists.txt
+++ b/bindings/python/tests/CMakeLists.txt
@@ -7,24 +7,34 @@ 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()
+set(RUN_PYTHON_TESTS TRUE)
-# Tests fail on Windows, and need someone knowledgeable to fix.
-# It's not clear whether it's a test or a valid binding problem.
-#
# 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))
+list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
+if(NOT LLVM_USE_ASAN_INDEX EQUAL -1)
+ set(RUN_PYTHON_TESTS FALSE)
+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(WIN32)
+ set(RUN_PYTHON_TESTS FALSE)
+endif()
+
+# AArch64 and Hexagon have known test failures that need to be
+# addressed.
+# SystemZ has broken Python/FFI interface:
+# https://reviews.llvm.org/D52840#1265716
+if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|SystemZ)$")
+ set(RUN_PYTHON_TESTS FALSE)
+endif()
+
+if(RUN_PYTHON_TESTS)
set_property(GLOBAL APPEND PROPERTY
LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
endif()