1
0
Fork 0

tests/cogl: Migrate fence test

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
This commit is contained in:
Jonas Ådahl 2022-08-04 22:31:34 +02:00 committed by Marge Bot
parent 2b43ff5963
commit 5d40a5eeea
5 changed files with 13 additions and 8 deletions

View file

@ -1,6 +1,5 @@
cogl_test_conformance_sources = [
'test-conform-main.c',
'test-fence.c',
]
#unported = [

View file

@ -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;

View file

@ -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 */

View file

@ -38,6 +38,7 @@ cogl_tests = [
[ 'test-texture-no-allocate', [] ],
[ 'test-pipeline-shader-state', [] ],
[ 'test-texture-rg', [] ],
[ 'test-fence', [] ],
]
cogl_test_conformance_includes = [

View file

@ -1,8 +1,6 @@
#include <cogl/cogl.h>
#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);
)