Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-06-28 09:28:56 +0300
committerJeroen Bakker <jeroen@blender.org>2021-06-28 09:55:13 +0300
commitf53bd31690ad9e1ba91f0a23d8a3cdd6519c9cf7 (patch)
tree01cdfe0afdb63c8fdbbfa13f00faa61d5837efa4 /source/blender/gpu/tests/gpu_testing.hh
parente94ec7934173548f22bf1af24c16c301a777526b (diff)
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.
Diffstat (limited to 'source/blender/gpu/tests/gpu_testing.hh')
-rw-r--r--source/blender/gpu/tests/gpu_testing.hh18
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