forked from enlightenment/efl
efl_ui: add a helper for not tollerating errors in a testsuite
Summary: We now also fail in the focus tests Depends on D9021 Reviewers: zmike, cedric, segfaultxavi Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9022
This commit is contained in:
parent
52b2701bc3
commit
8721caf787
|
@ -1,4 +1,5 @@
|
|||
#include "efl_ui_test_focus_common.h"
|
||||
#include "suite_helpers.h"
|
||||
|
||||
EFL_START_TEST(focus_unregister_twice)
|
||||
{
|
||||
|
@ -1072,6 +1073,7 @@ EFL_END_TEST
|
|||
|
||||
void efl_ui_test_focus(TCase *tc)
|
||||
{
|
||||
tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
|
||||
tcase_add_test(tc, focus_register_twice);
|
||||
tcase_add_test(tc, focus_unregister_twice);
|
||||
tcase_add_test(tc, pos_check);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <Efl_Ui.h>
|
||||
#include "efl_ui_suite.h"
|
||||
#include "eo_internal.h"
|
||||
#include "suite_helpers.h"
|
||||
|
||||
EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS)
|
||||
|
||||
|
@ -326,25 +327,6 @@ EFL_START_TEST(efl_ui_test_widget_disabled_behaviour)
|
|||
}
|
||||
EFL_END_TEST
|
||||
|
||||
static int tree_abort;
|
||||
static int tree_abort_level;
|
||||
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
eina_log_abort_on_critical_set(tree_abort);
|
||||
eina_log_abort_on_critical_level_set(tree_abort_level);
|
||||
}
|
||||
|
||||
static void
|
||||
_setup(void)
|
||||
{
|
||||
tree_abort = eina_log_abort_on_critical_get();
|
||||
tree_abort_level = eina_log_abort_on_critical_level_get();
|
||||
eina_log_abort_on_critical_level_set(2);
|
||||
eina_log_abort_on_critical_set(1);
|
||||
}
|
||||
|
||||
EFL_START_TEST(efl_ui_test_widget_win_provider_find)
|
||||
{
|
||||
State s;
|
||||
|
@ -359,7 +341,7 @@ EFL_END_TEST
|
|||
|
||||
void efl_ui_test_widget(TCase *tc)
|
||||
{
|
||||
tcase_add_checked_fixture(tc, _setup, _shutdown);
|
||||
tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
|
||||
tcase_add_test(tc, efl_ui_test_widget_parent_iterator);
|
||||
tcase_add_test(tc, efl_ui_test_widget_widget_iterator);
|
||||
tcase_add_test(tc, efl_ui_test_widget_widget_sub_iterator);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#define EFL_ACCESS_OBJECT_PROTECTED
|
||||
#include <Elementary.h>
|
||||
#include "elm_suite.h"
|
||||
#include "suite_helpers.h"
|
||||
|
||||
static Evas_Object *win, *genlist;
|
||||
static Elm_Gen_Item_Class itc = { .version = ELM_GENLIST_ITEM_CLASS_VERSION };
|
||||
|
@ -14,9 +15,6 @@ static int counter;
|
|||
static Efl_Access_Event_Children_Changed_Data ev_data;
|
||||
Evas_Object *content;
|
||||
|
||||
static int tree_abort_level;
|
||||
static int tree_abort;
|
||||
|
||||
static void
|
||||
verify_item_iteration_api(Elm_Object_Item *parent)
|
||||
{
|
||||
|
@ -452,8 +450,7 @@ static void
|
|||
_do_quit()
|
||||
{
|
||||
itc.func.content_get = NULL;
|
||||
eina_log_abort_on_critical_set(tree_abort);
|
||||
eina_log_abort_on_critical_level_set(tree_abort_level);
|
||||
fail_on_errors_teardown();
|
||||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
|
@ -513,11 +510,7 @@ EFL_START_TEST(elm_genlist_test_tree_expand)
|
|||
evas_object_resize(genlist, 100, 10 + 10 * NUM_TREE_ITEMS);
|
||||
evas_object_show(win);
|
||||
evas_object_resize(win, 100, 10 + 10 * NUM_TREE_ITEMS);
|
||||
tree_abort = eina_log_abort_on_critical_get();
|
||||
tree_abort_level = eina_log_abort_on_critical_level_get();
|
||||
/* this should never trigger errors */
|
||||
eina_log_abort_on_critical_level_set(1);
|
||||
eina_log_abort_on_critical_set(1);
|
||||
fail_on_errors_setup();
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
|
|
@ -12,24 +12,6 @@ Evas_Object *win = NULL;
|
|||
Evas_Object *widget = NULL;
|
||||
const Efl_Class *test_content_klass = NULL;
|
||||
EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS);
|
||||
static int tree_abort;
|
||||
static int tree_abort_level;
|
||||
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
eina_log_abort_on_critical_set(tree_abort);
|
||||
eina_log_abort_on_critical_level_set(tree_abort_level);
|
||||
}
|
||||
|
||||
static void
|
||||
_setup(void)
|
||||
{
|
||||
tree_abort = eina_log_abort_on_critical_get();
|
||||
tree_abort_level = eina_log_abort_on_critical_level_get();
|
||||
eina_log_abort_on_critical_level_set(2);
|
||||
eina_log_abort_on_critical_set(1);
|
||||
}
|
||||
|
||||
static void
|
||||
_setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass)
|
||||
|
|
|
@ -13,7 +13,7 @@ static void
|
|||
{}(TCase *tc)
|
||||
{{
|
||||
tcase_add_checked_fixture(tc, _{}_fixture, NULL);
|
||||
tcase_add_checked_fixture(tc, _setup, _shutdown);
|
||||
tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
|
||||
{}(tc);
|
||||
}}
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@ static Eina_Bool did_shutdown;
|
|||
static Evas_Object *global_win;
|
||||
static Eina_Bool buffer = EINA_FALSE;
|
||||
static Eina_Bool legacy_mode = EINA_FALSE;
|
||||
static int log_abort;
|
||||
static int log_abort_level;
|
||||
|
||||
void elm_test_init(TCase *tc);
|
||||
|
||||
|
@ -340,3 +342,19 @@ suite_setup(Eina_Bool legacy)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
fail_on_errors_teardown(void)
|
||||
{
|
||||
eina_log_abort_on_critical_set(log_abort);
|
||||
eina_log_abort_on_critical_level_set(log_abort_level);
|
||||
}
|
||||
|
||||
void
|
||||
fail_on_errors_setup(void)
|
||||
{
|
||||
log_abort = eina_log_abort_on_critical_get();
|
||||
log_abort_level = eina_log_abort_on_critical_level_get();
|
||||
eina_log_abort_on_critical_level_set(2);
|
||||
eina_log_abort_on_critical_set(1);
|
||||
}
|
||||
|
|
|
@ -7,5 +7,7 @@ int suite_setup(Eina_Bool legacy);
|
|||
void _elm2_suite_init(void);
|
||||
void _elm_suite_shutdown(void);
|
||||
void *real_timer_add(double in, Ecore_Task_Cb cb, void *data);
|
||||
void fail_on_errors_teardown(void);
|
||||
void fail_on_errors_setup(void);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue