1 /* Test Evas GL EAPIs.
2  *
3  * This will try with opengl_x11 and buffer (OSMesa) and silently fail if
4  * the engine or the GL library can't be initialized. This is to test Evas GL
5  * APIs when they can actually work, ie. when OSMesa exists or when the engine
6  * is GL.
7  */
8 
9 #ifdef HAVE_CONFIG_H
10 # include "config.h"
11 #endif
12 
13 #include <stdio.h>
14 
15 #ifdef _WIN32
16 # include <evil_private.h> /* dlopen */
17 #else
18 # include <dlfcn.h>
19 #endif
20 
21 #define EFL_GFX_FILTER_BETA
22 
23 #include <Evas.h>
24 #include <Evas_GL.h>
25 #include <Ecore_Evas.h>
26 
27 #include "evas_suite.h"
28 
29 static int
_detect_osmesa(void)30 _detect_osmesa(void)
31 {
32    /* assume that if libOSMesa.so links, then we can create an Evas GL */
33    void *lib = dlopen("libOSMesa.so", RTLD_NOW);
34    if (!lib)
35      {
36         printf("Could not find OSMesa! Skipping Evas GL tests.\n");
37         return 0;
38      }
39    dlclose(lib);
40    return 1;
41 }
42 
43 #define START_EVASGL_TEST(engine, options) \
44    Ecore_Evas *ee; Evas *evas; Evas_Object *im = NULL; \
45    if (!strcmp(engine, "buffer") && !_detect_osmesa()) return; \
46    putenv("EVAS_GL_API_DEBUG=1"); \
47    if (!options || !strcmp(engine, "buffer")) ee = ecore_evas_new(engine, 0, 0, 1, 1, NULL); \
48    else ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 1, 1, options); \
49    if (!ee) { printf("Could not create ecore evas. Skipping Evas GL tests.\n"); \
50               goto init_failed; } \
51    ecore_evas_show(ee); \
52    ecore_evas_manual_render_set(ee, EINA_TRUE); \
53    evas = ecore_evas_get(ee); \
54    im = evas_object_image_filled_add(evas); \
55    evas_object_geometry_set(im, 0, 0, 1, 1); \
56    evas_object_show(im); \
57    ecore_evas_manual_render(ee); \
58    do {} while (0)
59 
60 #define END_EVASGL_TEST() \
61    init_failed: \
62    evas_object_del(im); \
63    ecore_evas_free(ee); \
64    do {} while (0)
65 
66 static void
_test_evasgl_init(const char * engine)67 _test_evasgl_init(const char *engine)
68 {
69    START_EVASGL_TEST(engine, NULL);
70    Evas_GL_Context *ctx;
71    Evas_GL_Surface *sfc;
72    Evas_GL_Config *cfg;
73    Evas_GL_API *gl;
74    Evas_GL *evgl;
75 
76    fail_if(!(evgl = evas_gl_new(evas)));
77    fail_if(!(cfg = evas_gl_config_new()));
78    fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1)));
79    fail_if(!(ctx = evas_gl_context_create(evgl, NULL)));
80 
81    /* valid current states */
82    fail_if(!evas_gl_make_current(evgl, sfc, ctx));
83    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
84 
85    /* no context but surface: invalid */
86    fprintf(stderr, "================ IGNORE ERRORS BEGIN ================\n");
87    fail_if(evas_gl_make_current(evgl, sfc, NULL) != EINA_FALSE);
88    fprintf(stderr, "================  IGNORE ERRORS END  ================\n");
89 
90    /* API verification */
91    fail_if(!(gl = evas_gl_api_get(evgl)));
92 
93    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
94    evas_gl_context_destroy(evgl, ctx);
95    evas_gl_surface_destroy(evgl, sfc);
96    evas_gl_config_free(cfg);
97    evas_gl_free(evgl);
98 
99    END_EVASGL_TEST();
100 }
101 
102 static void
_test_evasgl_current_get(const char * engine)103 _test_evasgl_current_get(const char *engine)
104 {
105    START_EVASGL_TEST(engine, NULL);
106    Evas_GL_Context *ctx, *ctx2;
107    Evas_GL_Surface *sfc, *sfc2;
108    Evas_GL_Config *cfg;
109    Evas_GL *evgl, *evgl2;
110 
111    ctx2 = (void*)(intptr_t)0x1;
112    sfc2 = (void*)(intptr_t)0x1;
113    evgl2 = evas_gl_current_evas_gl_get(&ctx2, &sfc2);
114    fail_if(evgl2 || ctx2 || sfc2);
115 
116    fail_if(!(evgl = evas_gl_new(evas)));
117    fail_if(!(cfg = evas_gl_config_new()));
118    fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1)));
119    fail_if(!(ctx = evas_gl_context_create(evgl, NULL)));
120 
121    ctx2 = (void*)(intptr_t)0x1;
122    sfc2 = (void*)(intptr_t)0x1;
123    evgl2 = evas_gl_current_evas_gl_get(&ctx2, &sfc2);
124    fail_if(evgl2 || ctx2 || sfc2);
125 
126    fail_if(!evas_gl_make_current(evgl, sfc, ctx));
127    evgl2 = evas_gl_current_evas_gl_get(&ctx2, &sfc2);
128    fail_if(evgl2 != evgl);
129    fail_if(sfc2 != sfc);
130    fail_if(ctx2 != ctx);
131    fail_if(evas_gl_current_surface_get(evgl) != sfc);
132    fail_if(evas_gl_current_context_get(evgl) != ctx);
133 
134    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
135    evgl2 = evas_gl_current_evas_gl_get(&ctx2, &sfc2);
136    fail_if(evgl2 != evgl); /* this should not reset current Evas GL */
137    fail_if(sfc2 != NULL);
138    fail_if(ctx2 != NULL);
139    fail_if(evas_gl_current_surface_get(evgl));
140    fail_if(evas_gl_current_context_get(evgl));
141 
142    evas_gl_context_destroy(evgl, ctx);
143    evas_gl_surface_destroy(evgl, sfc);
144    evas_gl_free(evgl);
145    END_EVASGL_TEST();
146 }
147 
148 static void
_test_evasgl_context_version(const char * engine)149 _test_evasgl_context_version(const char *engine)
150 {
151    START_EVASGL_TEST(engine, NULL);
152    Evas_GL_Context *ctx, *ctx2;
153    Evas_GL_Surface *sfc;
154    Evas_GL_Config *cfg;
155    Evas_GL_API *gl;
156    Evas_GL *evgl;
157    const char *ver, *ext, *glsl;
158    int vmaj, vmin;
159 
160    fail_if(!(evgl = evas_gl_new(evas)));
161    fail_if(!(cfg = evas_gl_config_new()));
162    fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1)));
163 
164    /* test only GLES 2 - GLES 3 and GLES 1 not supported yet with OSMesa */
165    fail_if(!(ctx = evas_gl_context_version_create(evgl, NULL, EVAS_GL_GLES_2_X)));
166    fail_if(!(gl = evas_gl_api_get(evgl)));
167    fail_if(gl->version != EVAS_GL_API_VERSION); /* valid for make check */
168 
169    fail_if(!evas_gl_make_current(evgl, sfc, ctx));
170    fail_if(!(ver = (const char *) gl->glGetString(GL_VERSION)));
171    printf("GL_VERSION: %s\n", ver);
172    fail_if(sscanf(ver, "OpenGL ES %d.%d", &vmaj, &vmin) != 2);
173    fail_if((vmaj < 2) || (vmin < 0));
174 
175    /* verify function pointers - GLES 2 only */
176    typedef void (*fptr_t)();
177    const int idx_glViewport = ((char*) &gl->glViewport - (char*) &gl->glActiveTexture) / sizeof(fptr_t);
178    fptr_t *fptr= &gl->glActiveTexture;
179    for (int i = 0; i < idx_glViewport; i++, fptr++)
180      fail_if(!*fptr);
181 
182    /* mesa supports a ton of extensions but there are no extra pointers set in
183     * Evas_GL_API for those extensions */
184    fail_if(!(ext = (const char *) gl->glGetString(GL_EXTENSIONS)));
185    printf("GL_EXTENSIONS: %s\n", ext);
186 
187    /* GLSL string format check */
188    fail_if(!(glsl = (const char *) gl->glGetString(GL_SHADING_LANGUAGE_VERSION)));
189    printf("GL_SHADING_LANGUAGE_VERSION: %s\n", glsl);
190    fail_if(sscanf(glsl, "OpenGL ES GLSL ES %d", &vmaj) != 1);
191 
192    /* shared ctx */
193    fail_if(!(ctx2 = evas_gl_context_version_create(evgl, ctx, EVAS_GL_GLES_2_X)));
194    evas_gl_context_destroy(evgl, ctx2);
195 
196    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
197    evas_gl_context_destroy(evgl, ctx);
198    evas_gl_surface_destroy(evgl, sfc);
199    evas_gl_free(evgl);
200    END_EVASGL_TEST();
201 }
202 
203 static void
_test_evasgl_surfaceless_context(const char * engine)204 _test_evasgl_surfaceless_context(const char *engine)
205 {
206    START_EVASGL_TEST(engine, NULL);
207    Evas_GL_Context *ctx;
208    Evas_GL_Surface *sfc;
209    Evas_GL_Config *cfg;
210    Evas_GL_API *gl;
211    Evas_GL *evgl;
212    const char *eexts;
213 
214    fail_if(!(evgl = evas_gl_new(evas)));
215    fail_if(!(ctx = evas_gl_context_create(evgl, NULL)));
216 
217    // FIXME: evas_gl_string_query will fail before the first make_current (GL)
218    fail_if(!(cfg = evas_gl_config_new()));
219    fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1)));
220    fail_if(!evas_gl_make_current(evgl, sfc, ctx));
221    // FIXME
222 
223    fail_if(!(gl = evas_gl_context_api_get(evgl, ctx)));
224 
225    eexts = evas_gl_string_query(evgl, EVAS_GL_EXTENSIONS);
226    if (eexts && strstr(eexts, "EGL_KHR_surfaceless_context"))
227      {
228         fail_if(!evas_gl_make_current(evgl, NULL, ctx));
229         fail_if(!gl->glGetString(GL_VERSION));
230      }
231    else printf("Surfaceless context not supported. Skipped.\n");
232 
233    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
234    evas_gl_context_destroy(evgl, ctx);
235    evas_gl_surface_destroy(evgl, sfc);
236    evas_gl_config_free(cfg);
237    evas_gl_free(evgl);
238    END_EVASGL_TEST();
239 }
240 
241 static void
_test_evasgl_glreadpixels(const char * engine)242 _test_evasgl_glreadpixels(const char *engine)
243 {
244    /* simple test verifying surface render works as expected */
245 
246    START_EVASGL_TEST(engine, NULL);
247    Evas_GL_Context *ctx;
248    Evas_GL_Surface *sfc;
249    Evas_GL_Config *cfg;
250    Evas_GL_API *gl;
251    Evas_GL *evgl;
252    unsigned int pixel;
253 
254    fail_if(!(evgl = evas_gl_new(evas)));
255    fail_if(!(cfg = evas_gl_config_new()));
256    fail_if(!(ctx = evas_gl_context_create(evgl, NULL)));
257    fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1)));
258    fail_if(!evas_gl_make_current(evgl, sfc, ctx));
259    fail_if(!(gl = evas_gl_context_api_get(evgl, ctx)));
260 
261    gl->glClearColor(0, 1, 0, 1);
262    gl->glClear(GL_COLOR_BUFFER_BIT);
263    gl->glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
264    fail_if(gl->glGetError() != GL_NO_ERROR);
265    fail_if(pixel != 0xFF00FF00);
266 
267    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
268    evas_gl_context_destroy(evgl, ctx);
269    evas_gl_surface_destroy(evgl, sfc);
270    evas_gl_config_free(cfg);
271    evas_gl_free(evgl);
272    END_EVASGL_TEST();
273 }
274 
275 static void
_test_evasgl_fbo(const char * engine)276 _test_evasgl_fbo(const char *engine)
277 {
278    /* simple test verifying FBO render works as expected */
279 
280    START_EVASGL_TEST(engine, NULL);
281    Evas_GL_Context *ctx;
282    Evas_GL_Surface *sfc;
283    Evas_GL_Config *cfg;
284    Evas_GL_API *gl;
285    Evas_GL *evgl;
286    unsigned int pixel;
287    GLuint fbo, tex, vtx, frg, prg, u;
288    GLint status;
289 
290    static const char *vertex =
291          "#ifdef GL_ES\n"
292          "precision mediump float;\n"
293          "#endif\n"
294          "attribute vec4 vertex;\n"
295          "void main()\n"
296          "{\n"
297          "   gl_Position = vertex;\n"
298          "}\n";
299    static const char *fragment =
300          "#ifdef GL_ES\n"
301          "precision mediump float;\n"
302          "#endif\n"
303          "uniform vec4 color;\n"
304          "void main()\n"
305          "{\n"
306          "   gl_FragColor = color;\n"
307          "}\n";
308    static const GLfloat color[] = { 1, 0, 0, 1 };
309    static const GLfloat vertices[] = {
310        1.0,  1.0,  0.0,
311       -1.0, -1.0,  0.0,
312        1.0, -1.0,  0.0,
313        1.0,  1.0,  0.0,
314       -1.0,  1.0,  0.0,
315       -1.0, -1.0,  0.0
316    };
317 
318    /* surface & context */
319    fail_if(!(evgl = evas_gl_new(evas)));
320    fail_if(!(cfg = evas_gl_config_new()));
321    cfg->color_format = EVAS_GL_RGBA_8888;
322    fail_if(!(ctx = evas_gl_context_create(evgl, NULL)));
323    fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1)));
324    fail_if(!evas_gl_make_current(evgl, sfc, ctx));
325    fail_if(!(gl = evas_gl_context_api_get(evgl, ctx)));
326 
327    /* generate fbo */
328    gl->glGenFramebuffers(1, &fbo);
329    gl->glGenTextures(1, &tex);
330    gl->glBindFramebuffer(GL_FRAMEBUFFER, fbo);
331    gl->glBindTexture(GL_TEXTURE_2D, tex);
332    gl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
333    gl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
334    gl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
335    gl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
336    gl->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
337    gl->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
338    fail_if(gl->glGetError() != GL_NO_ERROR);
339 
340    /* prepare program */
341    vtx = gl->glCreateShader(GL_VERTEX_SHADER);
342    gl->glShaderSource(vtx, 1, &vertex, NULL);
343    gl->glCompileShader(vtx);
344    gl->glGetShaderiv(vtx, GL_COMPILE_STATUS, &status);
345    fail_if((gl->glGetError() != GL_NO_ERROR) || !status);
346    frg = gl->glCreateShader(GL_FRAGMENT_SHADER);
347    gl->glShaderSource(frg, 1, &fragment, NULL);
348    gl->glCompileShader(frg);
349    gl->glGetShaderiv(frg, GL_COMPILE_STATUS, &status);
350    fail_if((gl->glGetError() != GL_NO_ERROR) || !status);
351    prg = gl->glCreateProgram();
352    gl->glAttachShader(prg, vtx);
353    gl->glAttachShader(prg, frg);
354    gl->glBindAttribLocation(prg, 0, "vertex");
355    gl->glLinkProgram(prg);
356    gl->glGetProgramiv(prg, GL_LINK_STATUS, &status);
357    fail_if((gl->glGetError() != GL_NO_ERROR) || !status);
358 
359    /* clear */
360    gl->glClearColor(0, 0, 0, 0);
361    gl->glClear(GL_COLOR_BUFFER_BIT);
362    fail_if(gl->glGetError() != GL_NO_ERROR);
363 
364    /* set parameters */
365    gl->glUseProgram(prg);
366    u = gl->glGetUniformLocation(prg, "color");
367    gl->glUniform4fv(u, 1, color);
368    gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vertices);
369    gl->glEnableVertexAttribArray(0);
370    fail_if(gl->glGetError() != GL_NO_ERROR);
371 
372    /* draw */
373    gl->glDrawArrays(GL_TRIANGLES, 0, 6);
374    gl->glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
375    fail_if(gl->glGetError() != GL_NO_ERROR);
376    fail_if(pixel != 0xFF0000FF);
377 
378    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
379    evas_gl_context_destroy(evgl, ctx);
380    evas_gl_surface_destroy(evgl, sfc);
381    evas_gl_config_free(cfg);
382    evas_gl_free(evgl);
383    END_EVASGL_TEST();
384 }
385 
386 static void
_test_evasgl_pbuffer(const char * engine)387 _test_evasgl_pbuffer(const char *engine)
388 {
389    /* check support for PBuffer */
390 
391    // FIXME: No SW engine support!
392    if (!strcmp(engine, "buffer"))
393      {
394         printf("PBuffer not supported (SW engine). Skipped.\n");
395         return;
396      }
397 
398    START_EVASGL_TEST(engine, NULL);
399    Evas_GL_Context *ctx;
400    Evas_GL_Surface *sfc;
401    Evas_GL_Config *cfg;
402    Evas_GL_API *gl;
403    Evas_GL *evgl;
404    unsigned int pixel;
405 
406    fail_if(!(evgl = evas_gl_new(evas)));
407    fail_if(!(cfg = evas_gl_config_new()));
408    cfg->color_format = EVAS_GL_RGBA_8888;
409    fail_if(!(ctx = evas_gl_context_create(evgl, NULL)));
410    fail_if(!(sfc = evas_gl_pbuffer_surface_create(evgl, cfg, 1, 1, NULL)));
411    fail_if(!evas_gl_make_current(evgl, sfc, ctx));
412    fail_if(!(gl = evas_gl_context_api_get(evgl, ctx)));
413 
414    /* clear */
415    gl->glClearColor(0, 1, 0, 1);
416    gl->glClear(GL_COLOR_BUFFER_BIT);
417    gl->glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
418    fail_if(gl->glGetError() != GL_NO_ERROR);
419    fail_if(pixel != 0xFF00FF00);
420 
421    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
422    evas_gl_context_destroy(evgl, ctx);
423    evas_gl_surface_destroy(evgl, sfc);
424    evas_gl_config_free(cfg);
425    evas_gl_free(evgl);
426    END_EVASGL_TEST();
427 }
428 
429 static void
_test_evasgl_formats(const char * engine)430 _test_evasgl_formats(const char *engine)
431 {
432    /* check that Evas GL always falls back to working surface configs */
433 
434    const int options[] = { ECORE_EVAS_GL_X11_OPT_GL_DEPTH, 24,
435                            ECORE_EVAS_GL_X11_OPT_GL_STENCIL, 8,
436                            ECORE_EVAS_GL_X11_OPT_GL_MSAA, 4,
437                            0 };
438    const int *opts = options;
439 
440    START_EVASGL_TEST(engine, opts);
441    Evas_GL_Context *ctx;
442    Evas_GL_Surface *sfc;
443    Evas_GL_Config *cfg;
444    Evas_GL *evgl;
445 
446    fail_if(!(evgl = evas_gl_new(evas)));
447    fail_if(!(cfg = evas_gl_config_new()));
448    fail_if(!(ctx = evas_gl_context_create(evgl, NULL)));
449 
450    // don't test DEPTH_32 or STENCIL_16
451    for (Evas_GL_Color_Format fmt = EVAS_GL_RGB_888; fmt < EVAS_GL_NO_FBO; fmt++)
452      for (Evas_GL_Depth_Bits depth = EVAS_GL_DEPTH_NONE; depth <= EVAS_GL_DEPTH_BIT_24; depth++)
453        for (Evas_GL_Stencil_Bits stencil = EVAS_GL_STENCIL_NONE; stencil <= EVAS_GL_STENCIL_BIT_8; stencil++)
454          for (Evas_GL_Options_Bits opt = EVAS_GL_OPTIONS_NONE; opt <= 2; opt += 2)
455            for (Evas_GL_Multisample_Bits msaa = EVAS_GL_MULTISAMPLE_NONE; msaa <= EVAS_GL_MULTISAMPLE_HIGH; msaa++)
456              {
457                 cfg->color_format = fmt;
458                 cfg->depth_bits = depth;
459                 cfg->stencil_bits = stencil;
460                 cfg->options_bits = opt;
461                 cfg->multisample_bits = msaa;
462                 cfg->gles_version = EVAS_GL_GLES_2_X;
463                 /*
464                 fprintf(stderr, "Testing surface %d %d %d %d %d\n",
465                         cfg->color_format, cfg->depth_bits, cfg->stencil_bits,
466                         cfg->multisample_bits, cfg->options_bits);
467                         */
468                 fail_if(!(sfc = evas_gl_surface_create(evgl, cfg, 1, 1)));
469                 fail_if(!evas_gl_make_current(evgl, sfc, ctx));
470                 fail_if(!evas_gl_make_current(evgl, NULL, NULL));
471                 evas_gl_surface_destroy(evgl, sfc);
472              }
473 
474    fail_if(!evas_gl_make_current(evgl, NULL, NULL));
475    evas_gl_context_destroy(evgl, ctx);
476    evas_gl_config_free(cfg);
477    evas_gl_free(evgl);
478    END_EVASGL_TEST();
479 }
480 
481 #define TEST_ADD_OPT(name, opt) \
482    EFL_START_TEST(evas ## name ## _opengl_x11) \
483    { name("opengl_x11"); } \
484    EFL_END_TEST \
485    EFL_START_TEST(evas ## name ## _buffer) \
486    { name("buffer"); } \
487    EFL_END_TEST
488 #define TEST_ADD(name) TEST_ADD_OPT(name, NULL)
489 
490 TEST_ADD(_test_evasgl_init)
TEST_ADD(_test_evasgl_current_get)491 TEST_ADD(_test_evasgl_current_get)
492 TEST_ADD(_test_evasgl_context_version)
493 TEST_ADD(_test_evasgl_surfaceless_context)
494 TEST_ADD(_test_evasgl_glreadpixels)
495 TEST_ADD(_test_evasgl_fbo)
496 TEST_ADD(_test_evasgl_formats)
497 TEST_ADD(_test_evasgl_pbuffer)
498 
499 /* APIs still to test:
500  *
501  * evas_gl_rotation_get
502  * evas_gl_surface_query
503  * evas_gl_error_get
504  * evas_gl_native_surface_get
505  * evas_gl_proc_address_get
506  *
507  * Most of these actually need support in SW engine to be improved.
508  */
509 
510 void evas_test_evasgl(TCase *tc)
511 {
512 #undef TEST_ADD
513 #define TEST_ADD(name) tcase_add_test(tc, evas ## name ## _opengl_x11);
514 
515    if (getenv("DISPLAY"))
516      {
517         TEST_ADD(_test_evasgl_init);
518         TEST_ADD(_test_evasgl_current_get);
519         TEST_ADD(_test_evasgl_context_version);
520         TEST_ADD(_test_evasgl_surfaceless_context);
521         TEST_ADD(_test_evasgl_glreadpixels);
522         TEST_ADD(_test_evasgl_fbo);
523         TEST_ADD(_test_evasgl_pbuffer);
524         TEST_ADD(_test_evasgl_formats);
525      }
526 
527 #undef TEST_ADD
528 #define TEST_ADD(name) tcase_add_test(tc, evas ## name ## _buffer);
529 
530    TEST_ADD(_test_evasgl_init);
531    TEST_ADD(_test_evasgl_current_get);
532    TEST_ADD(_test_evasgl_context_version);
533    TEST_ADD(_test_evasgl_surfaceless_context);
534    TEST_ADD(_test_evasgl_glreadpixels);
535    TEST_ADD(_test_evasgl_fbo);
536    TEST_ADD(_test_evasgl_pbuffer);
537    TEST_ADD(_test_evasgl_formats);
538 }
539