From 2b43ff596326dfea21e76abbcb247179d0aa31a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 4 Aug 2022 22:27:47 +0200 Subject: [PATCH] tests/cogl: Migrate texture rg test Part-of: --- cogl/tests/conform/meson.build | 1 - cogl/tests/conform/test-conform-main.c | 2 -- cogl/tests/conform/test-declarations.h | 1 - src/tests/cogl/conform/meson.build | 1 + .../tests/cogl}/conform/test-texture-rg.c | 15 ++++++++++++--- 5 files changed, 13 insertions(+), 7 deletions(-) rename {cogl/tests => src/tests/cogl}/conform/test-texture-rg.c (89%) diff --git a/cogl/tests/conform/meson.build b/cogl/tests/conform/meson.build index d5ebb67f1..b1ff85e1d 100644 --- a/cogl/tests/conform/meson.build +++ b/cogl/tests/conform/meson.build @@ -1,6 +1,5 @@ cogl_test_conformance_sources = [ 'test-conform-main.c', - 'test-texture-rg.c', 'test-fence.c', ] diff --git a/cogl/tests/conform/test-conform-main.c b/cogl/tests/conform/test-conform-main.c index 901e280d3..da214ce21 100644 --- a/cogl/tests/conform/test-conform-main.c +++ b/cogl/tests/conform/test-conform-main.c @@ -74,8 +74,6 @@ main (int argc, char **argv) ADD_TEST (test_fence, TEST_REQUIREMENT_FENCE, 0); - ADD_TEST (test_texture_rg, TEST_REQUIREMENT_TEXTURE_RG, 0); - g_printerr ("Unknown test name \"%s\"\n", argv[1]); return 1; diff --git a/cogl/tests/conform/test-declarations.h b/cogl/tests/conform/test-declarations.h index 37374b446..75c568a79 100644 --- a/cogl/tests/conform/test-declarations.h +++ b/cogl/tests/conform/test-declarations.h @@ -9,6 +9,5 @@ void test_gles2_context (void); void test_gles2_context_fbo (void); void test_gles2_context_copy_tex_image (void); void test_fence (void); -void test_texture_rg (void); #endif /* COGL_TEST_DECLARATIONS_H */ diff --git a/src/tests/cogl/conform/meson.build b/src/tests/cogl/conform/meson.build index 8aa8c4a5e..1d44f1828 100644 --- a/src/tests/cogl/conform/meson.build +++ b/src/tests/cogl/conform/meson.build @@ -37,6 +37,7 @@ cogl_tests = [ [ 'test-pipeline-cache-unrefs-texture', [] ], [ 'test-texture-no-allocate', [] ], [ 'test-pipeline-shader-state', [] ], + [ 'test-texture-rg', [] ], ] cogl_test_conformance_includes = [ diff --git a/cogl/tests/conform/test-texture-rg.c b/src/tests/cogl/conform/test-texture-rg.c similarity index 89% rename from cogl/tests/conform/test-texture-rg.c rename to src/tests/cogl/conform/test-texture-rg.c index e3ed2b529..6d476359e 100644 --- a/cogl/tests/conform/test-texture-rg.c +++ b/src/tests/cogl/conform/test-texture-rg.c @@ -2,8 +2,7 @@ #include -#include "test-declarations.h" -#include "test-utils.h" +#include "tests/cogl-test-utils.h" #define TEX_WIDTH 8 #define TEX_HEIGHT 8 @@ -29,7 +28,7 @@ make_texture (void) NULL); } -void +static void test_texture_rg (void) { CoglPipeline *pipeline; @@ -37,6 +36,12 @@ test_texture_rg (void) int fb_width, fb_height; int x, y; + if (!cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_RG)) + { + g_test_skip ("Missing TEXTURE_RG feature"); + return; + } + fb_width = cogl_framebuffer_get_width (test_fb); fb_height = cogl_framebuffer_get_height (test_fb); @@ -73,3 +78,7 @@ test_texture_rg (void) cogl_object_unref (pipeline); cogl_object_unref (tex); } + +COGL_TEST_SUITE ( + g_test_add_func ("/texture/rg", test_texture_rg); +)