[Bf-blender-cvs] [4218b9367e1] master: Cycles tests: pass Blender custom arguments from CYCLESTEST_ARGS.
Brecht Van Lommel
noreply at git.blender.org
Sat Aug 19 18:30:39 CEST 2017
Commit: 4218b9367e11559bdcc7a7b98625dd2984eef3d4
Author: Brecht Van Lommel
Date: Sat Aug 19 12:09:28 2017 +0200
Branches: master
https://developer.blender.org/rB4218b9367e11559bdcc7a7b98625dd2984eef3d4
Cycles tests: pass Blender custom arguments from CYCLESTEST_ARGS.
This is useful for testing with different devices, split kernel, OSL,
impact of integrator settings, etc.
===================================================================
M tests/python/cycles_render_tests.py
===================================================================
diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py
index 77bee4953ba..d4e796f35ae 100755
--- a/tests/python/cycles_render_tests.py
+++ b/tests/python/cycles_render_tests.py
@@ -5,6 +5,7 @@ import argparse
import glob
import os
import pathlib
+import shlex
import shutil
import subprocess
import sys
@@ -52,38 +53,44 @@ def render_file(filepath):
dirname = os.path.dirname(filepath)
basedir = os.path.dirname(dirname)
subject = os.path.basename(dirname)
+
+ custom_args = os.getenv('CYCLESTEST_ARGS')
+ custom_args = shlex.split(custom_args) if custom_args else []
+
+ # OSL and GPU examples
+ # custom_args += ["--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True"]
+ # custom_args += ["--python-expr", "import bpy; bpy.context.scene.cycles.device = 'GPU'"]
+
if subject == 'opengl':
- command = (
+ command = [
BLENDER,
"--window-geometry", "0", "0", "1", "1",
"-noaudio",
"--factory-startup",
"--enable-autoexec",
filepath,
- "-E", "CYCLES",
- # Run with OSL enabled
- # "--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True",
+ "-E", "CYCLES"]
+ command += custom_args
+ command += [
"-o", TEMP_FILE_MASK,
"-F", "PNG",
'--python', os.path.join(basedir,
"util",
- "render_opengl.py")
- )
+ "render_opengl.py")]
else:
- command = (
+ command = [
BLENDER,
"--background",
"-noaudio",
"--factory-startup",
"--enable-autoexec",
filepath,
- "-E", "CYCLES",
- # Run with OSL enabled
- # "--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True",
+ "-E", "CYCLES"]
+ command += custom_args
+ command += [
"-o", TEMP_FILE_MASK,
"-F", "PNG",
- "-f", "1",
- )
+ "-f", "1"]
try:
output = subprocess.check_output(command)
if VERBOSE:
More information about the Bf-blender-cvs
mailing list