tests/ecore_wl2: Add start of Ecore_Wl2 Window tests

ref T8016
This commit is contained in:
Christopher Michael 2019-07-15 12:40:29 -04:00
parent 3be7c844fd
commit f30ef634ad
4 changed files with 56 additions and 1 deletions

View File

@ -11,6 +11,7 @@ static const Efl_Test_Case etc[] =
#if HAVE_ECORE_WL2
{ "Ecore_Wl2", ecore_wl2_test_init },
{ "Display", ecore_wl2_test_display },
{ "Window", ecore_wl2_test_window },
#endif
{ NULL, NULL }
};

View File

@ -6,5 +6,6 @@
void ecore_wl2_test_init(TCase *tc);
void ecore_wl2_test_display(TCase *tc);
void ecore_wl2_test_window(TCase *tc);
#endif

View File

@ -0,0 +1,52 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <unistd.h>
#include <Eina.h>
#include <Ecore.h>
#include <Ecore_Wl2.h>
#include "ecore_wl2_suite.h"
static Ecore_Wl2_Display *
_display_connect(void)
{
Ecore_Wl2_Display *disp;
disp = ecore_wl2_display_connect(NULL);
return disp;
}
static Ecore_Wl2_Window *
_window_create(Ecore_Wl2_Display *disp)
{
Ecore_Wl2_Window *win;
win = ecore_wl2_window_new(disp, NULL, 100, 100, 500, 500);
return win;
}
EFL_START_TEST(wl2_window_new)
{
Ecore_Wl2_Display *disp;
Ecore_Wl2_Window *win;
disp = _display_connect();
ck_assert(disp != NULL);
win = _window_create(disp);
ck_assert(win != NULL);
}
EFL_END_TEST
void
ecore_wl2_test_window(TCase *tc)
{
if (getenv("WAYLAND_DISPLAY"))
{
/* window tests can only run if there is an existing compositor */
tcase_add_test(tc, wl2_window_new);
}
}

View File

@ -3,7 +3,8 @@ ecore_wl2_suite_src = [
'ecore_wl2_suite.h',
'ecore_wl2_tests_helpers.h',
'ecore_wl2_test_ecore_wl2.c',
'ecore_wl2_test_display.c'
'ecore_wl2_test_display.c',
'ecore_wl2_test_window.c'
]
ecore_wl2_suite = executable('ecore_wl2_suite',