Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-09-15 19:10:44 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-09-15 19:27:01 +0300
commit5228b0b74fdb006c0ddb0f61bc1f6736f3fd7cb5 (patch)
treea1b0f75841ae0e26694f3828cf0b9b53540ef5e9 /tests/blender_as_python_module
parent335a6c0c87b805d2fe21a9d43294157b44fac28c (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/blender_as_python_module')
-rw-r--r--tests/blender_as_python_module/CMakeLists.txt2
-rw-r--r--tests/blender_as_python_module/import_bpy.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/blender_as_python_module/CMakeLists.txt b/tests/blender_as_python_module/CMakeLists.txt
index 334b3288246..4f6cf0adfdb 100644
--- a/tests/blender_as_python_module/CMakeLists.txt
+++ b/tests/blender_as_python_module/CMakeLists.txt
@@ -12,4 +12,4 @@ function(add_blender_as_python_module_test testname testscript)
)
endfunction()
-add_blender_as_python_module_test(import_bpy ${CMAKE_CURRENT_LIST_DIR}/import_bpy.py)
+add_blender_as_python_module_test(import_bpy ${CMAKE_CURRENT_LIST_DIR}/import_bpy.py ${CMAKE_INSTALL_PREFIX_WITH_CONFIG})
diff --git a/tests/blender_as_python_module/import_bpy.py b/tests/blender_as_python_module/import_bpy.py
index ea75c0f2fe6..223ed998707 100644
--- a/tests/blender_as_python_module/import_bpy.py
+++ b/tests/blender_as_python_module/import_bpy.py
@@ -1,4 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-or-later
+# Add directory with module to the path.
+import sys
+sys.path.append(sys.argv[1])
+
# Just import bpy and see if there are any dynamic loader errors.
import bpy