[PATCH] D52840: Include Python binding tests in CMake rules

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 11:44:04 PDT 2018


mgorny created this revision.
mgorny added reviewers: jbcoe, arphaman, frutiger.

Add a new CMake rule check-clang-python to run the Python bindings'
test suite, and include it in check-all.


Repository:
  rC Clang

https://reviews.llvm.org/D52840

Files:
  CMakeLists.txt
  bindings/python/tests/CMakeLists.txt


Index: bindings/python/tests/CMakeLists.txt
===================================================================
--- /dev/null
+++ bindings/python/tests/CMakeLists.txt
@@ -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)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -502,6 +502,7 @@
       )
   endif()
   add_subdirectory(utils/perf-training)
+  add_subdirectory(bindings/python/tests)
 endif()
 
 option(CLANG_INCLUDE_DOCS "Generate build targets for the Clang docs."


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52840.168147.patch
Type: text/x-patch
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181003/4ab77d3f/attachment.bin>


More information about the cfe-commits mailing list