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/gpu/tests/gpu_testing.hh')
-rw-r--r--source/blender/gpu/tests/gpu_testing.hh27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/gpu/tests/gpu_testing.hh b/source/blender/gpu/tests/gpu_testing.hh
new file mode 100644
index 00000000000..7e9203d2d7c
--- /dev/null
+++ b/source/blender/gpu/tests/gpu_testing.hh
@@ -0,0 +1,27 @@
+#include "testing/testing.h"
+
+#include "GHOST_C-api.h"
+
+struct GPUContext;
+
+namespace blender::gpu {
+
+/* Test class that setups a GPUContext for test cases.
+ *
+ * Usage:
+ * TEST_F(GPUTest, my_gpu_test) {
+ * ...
+ * }
+ */
+class GPUTest : public ::testing::Test {
+ private:
+ GHOST_SystemHandle ghost_system;
+ GHOST_ContextHandle ghost_context;
+ struct GPUContext *context;
+
+ protected:
+ void SetUp() override;
+ void TearDown() override;
+};
+
+} // namespace blender::gpu \ No newline at end of file