[python] [tests] Fix calling tests on Windows
authorMichal Gorny <mgorny@gentoo.org>
Thu, 11 Oct 2018 20:26:55 +0000 (20:26 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Thu, 11 Oct 2018 20:26:55 +0000 (20:26 +0000)
Fix passing arguments to the Python test command to use 'env' builtin
CMake command, in order to fix compatibility with Windows.

Differential Revision: https://reviews.llvm.org/D53151

llvm-svn: 344288

clang/bindings/python/tests/CMakeLists.txt

index b40684f..97cd9ba 100644 (file)
@@ -1,7 +1,9 @@
 # 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
+    COMMAND ${CMAKE_COMMAND} -E env
+            CLANG_LIBRARY_PATH=$<TARGET_FILE_DIR:libclang>
+            ${PYTHON_EXECUTABLE} -m unittest discover
     DEPENDS libclang
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)