summaryrefslogtreecommitdiffstats
path: root/googletest/cmake/internal_utils.cmake
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2021-12-22 21:00:44 (GMT)
committerCopybara-Service <copybara-worker@google.com>2021-12-22 21:01:24 (GMT)
commitc58f562fa2b287ab58a51b702f3c7295efe89904 (patch)
tree1179004595ed2b972b83dc62ec5adb467c5f7dd9 /googletest/cmake/internal_utils.cmake
parent71d4e2f7423274d178b446e94b88082559f2fa7a (diff)
downloadgoogletest-c58f562fa2b287ab58a51b702f3c7295efe89904.zip
googletest-c58f562fa2b287ab58a51b702f3c7295efe89904.tar.gz
googletest-c58f562fa2b287ab58a51b702f3c7295efe89904.tar.bz2
Makes the Python imports consistently use full paths from the repository root,
unifying the behavior between Bazel and CMake This fixes one of the CI failures on Windows PiperOrigin-RevId: 417872531 Change-Id: I156989323b7e6d4a4420f4f9691b078829db933d
Diffstat (limited to 'googletest/cmake/internal_utils.cmake')
-rw-r--r--googletest/cmake/internal_utils.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
index 58fc9bf..0c7983a 100644
--- a/googletest/cmake/internal_utils.cmake
+++ b/googletest/cmake/internal_utils.cmake
@@ -304,6 +304,8 @@ function(py_test name)
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
--build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN})
endif()
+ # Make the Python import path consistent between Bazel and CMake.
+ set_tests_properties(${name} PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR})
endif(PYTHONINTERP_FOUND)
endfunction()