]> granicus.if.org Git - clang/commitdiff
[tests] Include Python binding tests in CMake rules
authorMichal Gorny <mgorny@gentoo.org>
Thu, 11 Oct 2018 11:58:14 +0000 (11:58 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Thu, 11 Oct 2018 11:58:14 +0000 (11:58 +0000)
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@344241 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
bindings/python/tests/CMakeLists.txt [new file with mode: 0644]

index 61fd913a2a539ed4942f0a512469495f68a8168b..84984f75b5f8290c83931e8252de6220642b9591 100644 (file)
@@ -502,6 +502,7 @@ if( CLANG_INCLUDE_TESTS )
       )
   endif()
   add_subdirectory(utils/perf-training)
+  add_subdirectory(bindings/python/tests)
 endif()
 
 option(CLANG_INCLUDE_DOCS "Generate build targets for the Clang docs."
diff --git a/bindings/python/tests/CMakeLists.txt b/bindings/python/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..66758a3
--- /dev/null
@@ -0,0 +1,7 @@
+# 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}/..)
+add_dependencies(check-all check-clang-python)