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:
Diffstat (limited to 'source/blender/draw/tests/shaders_test.cc')
-rw-r--r--source/blender/draw/tests/shaders_test.cc30
1 files changed, 8 insertions, 22 deletions
diff --git a/source/blender/draw/tests/shaders_test.cc b/source/blender/draw/tests/shaders_test.cc
index a3a0b792a24..b73c94208b5 100644
--- a/source/blender/draw/tests/shaders_test.cc
+++ b/source/blender/draw/tests/shaders_test.cc
@@ -7,38 +7,22 @@
#include "GPU_context.h"
#include "GPU_init_exit.h"
#include "GPU_shader.h"
-
-#include "GHOST_C-api.h"
+#include "gpu_testing.hh"
#include "engines/eevee/eevee_private.h"
#include "engines/gpencil/gpencil_engine.h"
#include "engines/overlay/overlay_private.h"
#include "engines/workbench/workbench_private.h"
-/* Base class for draw test cases. It will setup and tear down the GPU part around each test. */
-class DrawTest : public ::testing::Test {
- private:
- GHOST_SystemHandle ghost_system;
- GHOST_ContextHandle ghost_context;
- GPUContext *context;
+namespace blender::draw {
+/* Base class for draw test cases. It will setup and tear down the GPU part around each test. */
+class DrawTest : public blender::gpu::GPUTest {
void SetUp() override
{
- GHOST_GLSettings glSettings = {0};
- ghost_system = GHOST_CreateSystem();
- ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings);
- context = GPU_context_create(0);
- GPU_init();
+ GPUTest::SetUp();
DRW_draw_state_init_gtests(GPU_SHADER_CFG_DEFAULT);
}
-
- void TearDown() override
- {
- GPU_exit();
- GPU_context_discard(context);
- GHOST_DisposeOpenGLContext(ghost_system, ghost_context);
- GHOST_DisposeSystem(ghost_system);
- }
};
TEST_F(DrawTest, workbench_glsl_shaders)
@@ -319,4 +303,6 @@ TEST_F(DrawTest, eevee_glsl_shaders_static)
EXPECT_NE(EEVEE_shaders_effect_screen_raytrace_sh_get(ssr_option), nullptr);
}
EEVEE_shaders_free();
-} \ No newline at end of file
+}
+
+} // namespace blender::draw \ No newline at end of file