Skip to content

Commit 0e75dc4

Browse files
committedOct 17, 2018
[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 llvm-svn: 344666
1 parent aae1e87 commit 0e75dc4

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed
 

‎clang/bindings/python/tests/CMakeLists.txt

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,34 @@ add_custom_target(check-clang-python
77
DEPENDS libclang
88
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
99

10-
# Check if we are building with ASan
11-
list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
12-
if (LLVM_USE_ASAN_INDEX EQUAL -1)
13-
set(LLVM_USE_ASAN FALSE)
14-
else()
15-
set(LLVM_USE_ASAN TRUE)
16-
endif()
10+
set(RUN_PYTHON_TESTS TRUE)
1711

18-
# Tests fail on Windows, and need someone knowledgeable to fix.
19-
# It's not clear whether it's a test or a valid binding problem.
20-
#
2112
# Do not try to run if libclang was built with ASan because
2213
# the sanitizer library will likely be loaded too late to perform
2314
# interception and will then fail.
2415
# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
2516
# portable so its easier just to not run the tests when building
2617
# with ASan.
27-
if((NOT WIN32) AND (NOT LLVM_USE_ASAN))
18+
list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
19+
if(NOT LLVM_USE_ASAN_INDEX EQUAL -1)
20+
set(RUN_PYTHON_TESTS FALSE)
21+
endif()
22+
23+
# Tests fail on Windows, and need someone knowledgeable to fix.
24+
# It's not clear whether it's a test or a valid binding problem.
25+
if(WIN32)
26+
set(RUN_PYTHON_TESTS FALSE)
27+
endif()
28+
29+
# AArch64 and Hexagon have known test failures that need to be
30+
# addressed.
31+
# SystemZ has broken Python/FFI interface:
32+
# https://reviews.llvm.org/D52840#1265716
33+
if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|SystemZ)$")
34+
set(RUN_PYTHON_TESTS FALSE)
35+
endif()
36+
37+
if(RUN_PYTHON_TESTS)
2838
set_property(GLOBAL APPEND PROPERTY
2939
LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
3040
endif()

0 commit comments

Comments
 (0)
Please sign in to comment.