diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-09-15 19:10:44 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-09-15 19:27:01 +0300 |
commit | 5228b0b74fdb006c0ddb0f61bc1f6736f3fd7cb5 (patch) | |
tree | a1b0f75841ae0e26694f3828cf0b9b53540ef5e9 /tests/CMakeLists.txt | |
parent | 335a6c0c87b805d2fe21a9d43294157b44fac28c (diff) |
Python: fix failing tests when building bpy module
* Use Python executable from lib folder since it's not installed.
* Make bpy module test work for portable install.
* Disable gtests which don't work with different Python link flags
and shared library locations.
Ref D15957
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6d1c838ad6d..68fcfc89b96 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,29 +10,25 @@ set(TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX_WITH_CONFIG}) # Path to Blender and Python executables for all platforms. if(MSVC) set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/blender.exe) - set(_default_test_python_exe "${TEST_INSTALL_DIR}/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>") elseif(APPLE) set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/Blender.app/Contents/MacOS/Blender) - set(_default_test_python_exe ${PYTHON_EXECUTABLE}) else() if(WITH_INSTALL_PORTABLE) set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/blender) else() set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/bin/blender) endif() - set(_default_test_python_exe ${PYTHON_EXECUTABLE}) endif() # The installation directory's Python is the best one to use. However, it can only be there after the install step, # which means that Python will never be there on a fresh system. To suit different needs, the user can pass # -DTEST_PYTHON_EXE=/path/to/python to CMake. if(NOT TEST_PYTHON_EXE) - set(TEST_PYTHON_EXE ${_default_test_python_exe}) + set(TEST_PYTHON_EXE ${PYTHON_EXECUTABLE}) message(STATUS "Tests: Using Python executable: ${TEST_PYTHON_EXE}") elseif(NOT EXISTS ${TEST_PYTHON_EXE}) message(FATAL_ERROR "Tests: TEST_PYTHON_EXE ${TEST_PYTHON_EXE} does not exist") endif() -unset(_default_test_python_exe) # For testing with Valgrind |