diff --git a/configure.ac b/configure.ac index 042c88ce85..d43345d67b 100644 --- a/configure.ac +++ b/configure.ac @@ -2858,10 +2858,10 @@ EFL_EVAL_PKGS([ECORE_WAYLAND]) ### Checks for linker characteristics ### Checks for library functions + EFL_LIB_END_OPTIONAL([Ecore_Wayland]) #### End of Ecore_Wayland - #### Eldbus EFL_LIB_START([Eldbus]) @@ -4372,6 +4372,12 @@ EFL_EVAL_PKGS([ELUA]) EFL_LIB_END_OPTIONAL([Elua]) #### End of Elua +### Add Wayland server library if test is enabled +if test "x${want_tests}" = "xyes" -a "x${want_wayland}" = "xyes"; then + EFL_DEPEND_PKG([ECORE_WAYLAND_SRV], [WAYLAND], [wayland-server >= 1.3.0]) + EFL_EVAL_PKGS([ECORE_WAYLAND_SRV]) +fi + AC_ARG_ENABLE([always-build-examples], [AS_HELP_STRING([--enable-always-build-examples],[always build examples. @<:@default=disabled@:>@])], [ diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am index 3bb894a943..43acee3599 100644 --- a/src/Makefile_Ecore.am +++ b/src/Makefile_Ecore.am @@ -190,7 +190,8 @@ tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ @ECORE_X_CFLAGS@ \ @ECORE_IMF_CFLAGS@ \ @ECORE_EVAS_CFLAGS@ \ -@ECORE_WAYLAND_CFLAGS@ +@ECORE_WAYLAND_CFLAGS@ \ +@ECORE_WAYLAND_SRV_CFLAGS@ tests_ecore_ecore_suite_LDADD = \ @CHECK_LIBS@ \ @@ -201,7 +202,8 @@ tests_ecore_ecore_suite_LDADD = \ @USE_ECORE_X_LIBS@ \ @USE_ECORE_IMF_LIBS@ \ @USE_ECORE_EVAS_LIBS@ \ -@USE_ECORE_WAYLAND_LIBS@ +@USE_ECORE_WAYLAND_LIBS@ \ +@ECORE_WAYLAND_SRV_LIBS@ tests_ecore_ecore_suite_DEPENDENCIES = \ @USE_ECORE_INTERNAL_LIBS@ \ @USE_ECORE_AUDIO_INTERNAL_LIBS@ \ diff --git a/src/tests/ecore/ecore_test_ecore_wayland.c b/src/tests/ecore/ecore_test_ecore_wayland.c index 54aca3ffd7..bd441ca72b 100644 --- a/src/tests/ecore/ecore_test_ecore_wayland.c +++ b/src/tests/ecore/ecore_test_ecore_wayland.c @@ -8,9 +8,43 @@ #include #include "ecore_suite.h" +#include "wayland-server.h" #define MAX_ITER 15 +static char test_socket[] = "test1"; + +START_TEST(ecore_test_ecore_wl_init_name) +{ + struct wl_display *test_display = NULL; + int ret = 0, i, j; + + test_display = wl_display_create(); + fprintf(stderr, "Creating display\n"); + fail_if(test_display == NULL); + + ret = wl_display_add_socket(test_display, test_socket); + fprintf(stderr, "Connecting socket to display\n"); + fail_if(ret != 0); + + for (i = 1; i <= MAX_ITER; i++) + { + ret = ecore_wl_init(test_socket); + fprintf(stderr, "Created %d ecore wayland instance.\n", i); + fail_if(ret != i); + } + + for (j = MAX_ITER - 1; j >= 0; j--) + { + ret = ecore_wl_shutdown(); + fprintf(stderr, "Deleted %d ecore wayland instance.\n", MAX_ITER - j); + fail_if(ret != j); + } + + wl_display_destroy(test_display); +} +END_TEST + START_TEST(ecore_test_ecore_wl_init) { int ret, i, j; @@ -34,4 +68,5 @@ END_TEST void ecore_test_ecore_wayland(TCase *tc) { tcase_add_test(tc, ecore_test_ecore_wl_init); + tcase_add_test(tc, ecore_test_ecore_wl_init_name); }