summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-03-26 14:19:28 -0400
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-05 11:10:25 +0200
commitadc601aca2f0a16784af36bf6ae7dd20eeb33202 (patch)
treecac0a78fa40e88abb028b06d985c28bf89da269c /src/tests/ecore/ecore_test_ecore.c
parentb340b5e49ccae48a7d5adbbfa301af39e232348c (diff)
tests: add instrumentation to existing tests to find slow tests
efl_check.h must be included and the EFL_START/END_TEST macros must be used in place of normal START/END_TEST macros timing is enabled when TIMING_ENABLED is set https://phab.enlightenment.org/w/improve_tests/ Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c
index fd31285503..acce1cc3d4 100644
--- a/src/tests/ecore/ecore_test_ecore.c
+++ b/src/tests/ecore/ecore_test_ecore.c
@@ -31,7 +31,7 @@ _dummy_cb(void *data)
31 return !!data; 31 return !!data;
32} 32}
33 33
34START_TEST(ecore_test_ecore_init) 34EFL_START_TEST(ecore_test_ecore_init)
35{ 35{
36 int ret; 36 int ret;
37 37
@@ -41,9 +41,9 @@ START_TEST(ecore_test_ecore_init)
41 ret = ecore_shutdown(); 41 ret = ecore_shutdown();
42 fail_if(ret != 0); 42 fail_if(ret != 0);
43} 43}
44END_TEST 44EFL_END_TEST
45 45
46START_TEST(ecore_test_ecore_main_loop) 46EFL_START_TEST(ecore_test_ecore_main_loop)
47{ 47{
48 Eina_Bool did = EINA_FALSE; 48 Eina_Bool did = EINA_FALSE;
49 Ecore_Timer *timer; 49 Ecore_Timer *timer;
@@ -61,9 +61,9 @@ START_TEST(ecore_test_ecore_main_loop)
61 61
62 ret = ecore_shutdown(); 62 ret = ecore_shutdown();
63} 63}
64END_TEST 64EFL_END_TEST
65 65
66START_TEST(ecore_test_ecore_main_loop_idler) 66EFL_START_TEST(ecore_test_ecore_main_loop_idler)
67{ 67{
68 Eina_Bool did = EINA_FALSE; 68 Eina_Bool did = EINA_FALSE;
69 Ecore_Idler *idler; 69 Ecore_Idler *idler;
@@ -81,9 +81,9 @@ START_TEST(ecore_test_ecore_main_loop_idler)
81 81
82 ret = ecore_shutdown(); 82 ret = ecore_shutdown();
83} 83}
84END_TEST 84EFL_END_TEST
85 85
86START_TEST(ecore_test_ecore_main_loop_idle_enterer) 86EFL_START_TEST(ecore_test_ecore_main_loop_idle_enterer)
87{ 87{
88 Eina_Bool did = EINA_FALSE; 88 Eina_Bool did = EINA_FALSE;
89 Ecore_Idle_Enterer *idle_enterer; 89 Ecore_Idle_Enterer *idle_enterer;
@@ -101,9 +101,9 @@ START_TEST(ecore_test_ecore_main_loop_idle_enterer)
101 101
102 ret = ecore_shutdown(); 102 ret = ecore_shutdown();
103} 103}
104END_TEST 104EFL_END_TEST
105 105
106START_TEST(ecore_test_ecore_main_loop_idle_before_enterer) 106EFL_START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
107{ 107{
108 Eina_Bool did = EINA_FALSE; 108 Eina_Bool did = EINA_FALSE;
109 Ecore_Idle_Enterer *idle_enterer; 109 Ecore_Idle_Enterer *idle_enterer;
@@ -121,9 +121,9 @@ START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
121 121
122 ret = ecore_shutdown(); 122 ret = ecore_shutdown();
123} 123}
124END_TEST 124EFL_END_TEST
125 125
126START_TEST(ecore_test_ecore_main_loop_idle_exiter) 126EFL_START_TEST(ecore_test_ecore_main_loop_idle_exiter)
127{ 127{
128 Eina_Bool did = EINA_FALSE; 128 Eina_Bool did = EINA_FALSE;
129 Ecore_Timer *timer; 129 Ecore_Timer *timer;
@@ -146,9 +146,9 @@ START_TEST(ecore_test_ecore_main_loop_idle_exiter)
146 146
147 ret = ecore_shutdown(); 147 ret = ecore_shutdown();
148} 148}
149END_TEST 149EFL_END_TEST
150 150
151START_TEST(ecore_test_ecore_main_loop_timer) 151EFL_START_TEST(ecore_test_ecore_main_loop_timer)
152{ 152{
153 Eina_Bool did = EINA_FALSE; 153 Eina_Bool did = EINA_FALSE;
154 Ecore_Timer *timer; 154 Ecore_Timer *timer;
@@ -172,7 +172,7 @@ START_TEST(ecore_test_ecore_main_loop_timer)
172 172
173 ret = ecore_shutdown(); 173 ret = ecore_shutdown();
174} 174}
175END_TEST 175EFL_END_TEST
176 176
177// Disabled tests: inner main loops are not supposed to work! 177// Disabled tests: inner main loops are not supposed to work!
178#if 0 178#if 0
@@ -204,7 +204,7 @@ static Eina_Bool _timer1(void *data)
204 return EINA_FALSE; 204 return EINA_FALSE;
205} 205}
206 206
207START_TEST(ecore_test_ecore_main_loop_timer_inner) 207EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner)
208{ 208{
209 Ecore_Timer *timer; 209 Ecore_Timer *timer;
210 int ret; 210 int ret;
@@ -224,7 +224,7 @@ START_TEST(ecore_test_ecore_main_loop_timer_inner)
224 224
225 ecore_shutdown(); 225 ecore_shutdown();
226} 226}
227END_TEST 227EFL_END_TEST
228#endif 228#endif
229 229
230static Eina_Bool 230static Eina_Bool
@@ -238,7 +238,7 @@ _fd_handler_cb(void *data, Ecore_Fd_Handler *handler EINA_UNUSED)
238 return EINA_FALSE; 238 return EINA_FALSE;
239} 239}
240 240
241START_TEST(ecore_test_ecore_main_loop_fd_handler) 241EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler)
242{ 242{
243 Eina_Bool did = EINA_FALSE; 243 Eina_Bool did = EINA_FALSE;
244 Ecore_Fd_Handler *fd_handler; 244 Ecore_Fd_Handler *fd_handler;
@@ -267,9 +267,9 @@ START_TEST(ecore_test_ecore_main_loop_fd_handler)
267 267
268 ret = ecore_shutdown(); 268 ret = ecore_shutdown();
269} 269}
270END_TEST 270EFL_END_TEST
271 271
272START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags) 272EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags)
273{ 273{
274 Ecore_Fd_Handler *fd_handler; 274 Ecore_Fd_Handler *fd_handler;
275 int comm[2]; 275 int comm[2];
@@ -293,7 +293,7 @@ START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags)
293 293
294 ecore_shutdown(); 294 ecore_shutdown();
295} 295}
296END_TEST 296EFL_END_TEST
297 297
298static void 298static void
299_eo_read_cb(void *data, const Efl_Event *info EINA_UNUSED) 299_eo_read_cb(void *data, const Efl_Event *info EINA_UNUSED)
@@ -304,7 +304,7 @@ _eo_read_cb(void *data, const Efl_Event *info EINA_UNUSED)
304 ecore_main_loop_quit(); 304 ecore_main_loop_quit();
305} 305}
306 306
307START_TEST(ecore_test_efl_loop_fd) 307EFL_START_TEST(ecore_test_efl_loop_fd)
308{ 308{
309 Eina_Bool did = EINA_FALSE; 309 Eina_Bool did = EINA_FALSE;
310 Eo *fd; 310 Eo *fd;
@@ -334,7 +334,7 @@ START_TEST(ecore_test_efl_loop_fd)
334 334
335 ret = ecore_shutdown(); 335 ret = ecore_shutdown();
336} 336}
337END_TEST 337EFL_END_TEST
338 338
339static void 339static void
340_efl_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) 340_efl_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
@@ -344,7 +344,7 @@ _efl_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
344 *dead = EINA_TRUE; 344 *dead = EINA_TRUE;
345} 345}
346 346
347START_TEST(ecore_test_efl_loop_fd_lifecycle) 347EFL_START_TEST(ecore_test_efl_loop_fd_lifecycle)
348{ 348{
349 Eina_Bool did = EINA_FALSE; 349 Eina_Bool did = EINA_FALSE;
350 Eina_Bool dead = EINA_FALSE; 350 Eina_Bool dead = EINA_FALSE;
@@ -385,9 +385,9 @@ START_TEST(ecore_test_efl_loop_fd_lifecycle)
385 385
386 efl_object_shutdown(); 386 efl_object_shutdown();
387} 387}
388END_TEST 388EFL_END_TEST
389 389
390START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify) 390EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
391{ 391{
392 Eina_Bool did = EINA_FALSE; 392 Eina_Bool did = EINA_FALSE;
393 Ecore_Fd_Handler *fd_handler; 393 Ecore_Fd_Handler *fd_handler;
@@ -418,7 +418,7 @@ START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
418 418
419 ret = ecore_shutdown(); 419 ret = ecore_shutdown();
420} 420}
421END_TEST 421EFL_END_TEST
422 422
423static Eina_Bool 423static Eina_Bool
424_event_handler_cb(void *data, int type, void *event) 424_event_handler_cb(void *data, int type, void *event)
@@ -526,7 +526,7 @@ _filter_end(void *user_data, void *func_data EINA_UNUSED)
526 (*fdid)++; 526 (*fdid)++;
527} 527}
528 528
529START_TEST(ecore_test_ecore_main_loop_event) 529EFL_START_TEST(ecore_test_ecore_main_loop_event)
530{ 530{
531 Ecore_Event_Handler *handler, *handler2, *handler3; 531 Ecore_Event_Handler *handler, *handler2, *handler3;
532 Ecore_Event_Filter *filter_handler; 532 Ecore_Event_Filter *filter_handler;
@@ -630,7 +630,7 @@ START_TEST(ecore_test_ecore_main_loop_event)
630 630
631 res_counter = ecore_shutdown(); 631 res_counter = ecore_shutdown();
632} 632}
633END_TEST 633EFL_END_TEST
634 634
635#if 0 635#if 0
636static int _log_dom; 636static int _log_dom;
@@ -670,7 +670,7 @@ _event_recursive_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EI
670 return EINA_FALSE; 670 return EINA_FALSE;
671} 671}
672 672
673START_TEST(ecore_test_ecore_main_loop_event_recursive) 673EFL_START_TEST(ecore_test_ecore_main_loop_event_recursive)
674{ 674{
675 /* This test tests if the event handlers are really called only once when 675 /* This test tests if the event handlers are really called only once when
676 * recursive main loops are used and any number of events may have occurred 676 * recursive main loops are used and any number of events may have occurred
@@ -698,10 +698,10 @@ START_TEST(ecore_test_ecore_main_loop_event_recursive)
698 INF("main: end"); 698 INF("main: end");
699 ecore_shutdown(); 699 ecore_shutdown();
700} 700}
701END_TEST 701EFL_END_TEST
702#endif 702#endif
703 703
704START_TEST(ecore_test_ecore_app) 704EFL_START_TEST(ecore_test_ecore_app)
705{ 705{
706 int ret; 706 int ret;
707 707
@@ -726,7 +726,7 @@ START_TEST(ecore_test_ecore_app)
726 726
727 ret = ecore_shutdown(); 727 ret = ecore_shutdown();
728} 728}
729END_TEST 729EFL_END_TEST
730 730
731Eina_Bool _poller_cb(void *data) 731Eina_Bool _poller_cb(void *data)
732{ 732{
@@ -735,7 +735,7 @@ Eina_Bool _poller_cb(void *data)
735 return ECORE_CALLBACK_RENEW; 735 return ECORE_CALLBACK_RENEW;
736} 736}
737 737
738START_TEST(ecore_test_ecore_main_loop_poller) 738EFL_START_TEST(ecore_test_ecore_main_loop_poller)
739{ 739{
740 int ret; 740 int ret;
741 741
@@ -791,7 +791,7 @@ START_TEST(ecore_test_ecore_main_loop_poller)
791 791
792 ret = ecore_shutdown(); 792 ret = ecore_shutdown();
793} 793}
794END_TEST 794EFL_END_TEST
795 795
796Eina_Bool _poller_handler(void *data) 796Eina_Bool _poller_handler(void *data)
797{ 797{
@@ -826,7 +826,7 @@ Eina_Bool _poller_loop(void *data)
826 return ECORE_CALLBACK_RENEW; 826 return ECORE_CALLBACK_RENEW;
827} 827}
828 828
829START_TEST(ecore_test_ecore_main_loop_poller_add_del) 829EFL_START_TEST(ecore_test_ecore_main_loop_poller_add_del)
830{ 830{
831 int ret, count_res = 0; 831 int ret, count_res = 0;
832 832
@@ -855,7 +855,7 @@ START_TEST(ecore_test_ecore_main_loop_poller_add_del)
855 855
856 ret = ecore_shutdown(); 856 ret = ecore_shutdown();
857} 857}
858END_TEST 858EFL_END_TEST
859 859
860void ecore_test_ecore(TCase *tc) 860void ecore_test_ecore(TCase *tc)
861{ 861{