From dd391d38f6ef2165bc76a1e69da52e1bd1208e53 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 28 Oct 2020 16:19:03 +0100 Subject: Tests: add CMake option to run Cycles regression tests on GPU devices CYCLES_TEST_DEVICES is a list of devices (CPU, CUDA, OPTIX, OPENCL). It is set to CPU only by default. Test output is now writen to build/tests/cycles/, and the HTML report has separate report pages for the different devices, with option to compare between CPU and GPU renders. Various GPU tests are still failing due to CPU/GPU differences, these are to be fixed or blacklisted still. Ref T82193 --- tests/python/CMakeLists.txt | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'tests/python/CMakeLists.txt') diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index 22426a6d6fc..52dafa83c7a 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -598,20 +598,28 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS) list(APPEND render_tests grease_pencil) endif() + # Cycles if(WITH_CYCLES) - foreach(render_test bake;${render_tests}) - add_python_test( - cycles_${render_test} - ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py - -blender "${TEST_BLENDER_EXE}" - -testdir "${TEST_SRC_DIR}/render/${render_test}" - -idiff "${OPENIMAGEIO_IDIFF}" - -outdir "${TEST_OUT_DIR}/cycles" - ) + foreach(_cycles_device ${CYCLES_TEST_DEVICES}) + string(TOLOWER "${_cycles_device}" _cycles_device_lower) + set(_cycles_render_tests bake;${render_tests}) + + foreach(render_test ${_cycles_render_tests}) + add_python_test( + cycles_${render_test}_${_cycles_device_lower} + ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py + -blender "${TEST_BLENDER_EXE}" + -testdir "${TEST_SRC_DIR}/render/${render_test}" + -idiff "${OPENIMAGEIO_IDIFF}" + -outdir "${TEST_OUT_DIR}/cycles" + -device ${_cycles_device} + ) + endforeach() endforeach() endif() if(WITH_OPENGL_RENDER_TESTS) + # Eevee foreach(render_test ${render_tests}) add_python_test( eevee_${render_test}_test @@ -624,6 +632,7 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS) endforeach() foreach(render_test ${render_tests}) + # Workbench add_python_test( workbench_${render_test}_test ${CMAKE_CURRENT_LIST_DIR}/workbench_render_tests.py -- cgit v1.2.3