summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-05-08 16:17:05 +0100
committerTom Hacohen <tom@stosb.com>2015-05-08 16:18:36 +0100
commita00bbffd3f2072441d4ca674eed482b801db960d (patch)
tree1597e77c1ff3c5b32b56954c13862181b1f29f87
parent7072ca435a45aadd9a1ff204d975b16e375e4922 (diff)
Ecore tests: REMOVE wayland tests.
These tests aren't really testing anything, and are just broken and annoying. They only test init and shutdown, and they require a running wayland compositor. They fail for anyone that has wayland enabled but not running in a wayland session. They should be brought back once they actual test something, or once we allow skipping tests that can't be run due to environment issues.
-rw-r--r--src/Makefile_Ecore.am4
-rw-r--r--src/tests/ecore/ecore_suite.c3
-rw-r--r--src/tests/ecore/ecore_suite.h1
-rw-r--r--src/tests/ecore/ecore_test_ecore_wayland.c134
4 files changed, 0 insertions, 142 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 738f9297b3..b7e0b6b74d 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -245,10 +245,6 @@ if HAVE_ECORE_AUDIO
245tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c 245tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c
246endif 246endif
247 247
248if HAVE_ECORE_WAYLAND
249tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_wayland.c
250endif
251
252if HAVE_ECORE_DRM 248if HAVE_ECORE_DRM
253tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_drm.c 249tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_drm.c
254endif 250endif
diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c
index 898f471bdc..ce75f00328 100644
--- a/src/tests/ecore/ecore_suite.c
+++ b/src/tests/ecore/ecore_suite.c
@@ -30,9 +30,6 @@ static const Ecore_Test_Case etc[] = {
30 { "Ecore_Evas", ecore_test_ecore_evas }, 30 { "Ecore_Evas", ecore_test_ecore_evas },
31 { "Ecore_Animators", ecore_test_animator }, 31 { "Ecore_Animators", ecore_test_animator },
32 { "Ecore_Test_Ccore_Thread_Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue }, 32 { "Ecore_Test_Ccore_Thread_Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue },
33#if HAVE_ECORE_WAYLAND
34 { "Ecore_Wayland", ecore_test_ecore_wayland },
35#endif
36#if HAVE_ECORE_DRM 33#if HAVE_ECORE_DRM
37 { "Ecore_Drm", ecore_test_ecore_drm }, 34 { "Ecore_Drm", ecore_test_ecore_drm },
38#endif 35#endif
diff --git a/src/tests/ecore/ecore_suite.h b/src/tests/ecore/ecore_suite.h
index e6dd4b38c4..f0e4c2a400 100644
--- a/src/tests/ecore/ecore_suite.h
+++ b/src/tests/ecore/ecore_suite.h
@@ -11,7 +11,6 @@ void ecore_test_timer(TCase *tc);
11void ecore_test_ecore_evas(TCase *tc); 11void ecore_test_ecore_evas(TCase *tc);
12void ecore_test_animator(TCase *tc); 12void ecore_test_animator(TCase *tc);
13void ecore_test_ecore_thread_eina_thread_queue(TCase *tc); 13void ecore_test_ecore_thread_eina_thread_queue(TCase *tc);
14void ecore_test_ecore_wayland(TCase *tc);
15void ecore_test_ecore_drm(TCase *tc); 14void ecore_test_ecore_drm(TCase *tc);
16void ecore_test_ecore_fb(TCase *tc); 15void ecore_test_ecore_fb(TCase *tc);
17void ecore_test_ecore_input(TCase *tc); 16void ecore_test_ecore_input(TCase *tc);
diff --git a/src/tests/ecore/ecore_test_ecore_wayland.c b/src/tests/ecore/ecore_test_ecore_wayland.c
deleted file mode 100644
index 90fda73369..0000000000
--- a/src/tests/ecore/ecore_test_ecore_wayland.c
+++ /dev/null
@@ -1,134 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdio.h>
6#include <unistd.h>
7
8#include <Ecore_Wayland.h>
9
10#include "ecore_suite.h"
11#include "wayland-server.h"
12
13#define MAX_ITER 10
14
15static char test_socket[] = "test1";
16
17START_TEST(ecore_test_ecore_wl_shutdown_bef_init)
18{
19 struct wl_display *test_display = NULL;
20 int ret = 0;
21
22 ret = ecore_wl_shutdown();
23 fprintf(stderr, "Calling ecore_wl_shutdown without calling ecore_wl_init\n");
24 fail_if(ret != 0);
25
26 test_display = wl_display_create();
27 fprintf(stderr, "Creating wayland display\n");
28 fail_if(test_display == NULL);
29
30 ret = wl_display_add_socket(test_display, test_socket);
31 fprintf(stderr, "Connecting %s socket to wayland display\n", test_socket);
32 fail_if(ret != 0);
33
34 ret = ecore_wl_init(test_socket);
35 fprintf(stderr, "Calling ecore_wl_init with %s\n", test_socket);
36 fail_if(ret != 1);
37
38 ret = ecore_wl_shutdown();
39 fprintf(stderr, "Calling ecore_wl_shutdown after ecore_wl_init.\n");
40 fail_if(ret != 0);
41
42 wl_display_destroy(test_display);
43}
44END_TEST
45
46START_TEST(ecore_test_ecore_wl_init_name)
47{
48 struct wl_display *test_display = NULL;
49 int ret = 0, i, j;
50
51 test_display = wl_display_create();
52 fprintf(stderr, "Creating display\n");
53 fail_if(test_display == NULL);
54
55 ret = wl_display_add_socket(test_display, test_socket);
56 fprintf(stderr, "Connecting socket to display\n");
57 fail_if(ret != 0);
58
59 for (i = 1; i <= MAX_ITER; i++)
60 {
61 ret = ecore_wl_init(test_socket);
62 fprintf(stderr, "Created %d ecore wayland instance.\n", i);
63 fail_if(ret != i);
64 }
65
66 for (j = MAX_ITER - 1; j >= 0; j--)
67 {
68 ret = ecore_wl_shutdown();
69 fprintf(stderr, "Deleted %d ecore wayland instance.\n", MAX_ITER - j);
70 fail_if(ret != j);
71 }
72
73 wl_display_destroy(test_display);
74}
75END_TEST
76
77START_TEST(ecore_test_ecore_wl_init)
78{
79#define PATH_LEN 128
80 struct wl_display *test_display = NULL;
81 int ret, i, j, run_test = 0;
82 char *wayland_display = NULL, *xdg_runtime_dir = NULL, path[PATH_LEN];
83
84 xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
85 if (xdg_runtime_dir)
86 {
87 wayland_display = getenv("WAYLAND_DISPLAY");
88 if (!wayland_display)
89 wayland_display = "wayland-0";
90
91 snprintf(path, PATH_LEN, "%s/%s", xdg_runtime_dir, wayland_display);
92 if (access(path, F_OK) != -1)
93 {
94 run_test = 1;
95 }
96 else
97 {
98 test_display = wl_display_create();
99 fprintf(stderr, "Creating display\n");
100 fail_if(test_display == NULL);
101
102 ret = wl_display_add_socket(test_display, NULL);
103 fprintf(stderr, "Connecting socket to display\n");
104 fail_if(ret != 0);
105
106 run_test = 1;
107 }
108 }
109
110 if (run_test)
111 {
112 for (i = 1; i <= MAX_ITER; i++)
113 {
114 ret = ecore_wl_init(NULL);
115 fprintf(stderr, "Created %d ecore wayland instance.\n", i);
116 fail_if(ret != i);
117 }
118
119 for (j = MAX_ITER - 1; j >= 0; j--)
120 {
121 ret = ecore_wl_shutdown();
122 fprintf(stderr, "Deleted %d ecore wayland instance.\n", MAX_ITER - j);
123 fail_if(ret != j);
124 }
125 }
126}
127END_TEST
128
129void ecore_test_ecore_wayland(TCase *tc)
130{
131 tcase_add_test(tc, ecore_test_ecore_wl_init);
132 tcase_add_test(tc, ecore_test_ecore_wl_init_name);
133 tcase_add_test(tc, ecore_test_ecore_wl_shutdown_bef_init);
134}