hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=53fa0c1520eb070ca8b29611fde92c0036a788ee
commit 53fa0c1520eb070ca8b29611fde92c0036a788ee Author: Mike Blumenkrantz <zm...@samsung.com> Date: Tue Jul 10 11:06:53 2018 +0900 tests/ecore-con: add a global timeout timer for all tests Summary: it's possible for many tests in this suite to hang indefinitely, so ensure that they terminate eventually instead of holding up the build ref T6838 Reviewers: stefan_schmidt, bu5hm4n, devilhorns, Hermet Reviewed By: Hermet Subscribers: cedric, #committers Tags: #efl Maniphest Tasks: T6838 Differential Revision: https://phab.enlightenment.org/D6542 --- src/tests/ecore_con/ecore_con_suite.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tests/ecore_con/ecore_con_suite.c b/src/tests/ecore_con/ecore_con_suite.c index 7f96297672..614af39500 100644 --- a/src/tests/ecore_con/ecore_con_suite.c +++ b/src/tests/ecore_con/ecore_con_suite.c @@ -4,6 +4,7 @@ #include "ecore_con_suite.h" #include "../efl_check.h" +#include <Ecore.h> #include <Ecore_Con.h> static const Efl_Test_Case etc[] = { @@ -14,13 +15,27 @@ static const Efl_Test_Case etc[] = { { NULL, NULL } }; +#define TIMEOUT 10.0 +static Ecore_Timer *timeout_timer; + +static Eina_Bool +_timeout_timer(void *d EINA_UNUSED) +{ + timeout_timer = NULL; + ck_abort_msg("Timeout exceeded!"); + return EINA_FALSE; +} + SUITE_INIT(ecore_con) { ck_assert_int_eq(ecore_con_init(), 1); + timeout_timer = ecore_timer_add(TIMEOUT, _timeout_timer, NULL); } SUITE_SHUTDOWN(ecore_con) { + if (timeout_timer) ecore_timer_del(timeout_timer); + timeout_timer = NULL; ck_assert_int_eq(ecore_con_shutdown(), 0); } --