diff options
Diffstat (limited to 'source/blender/draw/tests')
-rw-r--r-- | source/blender/draw/tests/draw_testing.cc | 4 | ||||
-rw-r--r-- | source/blender/draw/tests/draw_testing.hh | 8 | ||||
-rw-r--r-- | source/blender/draw/tests/shaders_test.cc | 18 |
3 files changed, 21 insertions, 9 deletions
diff --git a/source/blender/draw/tests/draw_testing.cc b/source/blender/draw/tests/draw_testing.cc index 0104437e921..45a857e7577 100644 --- a/source/blender/draw/tests/draw_testing.cc +++ b/source/blender/draw/tests/draw_testing.cc @@ -9,9 +9,9 @@ namespace blender::draw { /* Base class for draw test cases. It will setup and tear down the GPU part around each test. */ -void DrawTest::SetUp() +void DrawOpenGLTest::SetUp() { - GPUTest::SetUp(); + GPUOpenGLTest::SetUp(); DRW_draw_state_init_gtests(GPU_SHADER_CFG_DEFAULT); } diff --git a/source/blender/draw/tests/draw_testing.hh b/source/blender/draw/tests/draw_testing.hh index ec0b15b611e..00f0ac5bab7 100644 --- a/source/blender/draw/tests/draw_testing.hh +++ b/source/blender/draw/tests/draw_testing.hh @@ -5,9 +5,15 @@ namespace blender::draw { /* Base class for draw test cases. It will setup and tear down the GPU part around each test. */ -class DrawTest : public blender::gpu::GPUTest { +class DrawOpenGLTest : public blender::gpu::GPUOpenGLTest { public: void SetUp() override; }; +#define DRAW_TEST(test_name) \ + TEST_F(DrawOpenGLTest, test_name) \ + { \ + test_##test_name(); \ + } + } // namespace blender::draw diff --git a/source/blender/draw/tests/shaders_test.cc b/source/blender/draw/tests/shaders_test.cc index cce69714f5e..0c7cbd4dac8 100644 --- a/source/blender/draw/tests/shaders_test.cc +++ b/source/blender/draw/tests/shaders_test.cc @@ -22,7 +22,7 @@ namespace blender::draw { -TEST_F(DrawTest, workbench_glsl_shaders) +static void test_workbench_glsl_shaders() { workbench_shader_library_ensure(); @@ -155,8 +155,9 @@ TEST_F(DrawTest, workbench_glsl_shaders) workbench_shader_free(); } +DRAW_TEST(workbench_glsl_shaders) -TEST_F(DrawTest, gpencil_glsl_shaders) +static void test_gpencil_glsl_shaders() { EXPECT_NE(GPENCIL_shader_antialiasing(0), nullptr); EXPECT_NE(GPENCIL_shader_antialiasing(1), nullptr); @@ -177,8 +178,9 @@ TEST_F(DrawTest, gpencil_glsl_shaders) GPENCIL_shader_free(); } +DRAW_TEST(gpencil_glsl_shaders) -TEST_F(DrawTest, image_glsl_shaders) +static void test_image_glsl_shaders() { IMAGE_shader_library_ensure(); @@ -187,8 +189,9 @@ TEST_F(DrawTest, image_glsl_shaders) IMAGE_shader_free(); } +DRAW_TEST(image_glsl_shaders) -TEST_F(DrawTest, overlay_glsl_shaders) +static void test_overlay_glsl_shaders() { OVERLAY_shader_library_ensure(); @@ -280,8 +283,9 @@ TEST_F(DrawTest, overlay_glsl_shaders) OVERLAY_shader_free(); } +DRAW_TEST(overlay_glsl_shaders) -TEST_F(DrawTest, eevee_glsl_shaders_static) +static void test_eevee_glsl_shaders_static() { EEVEE_shaders_material_shaders_init(); @@ -370,6 +374,7 @@ TEST_F(DrawTest, eevee_glsl_shaders_static) EXPECT_NE(EEVEE_shaders_effect_reflection_resolve_sh_get(), nullptr); EEVEE_shaders_free(); } +DRAW_TEST(eevee_glsl_shaders_static) static void test_draw_shaders(eParticleRefineShaderType sh_type) { @@ -378,7 +383,7 @@ static void test_draw_shaders(eParticleRefineShaderType sh_type) DRW_shaders_free(); } -TEST_F(DrawTest, draw_glsl_shaders) +static void test_draw_glsl_shaders() { #ifndef __APPLE__ test_draw_shaders(PART_REFINE_SHADER_TRANSFORM_FEEDBACK); @@ -386,5 +391,6 @@ TEST_F(DrawTest, draw_glsl_shaders) #endif test_draw_shaders(PART_REFINE_SHADER_TRANSFORM_FEEDBACK_WORKAROUND); } +DRAW_TEST(draw_glsl_shaders) } // namespace blender::draw |