[Bf-blender-cvs] [589cbbf0e38] master: Tests: test availability of new bundled Python libraries

Brecht Van Lommel noreply at git.blender.org
Mon Jan 9 14:16:39 CET 2023


Commit: 589cbbf0e382a77b19f90886370682a0feab6fa6
Author: Brecht Van Lommel
Date:   Mon Jan 9 13:15:20 2023 +0100
Branches: master
https://developer.blender.org/rB589cbbf0e382a77b19f90886370682a0feab6fa6

Tests: test availability of new bundled Python libraries

Differential Revision: https://developer.blender.org/D16733

===================================================================

M	tests/python/CMakeLists.txt
M	tests/python/bl_bundled_modules.py

===================================================================

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index e4916bb3ff5..cc16a5641e1 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -80,7 +80,7 @@ add_blender_test(
 
 add_blender_test(
   script_bundled_modules
-  --python ${CMAKE_CURRENT_LIST_DIR}/bl_bundled_modules.py
+  --python ${CMAKE_CURRENT_LIST_DIR}/bl_bundled_modules.py -- --inside-blender
 )
 
 # test running operators doesn't segfault under various conditions
diff --git a/tests/python/bl_bundled_modules.py b/tests/python/bl_bundled_modules.py
index 7728a2deb47..6cb87b5aaed 100644
--- a/tests/python/bl_bundled_modules.py
+++ b/tests/python/bl_bundled_modules.py
@@ -1,7 +1,16 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-# Test that modules we ship with our Python installation are available
+# Test that modules we ship with our Python installation are available,
+# both for Blender itself and the bundled Python executable.
 
+import os
+import subprocess
+import sys
+
+app = "Blender" if sys.argv[-1] == "--inside-blender" else "Python"
+sys.stderr.write(f"Testing bundled modules in {app} executable.\n")
+
+# General purpose modules.
 import bz2
 import certifi
 import ctypes
@@ -14,3 +23,16 @@ import ssl
 import urllib3
 import zlib
 import zstandard
+
+# VFX platform modules.
+from pxr import Usd
+import MaterialX
+import OpenImageIO
+import PyOpenColorIO
+import pyopenvdb
+
+# Test modules in bundled Python standalone executable.
+if app == "Blender":
+    script_filepath = os.path.abspath(__file__)
+    proc = subprocess.Popen([sys.executable, script_filepath])
+    sys.exit(proc.wait())



More information about the Bf-blender-cvs mailing list