Fix: Benchmark: Select executable with installed files

When using `revisions` in the configuration after the first run
calls to the `benchmark.py` can fail as it selects an blender
executable that doesn't contain any installation files.

This PR will fix this by selecting the first executable that has a
license folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/155310
This commit is contained in:
Jeroen Bakker 2026-03-09 08:27:28 +01:00
parent b77ffcb88b
commit f9766474ee

View file

@ -154,6 +154,17 @@ class TestEnvironment:
else:
return pathlib.Path('blender')
def _has_install_files(self, executable_path: pathlib.Path) -> bool:
"""
Check if the given executable is a full installation of blender by checking
the availability of the 'license' directory.
"""
if platform.system() == "Darwin":
license_path = executable_path.parent.parent / 'Resources' / 'text' / 'license'
else:
license_path = executable_path.parent / 'license'
return license_path.is_dir()
def _blender_executable_from_path(self, executable: pathlib.Path) -> pathlib.Path:
if executable.is_dir():
# Directory
@ -162,7 +173,7 @@ class TestEnvironment:
# Executable path without proper path on Windows or macOS.
executable = executable.parent / self._blender_executable_name()
if executable.is_file():
if executable.is_file() and self._has_install_files(executable):
return executable
return None