From 28ea90f127713d202e90cf92f7850af61573ef5c Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 17 Dec 2024 13:28:21 +0100 Subject: [PATCH] GPU: Split GPU backend and Draw manager unit tests Both the draw manager and gpu backend used the same compilation directive for enablement. This PR seperates them into `WITH_GPU_DRAW_TESTS` for draw manager related tests and `WITH_GPU_BACKEND_TESTS` for gpu backend related tests. Pull Request: https://projects.blender.org/blender/blender/pulls/132018 --- CMakeLists.txt | 6 +++++- build_files/windows/parse_arguments.cmd | 2 +- source/blender/gpu/CMakeLists.txt | 8 ++++---- source/blender/gpu/intern/gpu_shader_create_info_list.hh | 2 +- tests/python/CMakeLists.txt | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c2cb2b1680..198095a1411 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -829,8 +829,12 @@ Run GPU render tests silently (finished tests will pass). \ Generated report will show failing tests" ON ) +option(WITH_GPU_BACKEND_TESTS "\ +Enable GPU backend related unit testing" + OFF +) option(WITH_GPU_DRAW_TESTS "\ -Enable GPU drawing related unit testing (GPU backends and draw manager)" +Enable GPU drawing related unit testing (draw manager)" OFF ) option(WITH_COMPOSITOR_REALTIME_TESTS "Enable regression testing for realtime compositor" OFF) diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd index 4532bcd7e26..2b5ee28ab77 100644 --- a/build_files/windows/parse_arguments.cmd +++ b/build_files/windows/parse_arguments.cmd @@ -18,7 +18,7 @@ if NOT "%1" == "" ( ) else if "%1" == "with_tests" ( set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_GTESTS=On ) else if "%1" == "with_gpu_tests" ( - set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_GPU_DRAW_TESTS=On -DWITH_GPU_RENDER_TESTS=On -DWITH_GPU_RENDER_TESTS_SILENT=Off + set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_GPU_BACKEND_TESTS=On -DWITH_GPU_DRAW_TESTS=On -DWITH_GPU_RENDER_TESTS=On -DWITH_GPU_RENDER_TESTS_SILENT=Off ) else if "%1" == "full" ( set TARGET=Full set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^ diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 2fefe5958af..74c24dd07bc 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -685,7 +685,7 @@ set(MSL_SRC ) if(WITH_GTESTS) - if(WITH_GPU_DRAW_TESTS) + if(WITH_GPU_BACKEND_TESTS) list(APPEND GLSL_SRC ${GLSL_SRC_TEST}) endif() endif() @@ -736,8 +736,8 @@ if(WITH_OPENCOLORIO) add_definitions(-DWITH_OCIO) endif() -if(WITH_GPU_DRAW_TESTS) - add_definitions(-DWITH_GPU_DRAW_TESTS) +if(WITH_GPU_BACKEND_TESTS) + add_definitions(-DWITH_GPU_BACKEND_TESTS) endif() if(WITH_GTESTS) @@ -778,7 +778,7 @@ if(WITH_GTESTS) bf_windowmanager ) - if(WITH_GPU_DRAW_TESTS) + if(WITH_GPU_BACKEND_TESTS) list(APPEND TEST_SRC tests/buffer_texture_test.cc tests/compute_test.cc diff --git a/source/blender/gpu/intern/gpu_shader_create_info_list.hh b/source/blender/gpu/intern/gpu_shader_create_info_list.hh index d7c80aac4c4..eeb013ac903 100644 --- a/source/blender/gpu/intern/gpu_shader_create_info_list.hh +++ b/source/blender/gpu/intern/gpu_shader_create_info_list.hh @@ -39,7 +39,7 @@ #include "gpu_srgb_to_framebuffer_space_info.hh" #ifdef WITH_GTESTS -# ifdef WITH_GPU_DRAW_TESTS +# ifdef WITH_GPU_BACKEND_TESTS # include "gpu_shader_test_info.hh" # endif #endif diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index ef00c34fa52..09d6f99546d 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -988,7 +988,7 @@ else() endif() -if(WITH_GPU_DRAW_TESTS) +if(WITH_GPU_RENDER_TESTS) if(NOT OPENIMAGEIO_TOOL) message(STATUS "Disabling OpenGL draw tests because OIIO oiiotool does not exist") elseif(NOT EXISTS "${TEST_SRC_DIR}/opengl")