From f53bd31690ad9e1ba91f0a23d8a3cdd6519c9cf7 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 28 Jun 2021 08:28:56 +0200 Subject: Cleanup GPU/Draw test cases. In preparation of supporting vulkan. Draw/GPU tests should use GPU_TEST or DRAW_TEST macros. These macros will run the test on available drawing context backends like OpenGL or Vulkan. As in master there is only an OpenGL backend nothing changed. --- source/blender/gpu/tests/gpu_testing.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/blender/gpu/tests/gpu_testing.hh') diff --git a/source/blender/gpu/tests/gpu_testing.hh b/source/blender/gpu/tests/gpu_testing.hh index cf902a91264..c45770cb94e 100644 --- a/source/blender/gpu/tests/gpu_testing.hh +++ b/source/blender/gpu/tests/gpu_testing.hh @@ -15,13 +15,31 @@ namespace blender::gpu { */ class GPUTest : public ::testing::Test { private: + GHOST_TDrawingContextType draw_context_type = GHOST_kDrawingContextTypeNone; GHOST_SystemHandle ghost_system; GHOST_ContextHandle ghost_context; struct GPUContext *context; protected: + GPUTest(GHOST_TDrawingContextType draw_context_type) : draw_context_type(draw_context_type) + { + } + void SetUp() override; void TearDown() override; }; +class GPUOpenGLTest : public GPUTest { + public: + GPUOpenGLTest() : GPUTest(GHOST_kDrawingContextTypeOpenGL) + { + } +}; + +#define GPU_TEST(test_name) \ + TEST_F(GPUOpenGLTest, test_name) \ + { \ + test_##test_name(); \ + } + } // namespace blender::gpu -- cgit v1.2.3