diff --git a/cogl/tests/conform/meson.build b/cogl/tests/conform/meson.build index b1ff85e1d..6162775dd 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-fence.c', ] #unported = [ diff --git a/cogl/tests/conform/test-conform-main.c b/cogl/tests/conform/test-conform-main.c index da214ce21..df89197cd 100644 --- a/cogl/tests/conform/test-conform-main.c +++ b/cogl/tests/conform/test-conform-main.c @@ -72,8 +72,6 @@ main (int argc, char **argv) UNPORTED_TEST (test_viewport); - ADD_TEST (test_fence, TEST_REQUIREMENT_FENCE, 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 75c568a79..3faa4effc 100644 --- a/cogl/tests/conform/test-declarations.h +++ b/cogl/tests/conform/test-declarations.h @@ -8,6 +8,5 @@ void test_backface_culling (void); void test_gles2_context (void); void test_gles2_context_fbo (void); void test_gles2_context_copy_tex_image (void); -void test_fence (void); #endif /* COGL_TEST_DECLARATIONS_H */ diff --git a/src/tests/cogl/conform/meson.build b/src/tests/cogl/conform/meson.build index 1d44f1828..03781774c 100644 --- a/src/tests/cogl/conform/meson.build +++ b/src/tests/cogl/conform/meson.build @@ -38,6 +38,7 @@ cogl_tests = [ [ 'test-texture-no-allocate', [] ], [ 'test-pipeline-shader-state', [] ], [ 'test-texture-rg', [] ], + [ 'test-fence', [] ], ] cogl_test_conformance_includes = [ diff --git a/cogl/tests/conform/test-fence.c b/src/tests/cogl/conform/test-fence.c similarity index 86% rename from cogl/tests/conform/test-fence.c rename to src/tests/cogl/conform/test-fence.c index 6c429c1d7..b48abcc15 100644 --- a/cogl/tests/conform/test-fence.c +++ b/src/tests/cogl/conform/test-fence.c @@ -1,8 +1,6 @@ #include -#include "test-declarations.h" -#include "test-utils.h" -#include "cogl-config.h" +#include "tests/cogl-test-utils.h" /* I'm writing this on the train after having dinner at a churrascuria. */ #define MAGIC_CHUNK_O_DATA ((void *) 0xdeadbeef) @@ -30,7 +28,7 @@ callback (CoglFence *fence, g_main_loop_quit (loop); } -void +static void test_fence (void) { GSource *cogl_source; @@ -38,6 +36,12 @@ test_fence (void) int fb_height = cogl_framebuffer_get_height (test_fb); CoglFenceClosure *closure; + if (!cogl_has_feature (test_ctx, COGL_FEATURE_ID_FENCE)) + { + g_test_skip ("Missing fence support"); + return; + } + cogl_source = cogl_glib_source_new (test_ctx, G_PRIORITY_DEFAULT); g_source_attach (cogl_source, NULL); loop = g_main_loop_new (NULL, TRUE); @@ -58,3 +62,7 @@ test_fence (void) if (cogl_test_verbose ()) g_print ("OK\n"); } + +COGL_TEST_SUITE ( + g_test_add_func ("/fence", test_fence); +)