Blender V4.3
draw_testing.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#include "gpu_testing.hh"
6
7namespace blender::draw {
8
9/* Base class for draw test cases. It will setup and tear down the GPU part around each test. */
10#ifdef WITH_OPENGL_BACKEND
11class DrawOpenGLTest : public blender::gpu::GPUOpenGLTest {
12 public:
13 void SetUp() override;
14};
15
16# define DRAW_OPENGL_TEST(test_name) \
17 TEST_F(DrawOpenGLTest, test_name) \
18 { \
19 test_##test_name(); \
20 }
21#else
22# define DRAW_OPENGL_TEST(test_name)
23#endif
24
25#ifdef WITH_METAL_BACKEND
26class DrawMetalTest : public blender::gpu::GPUMetalTest {
27 public:
28 void SetUp() override;
29};
30
31# define DRAW_METAL_TEST(test_name) \
32 TEST_F(DrawMetalTest, test_name) \
33 { \
34 test_##test_name(); \
35 }
36#else
37# define DRAW_METAL_TEST(test_name)
38#endif
39
40#ifdef WITH_VULKAN_BACKEND
41class DrawVulkanTest : public blender::gpu::GPUVulkanTest {
42 public:
43 void SetUp() override;
44};
45
46# define DRAW_VULKAN_TEST(test_name) \
47 TEST_F(DrawVulkanTest, test_name) \
48 { \
49 test_##test_name(); \
50 }
51#else
52# define DRAW_VULKAN_TEST(test_name)
53#endif
54
55#define DRAW_TEST(test_name) \
56 DRAW_OPENGL_TEST(test_name) \
57 DRAW_METAL_TEST(test_name) \
58 DRAW_VULKAN_TEST(test_name)
59
60} // namespace blender::draw