Commit: d307917bede2a665b2aeb696bc7e87ed3ecaca54 Author: Sergey Sharybin Date: Thu Jan 22 03:30:58 2015 +0500 Branches: cycles_ctests https://developer.blender.org/rBd307917bede2a665b2aeb696bc7e87ed3ecaca54
Cycles ctests: Run blender without system script override The idea is to force using Cycles tests only after running install target. More i'm thinking about ways to not require this more it's clear there is no clear way to support this. It is possible to hack something around and make tests to be running smoothly, but it's never gonna to give all the features (like GPU which required source file on linux and compiled cubin on windows, OSL which requires compiled script) without any manual tweaks anyway. So let's be damn stupid and not try to be smart and just assume install target was run which makes Cycles tests just happy without any extra setup. Would be nice to detect and report missing target install so we don't spend time on rendering Cycles scenes with Blender Internal. =================================================================== M tests/python/CMakeLists.txt M tests/python/cycles_render_tests.py =================================================================== diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index e0b0b1b..f4dc1a2 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -48,6 +48,7 @@ else() endif() # for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no +set(TEST_BLENDER_EXE_BARE ${TEST_BLENDER_EXE}) set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts) @@ -362,7 +363,7 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE} if(WITH_CYCLES) add_test(cycles_shaders_test ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py - ${TEST_BLENDER_EXE} - ${TEST_SRC_DIR}/cycles/ctests/shader + -blender "${TEST_BLENDER_EXE_BARE}" + -testdir "${TEST_SRC_DIR}/cycles/ctests/shader" ) endif() diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py index cc887e0..6b49225 100755 --- a/tests/python/cycles_render_tests.py +++ b/tests/python/cycles_render_tests.py @@ -1,12 +1,18 @@ #!/usr/bin/env python3 +import argparse import os -import tempfile import subprocess import sys +import tempfile -BLENDER = sys.argv[1:-1] -ROOT = sys.argv[-1] +parser = argparse.ArgumentParser() +parser.add_argument('-blender', nargs='+') +parser.add_argument('-testdir', nargs=1) +args = parser.parse_args() + +BLENDER = args.blender[0] +ROOT = args.testdir[0] TEMP = tempfile.mkdtemp() TEMP_FILE_MASK = os.path.join(TEMP, "test") @@ -14,8 +20,10 @@ TEMP_FILE = TEMP_FILE_MASK + '0001.png' def render_file(filepath): - command = BLENDER + [ - '-b', + command = [BLENDER, + '--background', + '-noaudio', + '--factory-startup', filepath, '-o', TEMP_FILE_MASK, @@ -69,6 +77,7 @@ def run_test(filepath): print("FAIL (RENDER)") return False + def blend_list(path): for dirpath, dirnames, filenames in os.walk(path): for filename in filenames: _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs