tests/cogl: Migrate fence test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
This commit is contained in:
parent
2b43ff5963
commit
5d40a5eeea
@ -1,6 +1,5 @@
|
|||||||
cogl_test_conformance_sources = [
|
cogl_test_conformance_sources = [
|
||||||
'test-conform-main.c',
|
'test-conform-main.c',
|
||||||
'test-fence.c',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
#unported = [
|
#unported = [
|
||||||
|
@ -72,8 +72,6 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
UNPORTED_TEST (test_viewport);
|
UNPORTED_TEST (test_viewport);
|
||||||
|
|
||||||
ADD_TEST (test_fence, TEST_REQUIREMENT_FENCE, 0);
|
|
||||||
|
|
||||||
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
|
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -8,6 +8,5 @@ void test_backface_culling (void);
|
|||||||
void test_gles2_context (void);
|
void test_gles2_context (void);
|
||||||
void test_gles2_context_fbo (void);
|
void test_gles2_context_fbo (void);
|
||||||
void test_gles2_context_copy_tex_image (void);
|
void test_gles2_context_copy_tex_image (void);
|
||||||
void test_fence (void);
|
|
||||||
|
|
||||||
#endif /* COGL_TEST_DECLARATIONS_H */
|
#endif /* COGL_TEST_DECLARATIONS_H */
|
||||||
|
@ -38,6 +38,7 @@ cogl_tests = [
|
|||||||
[ 'test-texture-no-allocate', [] ],
|
[ 'test-texture-no-allocate', [] ],
|
||||||
[ 'test-pipeline-shader-state', [] ],
|
[ 'test-pipeline-shader-state', [] ],
|
||||||
[ 'test-texture-rg', [] ],
|
[ 'test-texture-rg', [] ],
|
||||||
|
[ 'test-fence', [] ],
|
||||||
]
|
]
|
||||||
|
|
||||||
cogl_test_conformance_includes = [
|
cogl_test_conformance_includes = [
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
|
|
||||||
#include "test-declarations.h"
|
#include "tests/cogl-test-utils.h"
|
||||||
#include "test-utils.h"
|
|
||||||
#include "cogl-config.h"
|
|
||||||
|
|
||||||
/* I'm writing this on the train after having dinner at a churrascuria. */
|
/* I'm writing this on the train after having dinner at a churrascuria. */
|
||||||
#define MAGIC_CHUNK_O_DATA ((void *) 0xdeadbeef)
|
#define MAGIC_CHUNK_O_DATA ((void *) 0xdeadbeef)
|
||||||
@ -30,7 +28,7 @@ callback (CoglFence *fence,
|
|||||||
g_main_loop_quit (loop);
|
g_main_loop_quit (loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
test_fence (void)
|
test_fence (void)
|
||||||
{
|
{
|
||||||
GSource *cogl_source;
|
GSource *cogl_source;
|
||||||
@ -38,6 +36,12 @@ test_fence (void)
|
|||||||
int fb_height = cogl_framebuffer_get_height (test_fb);
|
int fb_height = cogl_framebuffer_get_height (test_fb);
|
||||||
CoglFenceClosure *closure;
|
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);
|
cogl_source = cogl_glib_source_new (test_ctx, G_PRIORITY_DEFAULT);
|
||||||
g_source_attach (cogl_source, NULL);
|
g_source_attach (cogl_source, NULL);
|
||||||
loop = g_main_loop_new (NULL, TRUE);
|
loop = g_main_loop_new (NULL, TRUE);
|
||||||
@ -58,3 +62,7 @@ test_fence (void)
|
|||||||
if (cogl_test_verbose ())
|
if (cogl_test_verbose ())
|
||||||
g_print ("OK\n");
|
g_print ("OK\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
COGL_TEST_SUITE (
|
||||||
|
g_test_add_func ("/fence", test_fence);
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user