Tests: test availability of new bundled Python libraries

Differential Revision: https://developer.blender.org/D16733
This commit is contained in:
Brecht Van Lommel 2023-01-09 13:15:20 +01:00
parent b3f664f8fb
commit 589cbbf0e3
Notes: blender-bot 2023-02-14 09:34:18 +01:00
Referenced by issue #99618, Library changes for Blender 3.5
2 changed files with 24 additions and 2 deletions

View File

@ -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

View File

@ -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())