Blender
V3.3
source
blender
gpu
tests
gpu_testing.hh
Go to the documentation of this file.
1
/* SPDX-License-Identifier: Apache-2.0 */
2
3
#include "testing/testing.h"
4
5
#include "
GHOST_C-api.h
"
6
7
struct
GPUContext
;
8
9
namespace
blender::gpu
{
10
11
/* Test class that setups a GPUContext for test cases.
12
*
13
* Usage:
14
* TEST_F(GPUTest, my_gpu_test) {
15
* ...
16
* }
17
*/
18
class
GPUTest
:
public
::testing::Test {
19
private
:
20
GHOST_TDrawingContextType
draw_context_type =
GHOST_kDrawingContextTypeNone
;
21
GHOST_SystemHandle ghost_system;
22
GHOST_ContextHandle ghost_context;
23
struct
GPUContext
*
context
;
24
25
protected
:
26
GPUTest
(
GHOST_TDrawingContextType
draw_context_type) : draw_context_type(draw_context_type)
27
{
28
}
29
30
void
SetUp
()
override
;
31
void
TearDown
()
override
;
32
};
33
34
class
GPUOpenGLTest
:
public
GPUTest
{
35
public
:
36
GPUOpenGLTest
() :
GPUTest
(
GHOST_kDrawingContextTypeOpenGL
)
37
{
38
}
39
};
40
41
#define GPU_TEST(test_name) \
42
TEST_F(GPUOpenGLTest, test_name) \
43
{ \
44
test_##test_name(); \
45
}
46
47
}
// namespace blender::gpu
GHOST_C-api.h
GHOST C-API function and type declarations.
GHOST_TDrawingContextType
GHOST_TDrawingContextType
Definition:
GHOST_Types.h:148
GHOST_kDrawingContextTypeOpenGL
@ GHOST_kDrawingContextTypeOpenGL
Definition:
GHOST_Types.h:150
GHOST_kDrawingContextTypeNone
@ GHOST_kDrawingContextTypeNone
Definition:
GHOST_Types.h:149
GPUContext
struct GPUContext GPUContext
Definition:
GPU_context.h:27
blender::gpu::GPUOpenGLTest
Definition:
gpu_testing.hh:34
blender::gpu::GPUOpenGLTest::GPUOpenGLTest
GPUOpenGLTest()
Definition:
gpu_testing.hh:36
blender::gpu::GPUTest
Definition:
gpu_testing.hh:18
blender::gpu::GPUTest::GPUTest
GPUTest(GHOST_TDrawingContextType draw_context_type)
Definition:
gpu_testing.hh:26
blender::gpu::GPUTest::TearDown
void TearDown() override
Definition:
gpu_testing.cc:26
blender::gpu::GPUTest::SetUp
void SetUp() override
Definition:
gpu_testing.cc:15
blender::compositor::context
cl_context context
Definition:
COM_WorkScheduler.cc:73
blender::gpu
Definition:
gpu_backend.hh:15
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1