devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=664c8f7ae4e6947ab83798d1bdc35bdd59a017b8
commit 664c8f7ae4e6947ab83798d1bdc35bdd59a017b8 Author: Srivardhan Hebbar <[email protected]> Date: Mon Oct 27 08:00:38 2014 -0400 ecore_drm: Adding test-suite to ecore_drm. Summary: Adding test-suite to ecore_drm with one test case. Signed-off-by: Srivardhan Hebbar <[email protected]> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1583 --- src/Makefile_Ecore.am | 13 +++++++++--- src/tests/ecore/ecore_suite.c | 3 +++ src/tests/ecore/ecore_suite.h | 1 + src/tests/ecore/ecore_test_ecore_drm.c | 37 ++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am index 43acee3..4249fa0 100644 --- a/src/Makefile_Ecore.am +++ b/src/Makefile_Ecore.am @@ -191,7 +191,8 @@ tests_ecore_ecore_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ @ECORE_IMF_CFLAGS@ \ @ECORE_EVAS_CFLAGS@ \ @ECORE_WAYLAND_CFLAGS@ \ -@ECORE_WAYLAND_SRV_CFLAGS@ +@ECORE_WAYLAND_SRV_CFLAGS@ \ +@ECORE_DRM_CFLAGS@ tests_ecore_ecore_suite_LDADD = \ @CHECK_LIBS@ \ @@ -203,7 +204,8 @@ tests_ecore_ecore_suite_LDADD = \ @USE_ECORE_IMF_LIBS@ \ @USE_ECORE_EVAS_LIBS@ \ @USE_ECORE_WAYLAND_LIBS@ \ -@ECORE_WAYLAND_SRV_LIBS@ +@ECORE_WAYLAND_SRV_LIBS@ \ +@ECORE_DRM_LIBS@ tests_ecore_ecore_suite_DEPENDENCIES = \ @USE_ECORE_INTERNAL_LIBS@ \ @USE_ECORE_AUDIO_INTERNAL_LIBS@ \ @@ -212,7 +214,8 @@ tests_ecore_ecore_suite_DEPENDENCIES = \ @USE_ECORE_X_INTERNAL_LIBS@ \ @USE_ECORE_IMF_INTERNAL_LIBS@ \ @USE_ECORE_EVAS_INTERNAL_LIBS@ \ -@USE_ECORE_WAYLAND_INTERNAL_LIBS@ +@USE_ECORE_WAYLAND_INTERNAL_LIBS@ \ +@USE_ECORE_DRM_INTERNAL_LIBS@ if HAVE_ECORE_AUDIO tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_audio.c @@ -222,6 +225,10 @@ if HAVE_ECORE_WAYLAND tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_wayland.c endif +if HAVE_ECORE_DRM +tests_ecore_ecore_suite_SOURCES += tests/ecore/ecore_test_ecore_drm.c +endif + endif EXTRA_DIST += \ diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c index 63d6596..dee054d 100644 --- a/src/tests/ecore/ecore_suite.c +++ b/src/tests/ecore/ecore_suite.c @@ -33,6 +33,9 @@ static const Ecore_Test_Case etc[] = { #if HAVE_ECORE_WAYLAND { "Ecore_Wayland", ecore_test_ecore_wayland }, #endif +#if HAVE_ECORE_DRM + { "Ecore_Drm", ecore_test_ecore_drm }, +#endif { NULL, NULL } }; diff --git a/src/tests/ecore/ecore_suite.h b/src/tests/ecore/ecore_suite.h index 1487fb4..e1c476d 100644 --- a/src/tests/ecore/ecore_suite.h +++ b/src/tests/ecore/ecore_suite.h @@ -14,5 +14,6 @@ void ecore_test_ecore_evas(TCase *tc); void ecore_test_animator(TCase *tc); void ecore_test_ecore_thread_eina_thread_queue(TCase *tc); void ecore_test_ecore_wayland(TCase *tc); +void ecore_test_ecore_drm(TCase *tc); #endif /* _ECORE_SUITE_H */ diff --git a/src/tests/ecore/ecore_test_ecore_drm.c b/src/tests/ecore/ecore_test_ecore_drm.c new file mode 100644 index 0000000..05a83eb --- /dev/null +++ b/src/tests/ecore/ecore_test_ecore_drm.c @@ -0,0 +1,37 @@ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdio.h> +#include <unistd.h> + +#include <Ecore_Drm.h> + +#include "ecore_suite.h" + +#define MAX_ITER 10 + +START_TEST(ecore_test_ecore_drm_init) +{ + int ret, i, j; + + for (i = 1; i <= MAX_ITER; i++) + { + ret = ecore_drm_init(); + fprintf(stderr, "Created %d ecore drm instance.\n", i); + fail_if(ret != i); + } + + for (j = MAX_ITER - 1; j >= 0; j--) + { + ret = ecore_drm_shutdown(); + fprintf(stderr, "Deleted %d ecore drm instance.\n", MAX_ITER - j); + fail_if(ret != j); + } +} +END_TEST + +void ecore_test_ecore_drm(TCase *tc) +{ + tcase_add_test(tc, ecore_test_ecore_drm_init); +} --
