diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-03-15 02:30:26 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-03-24 22:58:31 +0300 |
commit | adab11adf58b1ed816ba8f9979739b0b75e1dbb1 (patch) | |
tree | b94165ac004ee841090584756ad10be37b33f16c /tests/performance/tests/cycles.py | |
parent | 394a1373a0cd20b7d0660df4bf80e1231e33cba9 (diff) |
Tests: prototype for performance testing frameworkperformance-test
Diffstat (limited to 'tests/performance/tests/cycles.py')
-rw-r--r-- | tests/performance/tests/cycles.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/performance/tests/cycles.py b/tests/performance/tests/cycles.py new file mode 100644 index 00000000000..c70efe46c6d --- /dev/null +++ b/tests/performance/tests/cycles.py @@ -0,0 +1,33 @@ +import api +import os + +def _run(args): + import bpy + import time + + scene = bpy.context.scene + scene.render.engine = 'CYCLES' + scene.cycles.samples = 4 + + start_time = time.time() + bpy.ops.render.render() + elapsed_time = time.time() - start_time + result = {'time': elapsed_time} + return result + +class CyclesTest(api.Test): + def __init__(self, filepath): + self.filepath = filepath + + def name(self): + return 'cycles_' + self.filepath.stem + + def use_device(self): + return True + + def run(self, env): + return env.run_in_blender(_run, {}, blendfile=self.filepath) + +def generate(env): + filepaths = env.find_blend_files('cycles') + return [CyclesTest(filepath) for filepath in filepaths] |