efl

Форк
0
/
ecore_suite.c 
94 строки · 2.3 Кб
1
#ifdef HAVE_CONFIG_H
2
# include <config.h>
3
#endif
4

5
#include "ecore_suite.h"
6
#include "../efl_check.h"
7
#include <Ecore.h>
8

9
static const Efl_Test_Case etc[] = {
10
  { "Ecore", ecore_test_ecore },
11
  { "idle", ecore_test_ecore_idle },
12
  { "poller", ecore_test_ecore_idle },
13
#if HAVE_ECORE_X
14
  { "Ecore_X", ecore_test_ecore_x },
15
#endif
16
  { "Ecore_Imf", ecore_test_ecore_imf },
17
#if HAVE_ECORE_AUDIO
18
  { "Ecore Audio", ecore_test_ecore_audio},
19
#endif
20
  { "Ecore_Timers", ecore_test_timer },
21
  { "Ecore_Evas", ecore_test_ecore_evas },
22
  { "Ecore_Animators", ecore_test_animator },
23
  { "Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue },
24
  { "Eina_Thread_Queue", ecore_test_ecore_thread_eina_thread_queue2 },
25
#if HAVE_ECORE_FB
26
  { "Ecore_Fb", ecore_test_ecore_fb },
27
#endif
28
  { "Ecore_Input", ecore_test_ecore_input },
29
  { "Ecore_File", ecore_test_ecore_file },
30
  { "Ecore_Job", ecore_test_ecore_job },
31
  { "Ecore_Args", ecore_test_ecore_args },
32
  { "Ecore_Pipe", ecore_test_ecore_pipe },
33
  { "Ecore_Evas_Selection", ecore_test_ecore_evas_selection },
34
  { NULL, NULL }
35
};
36

37
static Ecore_Timer *timeout;
38
int timeout_reached = 0;
39

40
static Eina_Bool
41
timeout_cb()
42
{
43
#if CHECK_MINOR_VERSION >= 11
44
   const char *tcname = tcase_name();
45

46
   timeout_reached = 1;
47

48
   if (tcname && strstr(tcname, "download"))
49
     {
50
        fprintf(stderr, "test timeout reached: download failed, probably network issue. skipping\n");
51
        ecore_main_loop_quit();
52
     }
53
   else
54
#endif
55
     ck_abort_msg("test timeout reached!");
56
   timeout = NULL;
57
   return EINA_FALSE;
58
}
59

60
SUITE_INIT(ecore)
61
{
62
   timeout_reached = 0;
63
   ck_assert_int_eq(ecore_init(), 1);
64
#ifdef HAVE_FORK
65
   if (eina_streq(getenv("CK_FORK"), "no")) return;
66
#endif
67
   timeout = ecore_timer_add(5.0, timeout_cb, NULL);
68
   ck_assert_msg(!!timeout, "timeout timer creation failed!");
69
}
70

71
SUITE_SHUTDOWN(ecore)
72
{
73
   ecore_timer_del(timeout);
74
   timeout = NULL;
75
   ck_assert_int_eq(ecore_shutdown(), 0);
76
}
77

78
int
79
main(int argc, char **argv)
80
{
81
   int failed_count;
82

83
   if (!_efl_test_option_disp(argc, argv, etc))
84
     return 0;
85

86
#ifdef NEED_RUN_IN_TREE
87
   putenv("EFL_RUN_IN_TREE=1");
88
#endif
89

90
   failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
91
                                           "Ecore", etc, SUITE_INIT_FN(ecore), SUITE_SHUTDOWN_FN(ecore));
92

93
   return (failed_count == 0) ? 0 : 255;
94
}
95

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.