diff options
Diffstat (limited to 'source/blender/gpu/tests/gpu_testing.hh')
-rw-r--r-- | source/blender/gpu/tests/gpu_testing.hh | 18 |
1 files changed, 18 insertions, 0 deletions
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 |