summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-10 11:06:53 +0900
committerHermet Park <hermetpark@gmail.com>2018-07-10 11:06:53 +0900
commit53fa0c1520eb070ca8b29611fde92c0036a788ee (patch)
tree157bc0cdb9d5520563603cd3e953aa23712dc2fd
parent86cea8835368b499ee79c627eda6e3fbab23809e (diff)
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
-rw-r--r--src/tests/ecore_con/ecore_con_suite.c15
1 files changed, 15 insertions, 0 deletions
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 @@
4 4
5#include "ecore_con_suite.h" 5#include "ecore_con_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Ecore.h>
7#include <Ecore_Con.h> 8#include <Ecore_Con.h>
8 9
9static const Efl_Test_Case etc[] = { 10static const Efl_Test_Case etc[] = {
@@ -14,13 +15,27 @@ static const Efl_Test_Case etc[] = {
14 { NULL, NULL } 15 { NULL, NULL }
15}; 16};
16 17
18#define TIMEOUT 10.0
19static Ecore_Timer *timeout_timer;
20
21static Eina_Bool
22_timeout_timer(void *d EINA_UNUSED)
23{
24 timeout_timer = NULL;
25 ck_abort_msg("Timeout exceeded!");
26 return EINA_FALSE;
27}
28
17SUITE_INIT(ecore_con) 29SUITE_INIT(ecore_con)
18{ 30{
19 ck_assert_int_eq(ecore_con_init(), 1); 31 ck_assert_int_eq(ecore_con_init(), 1);
32 timeout_timer = ecore_timer_add(TIMEOUT, _timeout_timer, NULL);
20} 33}
21 34
22SUITE_SHUTDOWN(ecore_con) 35SUITE_SHUTDOWN(ecore_con)
23{ 36{
37 if (timeout_timer) ecore_timer_del(timeout_timer);
38 timeout_timer = NULL;
24 ck_assert_int_eq(ecore_con_shutdown(), 0); 39 ck_assert_int_eq(ecore_con_shutdown(), 0);
25} 40}
26 41