Tests: add OpenGL UI drawing tests.

This reuses the Cycles regression test code to also work for OpenGL UI drawing.
We launch Blender with a bunch of .blend files, take a screenshot and compare
it with a reference screenshot, and generate a HMTL report showing the failed
tests and their differences.

For Cycles we keep small reference renders to compare to in svn, but for OpenGL
developers currently have to generate the references manually. How to use:

* WITH_OPENGL_DRAW_TESTS=ON in CMake
* BLENDER_TEST_UPDATE=1 ctest -R opengl_draw
* .. make code changes ..
* ctest -R opengl_draw
* open build_dir/tests/opengl_draw/report.html

Differential Revision: https://developer.blender.org/D3064
This commit is contained in:
Brecht Van Lommel
2018-02-14 20:33:33 +01:00
parent 0f23f618f3
commit 3d2d58391a
4 changed files with 151 additions and 8 deletions

View File

@@ -49,12 +49,11 @@ def print_message(message, type=None, status=''):
sys.stdout.flush()
def blend_list(path):
for dirpath, dirnames, filenames in os.walk(path):
for filename in filenames:
if filename.lower().endswith(".blend"):
filepath = os.path.join(dirpath, filename)
yield filepath
def blend_list(dirpath):
for filename in os.listdir(dirpath):
if filename.lower().endswith(".blend"):
filepath = os.path.join(dirpath, filename)
yield filepath
def test_get_name(filepath):
filename = os.path.basename(filepath)