summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-07-15 12:40:29 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-07-15 12:56:30 -0400
commitf30ef634adbb776cd04e65480faafb1fe297dc85 (patch)
treede230bc8982a20379277ebc41377db2bedf91aa1
parent3be7c844fd81cf9f21653ef831c6e0ec5cf4edbb (diff)
tests/ecore_wl2: Add start of Ecore_Wl2 Window tests
ref T8016
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_suite.c1
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_suite.h1
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_test_window.c52
-rw-r--r--src/tests/ecore_wl2/meson.build3
4 files changed, 56 insertions, 1 deletions
diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.c b/src/tests/ecore_wl2/ecore_wl2_suite.c
index 7f7d5fd107..b4285ccd62 100644
--- a/src/tests/ecore_wl2/ecore_wl2_suite.c
+++ b/src/tests/ecore_wl2/ecore_wl2_suite.c
@@ -11,6 +11,7 @@ static const Efl_Test_Case etc[] =
11#if HAVE_ECORE_WL2 11#if HAVE_ECORE_WL2
12 { "Ecore_Wl2", ecore_wl2_test_init }, 12 { "Ecore_Wl2", ecore_wl2_test_init },
13 { "Display", ecore_wl2_test_display }, 13 { "Display", ecore_wl2_test_display },
14 { "Window", ecore_wl2_test_window },
14#endif 15#endif
15 { NULL, NULL } 16 { NULL, NULL }
16}; 17};
diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.h b/src/tests/ecore_wl2/ecore_wl2_suite.h
index 2ff7074dcd..a344818814 100644
--- a/src/tests/ecore_wl2/ecore_wl2_suite.h
+++ b/src/tests/ecore_wl2/ecore_wl2_suite.h
@@ -6,5 +6,6 @@
6 6
7void ecore_wl2_test_init(TCase *tc); 7void ecore_wl2_test_init(TCase *tc);
8void ecore_wl2_test_display(TCase *tc); 8void ecore_wl2_test_display(TCase *tc);
9void ecore_wl2_test_window(TCase *tc);
9 10
10#endif 11#endif
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_window.c b/src/tests/ecore_wl2/ecore_wl2_test_window.c
new file mode 100644
index 0000000000..4608f767a6
--- /dev/null
+++ b/src/tests/ecore_wl2/ecore_wl2_test_window.c
@@ -0,0 +1,52 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdio.h>
6#include <unistd.h>
7#include <Eina.h>
8#include <Ecore.h>
9#include <Ecore_Wl2.h>
10
11#include "ecore_wl2_suite.h"
12
13static Ecore_Wl2_Display *
14_display_connect(void)
15{
16 Ecore_Wl2_Display *disp;
17
18 disp = ecore_wl2_display_connect(NULL);
19 return disp;
20}
21
22static Ecore_Wl2_Window *
23_window_create(Ecore_Wl2_Display *disp)
24{
25 Ecore_Wl2_Window *win;
26
27 win = ecore_wl2_window_new(disp, NULL, 100, 100, 500, 500);
28 return win;
29}
30
31EFL_START_TEST(wl2_window_new)
32{
33 Ecore_Wl2_Display *disp;
34 Ecore_Wl2_Window *win;
35
36 disp = _display_connect();
37 ck_assert(disp != NULL);
38
39 win = _window_create(disp);
40 ck_assert(win != NULL);
41}
42EFL_END_TEST
43
44void
45ecore_wl2_test_window(TCase *tc)
46{
47 if (getenv("WAYLAND_DISPLAY"))
48 {
49 /* window tests can only run if there is an existing compositor */
50 tcase_add_test(tc, wl2_window_new);
51 }
52}
diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build
index 97bce4eed7..70d9ed1e96 100644
--- a/src/tests/ecore_wl2/meson.build
+++ b/src/tests/ecore_wl2/meson.build
@@ -3,7 +3,8 @@ ecore_wl2_suite_src = [
3 'ecore_wl2_suite.h', 3 'ecore_wl2_suite.h',
4 'ecore_wl2_tests_helpers.h', 4 'ecore_wl2_tests_helpers.h',
5 'ecore_wl2_test_ecore_wl2.c', 5 'ecore_wl2_test_ecore_wl2.c',
6 'ecore_wl2_test_display.c' 6 'ecore_wl2_test_display.c',
7 'ecore_wl2_test_window.c'
7] 8]
8 9
9ecore_wl2_suite = executable('ecore_wl2_suite', 10ecore_wl2_suite = executable('ecore_wl2_suite',