summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2018-10-11 16:32:54 +0000
committerMichal Gorny <mgorny@gentoo.org>2018-10-11 16:32:54 +0000
commit77a2b784ed4059c8e5fd957463557e8635ff72f8 (patch)
treed861264119e87135c598a8065e95d2879a21ae6e
parent17773010d45da014b85dfc547ad15f0cff9ca240 (diff)
downloadclang-77a2b784ed4059c8e5fd957463557e8635ff72f8.tar.gz
[tests] Include Python binding tests in CMake rules
Add a new CMake rule check-clang-python to run the Python bindings' test suite, and include it in check-all. Differential Revision: https://reviews.llvm.org/D52840 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344258 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt5
-rw-r--r--bindings/python/tests/CMakeLists.txt8
2 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61fd913a2a..93d73ffa53 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -485,6 +485,7 @@ if( CLANG_INCLUDE_TESTS )
)
endif()
add_subdirectory(test)
+ add_subdirectory(bindings/python/tests)
if(CLANG_BUILT_STANDALONE)
# Add a global check rule now that all subdirectories have been traversed
@@ -493,11 +494,13 @@ if( CLANG_INCLUDE_TESTS )
get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS)
get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS)
+ get_property(LLVM_ADDITIONAL_TEST_TARGETS
+ GLOBAL PROPERTY LLVM_ADDITIONAL_TEST_TARGETS)
add_lit_target(check-all
"Running all regression tests"
${LLVM_LIT_TESTSUITES}
PARAMS ${LLVM_LIT_PARAMS}
- DEPENDS ${LLVM_LIT_DEPENDS}
+ DEPENDS ${LLVM_LIT_DEPENDS} ${LLVM_ADDITIONAL_TEST_TARGETS}
ARGS ${LLVM_LIT_EXTRA_ARGS}
)
endif()
diff --git a/bindings/python/tests/CMakeLists.txt b/bindings/python/tests/CMakeLists.txt
new file mode 100644
index 0000000000..860db4e997
--- /dev/null
+++ b/bindings/python/tests/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Test target to run Python test suite from main build.
+
+add_custom_target(check-clang-python
+ COMMAND CLANG_LIBRARY_PATH=$<TARGET_FILE_DIR:libclang> ${PYTHON_EXECUTABLE} -m unittest discover
+ DEPENDS libclang
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)