Eina_List *hooks;
Eina_List *reg_wins;
- Eina_Bool tc_running;
- Eina_Bool tc_timer_needs;
- Ecore_Timer *tc_timer;
+ struct
+ {
+ Eina_Bool is_running;
+ Eina_Bool needs_timer;
+ Ecore_Timer *timer;
+ Eina_Stringshare *name;
+ } current_test;
} Test_Helper_Data;
static Test_Helper_Data *th_data = NULL;
static const Eldbus_Method methods[] ={
{
"StartTestCase",
- NULL,
+ ELDBUS_ARGS({"s", "test name"}),
ELDBUS_ARGS({"b", "accept or not"}),
_e_test_helper_cb_testcase_start, 0
},
{
EINA_SAFETY_ON_NULL_RETURN_VAL(th_data, ECORE_CALLBACK_DONE);
- th_data->tc_running = EINA_FALSE;
+ if (th_data->current_test.name)
+ {
+ ELOGF("E_TEST_HELPER", "Testcase timeout: %s", NULL, th_data->current_test.name);
+ eina_stringshare_del(th_data->current_test.name);
+ }
+
+ th_data->current_test.is_running = EINA_FALSE;
_e_test_helper_registrant_clear();
- if (th_data->tc_timer)
+ if (th_data->current_test.timer)
{
- ecore_timer_del(th_data->tc_timer);
- th_data->tc_timer = NULL;
+ ecore_timer_del(th_data->current_test.timer);
+ th_data->current_test.timer = NULL;
}
return ECORE_CALLBACK_DONE;
{
Eldbus_Message *reply;
Eina_Bool res = EINA_FALSE;
+ char *test_name;
reply = eldbus_message_method_return_new(msg);
+ if (!eldbus_message_arguments_get(msg, "s", &test_name))
+ {
+ ERR("Error on eldbus_message_arguments_get()\n");
+ goto end;
+ }
+
if (th_data)
{
- if (th_data->tc_timer)
- ecore_timer_del(th_data->tc_timer);
+ if (th_data->current_test.timer)
+ ecore_timer_del(th_data->current_test.timer);
+
+ if (th_data->current_test.needs_timer)
+ th_data->current_test.timer = ecore_timer_add(E_TC_TIMEOUT, _e_test_helper_cb_tc_timeout, NULL);
- if (th_data->tc_timer_needs)
- th_data->tc_timer = ecore_timer_add(E_TC_TIMEOUT, _e_test_helper_cb_tc_timeout, NULL);
- res = th_data->tc_running = EINA_TRUE;
+ if (th_data->current_test.name)
+ {
+ eina_stringshare_del(th_data->current_test.name);
+ th_data->current_test.name = NULL;
+ }
+
+ th_data->current_test.name = eina_stringshare_add(test_name);
+ res = th_data->current_test.is_running = EINA_TRUE;
+
+ ELOGF("E_TEST_HELPER", "Testcase start: %s", NULL, th_data->current_test.name);
}
+end:
eldbus_message_arguments_append(reply, "b", res);
return reply;
if (th_data)
{
- if (th_data->tc_timer)
+ ELOGF("E_TEST_HELPER", "Testcase end: %s", NULL, th_data->current_test.name);
+
+ if (th_data->current_test.timer)
{
- ecore_timer_del(th_data->tc_timer);
- th_data->tc_timer = NULL;
+ ecore_timer_del(th_data->current_test.timer);
+ th_data->current_test.timer = NULL;
}
- th_data->tc_running = EINA_FALSE;
+
+ if (th_data->current_test.name)
+ {
+ eina_stringshare_del(th_data->current_test.name);
+ th_data->current_test.name = NULL;
+ }
+
+ th_data->current_test.is_running = EINA_FALSE;
res = EINA_TRUE;
}
if (th_data)
{
- if (set != th_data->tc_timer_needs)
+ if (set != th_data->current_test.needs_timer)
{
- th_data->tc_timer_needs = set;
+ th_data->current_test.needs_timer = set;
if (!set)
- ecore_timer_del(th_data->tc_timer);
+ ecore_timer_del(th_data->current_test.timer);
}
if (timeout > 0)
{
- if (th_data->tc_timer)
- ecore_timer_del(th_data->tc_timer);
+ if (th_data->current_test.timer)
+ ecore_timer_del(th_data->current_test.timer);
- if (th_data->tc_timer_needs)
- th_data->tc_timer = ecore_timer_add(timeout, _e_test_helper_cb_tc_timeout, NULL);
+ if (th_data->current_test.needs_timer)
+ th_data->current_test.timer = ecore_timer_add(timeout, _e_test_helper_cb_tc_timeout, NULL);
}
res = EINA_TRUE;
}
Test_Helper_Reg_Win *reg_win = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(th_data, ECORE_CALLBACK_PASS_ON);
- if (!th_data->tc_running) return ECORE_CALLBACK_PASS_ON;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_PASS_ON;
ec = ev->ec;
win = e_pixmap_res_id_get(ec->pixmap);
Ecore_Window win;
EINA_SAFETY_ON_NULL_RETURN_VAL(th_data, ECORE_CALLBACK_PASS_ON);
- if (!th_data->tc_running) return ECORE_CALLBACK_PASS_ON;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_PASS_ON;
ec = ev->ec;
int rot;
EINA_SAFETY_ON_NULL_RETURN_VAL(th_data, ECORE_CALLBACK_PASS_ON);
- if (!th_data->tc_running) return ECORE_CALLBACK_PASS_ON;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_PASS_ON;
ec = ev->ec;
Ecore_Window win = 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(th_data, ECORE_CALLBACK_PASS_ON);
- if (!th_data->tc_running) return ECORE_CALLBACK_PASS_ON;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_PASS_ON;
ec = ev->ec;
// a window should be registered for tracing, otherwise reply accept FALSE
if (!th_data) goto fin;
- if (!th_data->tc_running) goto fin;
+ if (!th_data->current_test.is_running) goto fin;
if (!th_data->reg_wins) goto fin;
if (!_e_test_helper_find_win_on_reg_list(win)) goto fin;
}
if (!th_data) goto fin;
- if (!th_data->tc_running) goto fin;
+ if (!th_data->current_test.is_running) goto fin;
supported_list = e_hints_aux_hint_supported_add(hint);
}
if (!th_data) goto fin;
- if (!th_data->tc_running) goto fin;
+ if (!th_data->current_test.is_running) goto fin;
supported_list = e_hints_aux_hint_supported_del(hint);
}
if (!th_data) goto fin;
- if (!th_data->tc_running) goto fin;
+ if (!th_data->current_test.is_running) goto fin;
if (!th_data->reg_wins) goto fin;
if (!(reg_win = _e_test_helper_find_win_on_reg_list(win))) goto fin;
if (!(ec = reg_win->ec)) goto fin;
// a window should be registered for tracing
if (!th_data) return ECORE_CALLBACK_DONE;
- if (!th_data->tc_running) return ECORE_CALLBACK_DONE;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_DONE;
if (!th_data->reg_wins) return ECORE_CALLBACK_DONE;
win = e_pixmap_res_id_get(ec->pixmap);
// a window should be registered for tracing
if (!th_data) return ECORE_CALLBACK_DONE;
- if (!th_data->tc_running) return ECORE_CALLBACK_DONE;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_DONE;
if (!th_data->reg_wins) return ECORE_CALLBACK_DONE;
win = e_pixmap_res_id_get(ec->pixmap);
// a window should be registered for tracing
if (!th_data) return ECORE_CALLBACK_DONE;
- if (!th_data->tc_running) return ECORE_CALLBACK_DONE;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_DONE;
if (!th_data->reg_wins) return ECORE_CALLBACK_DONE;
win = e_pixmap_res_id_get(ec->pixmap);
E_Comp_Wl_Aux_Hint *hint;
EINA_SAFETY_ON_NULL_RETURN(th_data);
- if (!th_data->tc_running) return;
+ if (!th_data->current_test.is_running) return;
win = e_pixmap_res_id_get(ec->pixmap);
if (!_e_test_helper_find_win_on_reg_list(win)) return;
Eldbus_Message *sig;
Ecore_Window win;
- if (!th_data->tc_running) return ECORE_CALLBACK_PASS_ON;
+ if (!th_data->current_test.is_running) return ECORE_CALLBACK_PASS_ON;
ec = ev->ec;
if (!ec) return ECORE_CALLBACK_PASS_ON;
_e_test_helper_registrant_clear();
- if (th_data->tc_timer)
+ if (th_data->current_test.timer)
{
- ecore_timer_del(th_data->tc_timer);
- th_data->tc_timer = NULL;
+ ecore_timer_del(th_data->current_test.timer);
+ th_data->current_test.timer = NULL;
}
if (th_data->dbus_init_done_h)