summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_suite.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-04-27 14:59:04 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-27 15:01:39 +0200
commit0cf63649c70a62c5035e5b743eac5d17034ef5b9 (patch)
treee7b6b6977a29718508ae772c23d1fe3880445e9a /src/tests/elementary/elm_suite.c
parent18b6b1248d79627982390dbd3d2b11ce2e7f238e (diff)
tests: use a global win object in fork mode when using buffer engine
Summary: this avoids the creation of a new win object for each test ref T6864 Reviewers: stefan_schmidt, cedric Reviewed By: cedric Subscribers: cedric Maniphest Tasks: T6864 Differential Revision: https://phab.enlightenment.org/D5965
Diffstat (limited to 'src/tests/elementary/elm_suite.c')
-rw-r--r--src/tests/elementary/elm_suite.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/tests/elementary/elm_suite.c b/src/tests/elementary/elm_suite.c
index b7e07bd..b8e2a94 100644
--- a/src/tests/elementary/elm_suite.c
+++ b/src/tests/elementary/elm_suite.c
@@ -8,6 +8,7 @@
8 8
9static int main_pid = -1; 9static int main_pid = -1;
10static Eina_Bool did_shutdown; 10static Eina_Bool did_shutdown;
11static Evas_Object *global_win;
11 12
12static const Efl_Test_Case etc[] = { 13static const Efl_Test_Case etc[] = {
13 { "elm_config", elm_test_config }, 14 { "elm_config", elm_test_config },
@@ -130,10 +131,21 @@ static const Efl_Test_Case etc_init[] = {
130 { NULL, NULL } 131 { NULL, NULL }
131}; 132};
132 133
134Evas_Object *
135win_add()
136{
137 if (getpid() != main_pid)
138 {
139 if (global_win) return global_win;
140 }
141 return elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC);;
142}
143
133int 144int
134main(int argc, char **argv) 145main(int argc, char **argv)
135{ 146{
136 int failed_count; 147 int failed_count;
148 Eina_Bool buffer = EINA_FALSE;
137 149
138 if (!_efl_test_option_disp(argc, argv, etc)) 150 if (!_efl_test_option_disp(argc, argv, etc))
139 return 0; 151 return 0;
@@ -144,13 +156,17 @@ main(int argc, char **argv)
144 if (!getenv("ELM_ENGINE")) 156 if (!getenv("ELM_ENGINE"))
145 putenv("ELM_ENGINE=buffer"); 157 putenv("ELM_ENGINE=buffer");
146 if (eina_streq(getenv("ELM_ENGINE"), "buffer")) 158 if (eina_streq(getenv("ELM_ENGINE"), "buffer"))
147 putenv("TESTS_GL_DISABLED=1"); 159 {
160 putenv("TESTS_GL_DISABLED=1");
161 buffer = EINA_TRUE;
162 }
148 163
149 main_pid = getpid(); 164 main_pid = getpid();
150 165
151 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 166 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
152 "Elementary_Init", etc_init, SUITE_INIT_FN(elm), SUITE_SHUTDOWN_FN(elm)); 167 "Elementary_Init", etc_init, SUITE_INIT_FN(elm), SUITE_SHUTDOWN_FN(elm));
153 failed_count += !elm_init(1, (char*[]){"exe"}); 168 failed_count += !elm_init(1, (char*[]){"exe"});
169 if (buffer) global_win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC);
154 EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255); 170 EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255);
155 /* preload default theme */ 171 /* preload default theme */
156 failed_count += !elm_theme_group_path_find(NULL, "elm/button/base/default"); 172 failed_count += !elm_theme_group_path_find(NULL, "elm/button/base/default");