summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-07-15 09:49:31 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-07-15 09:54:18 -0400
commit73acf72cc4333ac9b69765214d54b78db6c72715 (patch)
tree02d2264a211e742026e8008376c6eed575908fa9
parent3b28a0a0f5bf3ce7c5b4d710f91391476271f5f8 (diff)
tests: Add file for Ecore_Wl2 display tests
Add file which can be used to add tests for ecore_wl2 display functions 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_display.c39
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_tests_helpers.h17
-rw-r--r--src/tests/ecore_wl2/meson.build4
5 files changed, 61 insertions, 1 deletions
diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.c b/src/tests/ecore_wl2/ecore_wl2_suite.c
index 234a581ef0..7f7d5fd107 100644
--- a/src/tests/ecore_wl2/ecore_wl2_suite.c
+++ b/src/tests/ecore_wl2/ecore_wl2_suite.c
@@ -10,6 +10,7 @@ static const Efl_Test_Case etc[] =
10{ 10{
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#endif 14#endif
14 { NULL, NULL } 15 { NULL, NULL }
15}; 16};
diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.h b/src/tests/ecore_wl2/ecore_wl2_suite.h
index b17d8a767f..2ff7074dcd 100644
--- a/src/tests/ecore_wl2/ecore_wl2_suite.h
+++ b/src/tests/ecore_wl2/ecore_wl2_suite.h
@@ -5,5 +5,6 @@
5# include "../efl_check.h" 5# include "../efl_check.h"
6 6
7void ecore_wl2_test_init(TCase *tc); 7void ecore_wl2_test_init(TCase *tc);
8void ecore_wl2_test_display(TCase *tc);
8 9
9#endif 10#endif
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c
new file mode 100644
index 0000000000..e566ab8901
--- /dev/null
+++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c
@@ -0,0 +1,39 @@
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#include "ecore_wl2_tests_helpers.h"
13
14EFL_START_TEST(wl2_display_create)
15{
16 Ecore_Wl2_Display *disp;
17
18 disp = ECORE_WL2_TEST_DISPLAY_SETUP();
19 ck_assert(disp != NULL);
20}
21EFL_END_TEST
22
23EFL_START_TEST(wl2_display_destroy)
24{
25 Ecore_Wl2_Display *disp;
26
27 disp = ECORE_WL2_TEST_DISPLAY_SETUP();
28 ck_assert(disp != NULL);
29
30 ecore_wl2_display_destroy(disp);
31}
32EFL_END_TEST
33
34void
35ecore_wl2_test_display(TCase *tc)
36{
37 tcase_add_test(tc, wl2_display_create);
38 tcase_add_test(tc, wl2_display_destroy);
39}
diff --git a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h
new file mode 100644
index 0000000000..24175a505a
--- /dev/null
+++ b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h
@@ -0,0 +1,17 @@
1#ifndef ECORE_WL2_TEST_HELPERS_H
2# define ECORE_WL2_TEST_HELPERS_H
3
4# include <Ecore_Wl2.h>
5
6# define ECORE_WL2_TEST_DISPLAY_SETUP() _setup_display()
7
8static Ecore_Wl2_Display *
9_setup_display(void)
10{
11 Ecore_Wl2_Display *disp;
12
13 disp = ecore_wl2_display_create(NULL);
14 return disp;
15}
16
17#endif
diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build
index 11500c781e..97bce4eed7 100644
--- a/src/tests/ecore_wl2/meson.build
+++ b/src/tests/ecore_wl2/meson.build
@@ -1,7 +1,9 @@
1ecore_wl2_suite_src = [ 1ecore_wl2_suite_src = [
2 'ecore_wl2_suite.c', 2 'ecore_wl2_suite.c',
3 'ecore_wl2_suite.h', 3 'ecore_wl2_suite.h',
4 'ecore_wl2_test_ecore_wl2.c' 4 'ecore_wl2_tests_helpers.h',
5 'ecore_wl2_test_ecore_wl2.c',
6 'ecore_wl2_test_display.c'
5] 7]
6 8
7ecore_wl2_suite = executable('ecore_wl2_suite', 9ecore_wl2_suite = executable('ecore_wl2_suite',