mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 07:22:12 -05:00
Compositor automated testing
Added support for compositor tests. Compositor tests can be added, executed and viewed in a similar way to cycles and other render engines tests. Running test: `ctest -R compositor` Updating test: `BLENDER_TEST_UPDATE=1 ctest -R compositor` Viewing test results: typically saved under `build_folder/tests/compositor/report.html` Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6334
This commit is contained in:
parent
39ecf90185
commit
252c87b9e8
Notes:
blender-bot
2023-02-14 04:20:36 +01:00
Referenced by issue #71834, Compositor automated tests
3 changed files with 94 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -46,3 +46,6 @@ Desktop.ini
|
|||
|
||||
# smoke simulation noise tile (generated)
|
||||
waveletNoiseTile.bin
|
||||
|
||||
# testing environment
|
||||
/Testing
|
||||
|
|
|
@ -713,6 +713,33 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_COMPOSITOR)
|
||||
set(compositor_tests
|
||||
color
|
||||
converter
|
||||
distort
|
||||
filter
|
||||
input
|
||||
matte
|
||||
output
|
||||
vector
|
||||
|
||||
multiple_node_setups
|
||||
)
|
||||
|
||||
foreach(comp_test ${compositor_tests})
|
||||
add_python_test(
|
||||
compositor_${comp_test}_test
|
||||
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
|
||||
-blender "${TEST_BLENDER_EXE}"
|
||||
-testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
|
||||
-idiff "${OPENIMAGEIO_IDIFF}"
|
||||
-outdir "${TEST_OUT_DIR}/compositor"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
|
||||
if(WITH_OPENGL_DRAW_TESTS)
|
||||
if(NOT OPENIMAGEIO_IDIFF)
|
||||
MESSAGE(STATUS "Disabling OpenGL draw tests because OIIO idiff does not exist")
|
||||
|
|
64
tests/python/compositor_render_tests.py
Normal file
64
tests/python/compositor_render_tests.py
Normal file
|
@ -0,0 +1,64 @@
|
|||
#!/usr/bin/env python3
|
||||
# Apache License, Version 2.0
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shlex
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
# When run from inside Blender, render and exit.
|
||||
try:
|
||||
import bpy
|
||||
inside_blender = True
|
||||
except ImportError:
|
||||
inside_blender = False
|
||||
|
||||
def get_arguments(filepath, output_filepath):
|
||||
return [
|
||||
"--background",
|
||||
"-noaudio",
|
||||
"--factory-startup",
|
||||
"--enable-autoexec",
|
||||
"--debug-memory",
|
||||
"--debug-exit-on-error",
|
||||
filepath,
|
||||
"-P",
|
||||
os.path.realpath(__file__),
|
||||
"-o", output_filepath,
|
||||
"-F", "PNG",
|
||||
"-f", "1"]
|
||||
|
||||
|
||||
def create_argparse():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-blender", nargs="+")
|
||||
parser.add_argument("-testdir", nargs=1)
|
||||
parser.add_argument("-outdir", nargs=1)
|
||||
parser.add_argument("-idiff", nargs=1)
|
||||
return parser
|
||||
|
||||
|
||||
def main():
|
||||
parser = create_argparse()
|
||||
args = parser.parse_args()
|
||||
|
||||
blender = args.blender[0]
|
||||
test_dir = args.testdir[0]
|
||||
idiff = args.idiff[0]
|
||||
output_dir = args.outdir[0]
|
||||
|
||||
from modules import render_report
|
||||
report = render_report.Report("Compositor", output_dir, idiff)
|
||||
report.set_pixelated(True)
|
||||
report.set_reference_dir("compositor_renders")
|
||||
ok = report.run(test_dir, blender, get_arguments, batch=True)
|
||||
|
||||
sys.exit(not ok)
|
||||
|
||||
|
||||
if not inside_blender and __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Reference in a new issue