summaryrefslogtreecommitdiff
path: root/src/tests/ecore
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-06-27 06:17:45 -0400
committerChris Michael <cp.michael@samsung.com>2018-06-27 06:17:45 -0400
commit21bba131c8697b1b1f07ce8ff039bbf1ac65519a (patch)
tree3fbf340ae5e57bf53f41f38541f3ea3c87fbb1a7 /src/tests/ecore
parent194971342bc05a8ae3c38741d0eb52eccae3a835 (diff)
tests: avoid cascading failure in ecore-imf tests when not forking
Summary: these tests explicitly call ecore_imf_init, so they must call ecore_imf_shutdown even on failure cases to avoid propagating their failure to subsequent tests ref T7085 Reviewers: ManMower, bu5hm4n, devilhorns Reviewed By: devilhorns Subscribers: cedric, #committers Tags: #efl Maniphest Tasks: T7085 Differential Revision: https://phab.enlightenment.org/D6433
Diffstat (limited to 'src/tests/ecore')
-rw-r--r--src/tests/ecore/ecore_test_ecore_imf.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_imf.c b/src/tests/ecore/ecore_test_ecore_imf.c
index 2f6b092f44..e4671597f5 100644
--- a/src/tests/ecore/ecore_test_ecore_imf.c
+++ b/src/tests/ecore/ecore_test_ecore_imf.c
@@ -51,6 +51,7 @@ EFL_START_TEST(ecore_test_ecore_imf_modules)
51{ 51{
52 Eina_List *modules; 52 Eina_List *modules;
53 const char **itr; 53 const char **itr;
54 char *failure = NULL;
54 55
55 putenv("ECORE_IMF_MODULE="); 56 putenv("ECORE_IMF_MODULE=");
56 ecore_imf_init(); 57 ecore_imf_init();
@@ -59,18 +60,20 @@ EFL_START_TEST(ecore_test_ecore_imf_modules)
59 for (itr = built_modules; *itr != NULL; itr++) 60 for (itr = built_modules; *itr != NULL; itr++)
60 { 61 {
61 Eina_Bool found = _find_list(modules, *itr); 62 Eina_Bool found = _find_list(modules, *itr);
62 fail_if(!found, "imf module should be built, but was not found: %s", 63 if (!found) failure = eina_strdup(*itr);
63 *itr); 64 if (failure) break;
64 } 65 }
65 66
66 eina_list_free(modules); 67 eina_list_free(modules);
67 ecore_imf_shutdown(); 68 ecore_imf_shutdown();
69 ck_assert_msg(!failure, "compiled imf module not found: %s", failure);
68} 70}
69EFL_END_TEST 71EFL_END_TEST
70 72
71EFL_START_TEST(ecore_test_ecore_imf_modules_load) 73EFL_START_TEST(ecore_test_ecore_imf_modules_load)
72{ 74{
73 const char **itr; 75 const char **itr;
76 char *failure = NULL;
74 77
75 putenv("ECORE_IMF_MODULE="); 78 putenv("ECORE_IMF_MODULE=");
76 ecore_imf_init(); 79 ecore_imf_init();
@@ -84,11 +87,16 @@ EFL_START_TEST(ecore_test_ecore_imf_modules_load)
84 } 87 }
85 88
86 ctx = ecore_imf_context_add(*itr); 89 ctx = ecore_imf_context_add(*itr);
87 fail_if(ctx == NULL, "could not add imf context: %s", *itr); 90 if (!ctx)
91 {
92 failure = eina_strdup(*itr);
93 break;
94 }
88 ecore_imf_context_del(ctx); 95 ecore_imf_context_del(ctx);
89 } 96 }
90 97
91 ecore_imf_shutdown(); 98 ecore_imf_shutdown();
99 ck_assert_msg(!failure, "could not add imf context: %s", failure);
92} 100}
93EFL_END_TEST 101EFL_END_TEST
94 102