CTests: Initial work to cover Cycles nodes with OpenGL tests
Works similar to regular Cycles tests, just does OpenGL render to get output image. Seems to work fine with the only funny effect: Blender window will pop up for each of the tests. This is current limitation of our OpenGL context. Might be changed in the future.
This commit is contained in:
@@ -445,6 +445,7 @@ option(WITH_BOOST "Enable features depending on boost" ON)
|
|||||||
|
|
||||||
# Unit testsing
|
# Unit testsing
|
||||||
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
||||||
|
option(WITH_OPENGL_TESTS "Enable OpenGL related unit testing (Experimental)" OFF)
|
||||||
|
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
|
@@ -418,6 +418,9 @@ if(WITH_CYCLES)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
if(WITH_OPENGL_TESTS)
|
||||||
|
add_cycles_render_test(opengl)
|
||||||
|
endif()
|
||||||
add_cycles_render_test(reports)
|
add_cycles_render_test(reports)
|
||||||
add_cycles_render_test(render)
|
add_cycles_render_test(render)
|
||||||
add_cycles_render_test(shader)
|
add_cycles_render_test(shader)
|
||||||
|
@@ -47,20 +47,41 @@ def printMessage(type, status, message):
|
|||||||
|
|
||||||
|
|
||||||
def render_file(filepath):
|
def render_file(filepath):
|
||||||
command = (
|
dirname = os.path.dirname(filepath)
|
||||||
BLENDER,
|
basedir = os.path.dirname(dirname)
|
||||||
"--background",
|
subject = os.path.basename(dirname)
|
||||||
"-noaudio",
|
if subject == 'opengl':
|
||||||
"--factory-startup",
|
command = (
|
||||||
"--enable-autoexec",
|
BLENDER,
|
||||||
filepath,
|
"--window-geometry", "0", "0", "1", "1",
|
||||||
"-E", "CYCLES",
|
"-noaudio",
|
||||||
# Run with OSL enabled
|
"--factory-startup",
|
||||||
# "--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True",
|
"--enable-autoexec",
|
||||||
"-o", TEMP_FILE_MASK,
|
filepath,
|
||||||
"-F", "PNG",
|
"-E", "CYCLES",
|
||||||
"-f", "1",
|
# Run with OSL enabled
|
||||||
|
# "--python-expr", "import bpy; bpy.context.scene.cycles.shading_system = True",
|
||||||
|
"-o", TEMP_FILE_MASK,
|
||||||
|
"-F", "PNG",
|
||||||
|
'--python', os.path.join(basedir,
|
||||||
|
"util",
|
||||||
|
"render_opengl.py")
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
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",
|
||||||
|
"-o", TEMP_FILE_MASK,
|
||||||
|
"-F", "PNG",
|
||||||
|
"-f", "1",
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
output = subprocess.check_output(command)
|
output = subprocess.check_output(command)
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
|
Reference in New Issue
Block a user