diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2018-03-26 14:19:28 -0400 |
---|---|---|
committer | Stefan Schmidt <stefan@osg.samsung.com> | 2018-04-05 11:10:25 +0200 |
commit | adc601aca2f0a16784af36bf6ae7dd20eeb33202 (patch) | |
tree | cac0a78fa40e88abb028b06d985c28bf89da269c /src/tests/eo | |
parent | b340b5e49ccae48a7d5adbbfa301af39e232348c (diff) | |
download | efl-adc601aca2f0a16784af36bf6ae7dd20eeb33202.tar.gz |
tests: add instrumentation to existing tests to find slow tests
efl_check.h must be included and the EFL_START/END_TEST macros must be
used in place of normal START/END_TEST macros
timing is enabled when TIMING_ENABLED is set
https://phab.enlightenment.org/w/improve_tests/
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Diffstat (limited to 'src/tests/eo')
-rw-r--r-- | src/tests/eo/suite/eo_suite.h | 2 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_call_errors.c | 16 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_class_behaviour_errors.c | 8 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_class_errors.c | 24 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_event.c | 12 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_general.c | 100 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_init.c | 8 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_threaded_calls.c | 4 | ||||
-rw-r--r-- | src/tests/eo/suite/eo_test_value.c | 4 |
9 files changed, 89 insertions, 89 deletions
diff --git a/src/tests/eo/suite/eo_suite.h b/src/tests/eo/suite/eo_suite.h index 173965fdf7..8895168248 100644 --- a/src/tests/eo/suite/eo_suite.h +++ b/src/tests/eo/suite/eo_suite.h @@ -2,7 +2,7 @@ #define _EO_SUITE_H #include <check.h> - +#include "../../efl_check.h" void eo_test_init(TCase *tc); void eo_test_general(TCase *tc); void eo_test_class_errors(TCase *tc); diff --git a/src/tests/eo/suite/eo_test_call_errors.c b/src/tests/eo/suite/eo_test_call_errors.c index c20f7f7e83..83d6eaac2b 100644 --- a/src/tests/eo/suite/eo_test_call_errors.c +++ b/src/tests/eo/suite/eo_test_call_errors.c @@ -12,7 +12,7 @@ static struct log_ctx ctx; -START_TEST(eo_pure_virtual_fct_call) +EFL_START_TEST(eo_pure_virtual_fct_call) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -28,9 +28,9 @@ START_TEST(eo_pure_virtual_fct_call) eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_api_not_implemented_call) +EFL_START_TEST(eo_api_not_implemented_call) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -46,9 +46,9 @@ START_TEST(eo_api_not_implemented_call) eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_op_not_found_in_super) +EFL_START_TEST(eo_op_not_found_in_super) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -64,7 +64,7 @@ START_TEST(eo_op_not_found_in_super) eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); efl_object_shutdown(); } -END_TEST +EFL_END_TEST //the fallback code that will be called @@ -110,7 +110,7 @@ static const Efl_Class_Description errorcase_class_desc = { EFL_DEFINE_CLASS(simple_errorcase_class_get, &errorcase_class_desc, EO_CLASS, NULL) -START_TEST(eo_fallbackcall_execute) +EFL_START_TEST(eo_fallbackcall_execute) { efl_object_init(); @@ -126,7 +126,7 @@ START_TEST(eo_fallbackcall_execute) efl_object_shutdown(); } -END_TEST +EFL_END_TEST void eo_test_call_errors(TCase *tc) { diff --git a/src/tests/eo/suite/eo_test_class_behaviour_errors.c b/src/tests/eo/suite/eo_test_class_behaviour_errors.c index c39fe0eff4..22591cb578 100644 --- a/src/tests/eo/suite/eo_test_class_behaviour_errors.c +++ b/src/tests/eo/suite/eo_test_class_behaviour_errors.c @@ -32,7 +32,7 @@ _destructor_unref_class_initializer(Efl_Class *klass2) return efl_class_functions_set(klass2, &ops, NULL); } -START_TEST(efl_destructor_unref) +EFL_START_TEST(efl_destructor_unref) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -60,9 +60,9 @@ START_TEST(efl_destructor_unref) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_destructor_double_del) +EFL_START_TEST(efl_destructor_double_del) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -92,7 +92,7 @@ START_TEST(efl_destructor_double_del) efl_object_shutdown(); } -END_TEST +EFL_END_TEST void eo_test_class_behaviour_errors(TCase *tc) { diff --git a/src/tests/eo/suite/eo_test_class_errors.c b/src/tests/eo/suite/eo_test_class_errors.c index ef15c99707..e4d9e77954 100644 --- a/src/tests/eo/suite/eo_test_class_errors.c +++ b/src/tests/eo/suite/eo_test_class_errors.c @@ -12,7 +12,7 @@ static struct log_ctx ctx; -START_TEST(eo_inherit_errors) +EFL_START_TEST(eo_inherit_errors) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -74,9 +74,9 @@ START_TEST(eo_inherit_errors) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_inconsistent_mro) +EFL_START_TEST(eo_inconsistent_mro) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -150,11 +150,11 @@ START_TEST(eo_inconsistent_mro) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static void _stub_class_constructor(Efl_Class *klass EINA_UNUSED) {} -START_TEST(eo_bad_interface) +EFL_START_TEST(eo_bad_interface) { efl_object_init(); eina_log_print_cb_set(eo_test_safety_print_cb, &ctx); @@ -197,7 +197,7 @@ START_TEST(eo_bad_interface) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static void _null_fct(Eo *eo_obj EINA_UNUSED, void *d EINA_UNUSED) { } void null_fct (void) {} @@ -212,7 +212,7 @@ _null_class_initializer(Efl_Class *klass) return efl_class_functions_set(klass, &ops, NULL); } -START_TEST(eo_null_api) +EFL_START_TEST(eo_null_api) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -238,7 +238,7 @@ START_TEST(eo_null_api) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static Eina_Bool _redefined_class_initializer(Efl_Class *klass) @@ -251,7 +251,7 @@ _redefined_class_initializer(Efl_Class *klass) return efl_class_functions_set(klass, &ops, NULL); } -START_TEST(eo_api_redefined) +EFL_START_TEST(eo_api_redefined) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -277,7 +277,7 @@ START_TEST(eo_api_redefined) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static Eina_Bool _dich_func_class_initializer(Efl_Class *klass) @@ -290,7 +290,7 @@ _dich_func_class_initializer(Efl_Class *klass) return efl_class_functions_set(klass, &ops, NULL); } -START_TEST(eo_dich_func_override) +EFL_START_TEST(eo_dich_func_override) { efl_object_init(); eina_log_print_cb_set(eo_test_print_cb, &ctx); @@ -316,7 +316,7 @@ START_TEST(eo_dich_func_override) efl_object_shutdown(); } -END_TEST +EFL_END_TEST void eo_test_class_errors(TCase *tc) { diff --git a/src/tests/eo/suite/eo_test_event.c b/src/tests/eo/suite/eo_test_event.c index 43420e3791..7adc7fd29e 100644 --- a/src/tests/eo/suite/eo_test_event.c +++ b/src/tests/eo/suite/eo_test_event.c @@ -57,7 +57,7 @@ _cb1(void *data, const Efl_Event *event) efl_event_callback_add(event->object, EFL_TEST_EVENT_EVENT_TESTER, _cb3, data); } -START_TEST(eo_event) +EFL_START_TEST(eo_event) { Test_Data data; efl_object_init(); @@ -81,7 +81,7 @@ START_TEST(eo_event) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static void _cb_rec_3(void *data EINA_UNUSED, const Efl_Event *event) @@ -117,7 +117,7 @@ _cb_rec_1(void *data, const Efl_Event *event) } } -START_TEST(eo_event_call_in_call) +EFL_START_TEST(eo_event_call_in_call) { Test_Data data; efl_object_init(); @@ -134,7 +134,7 @@ START_TEST(eo_event_call_in_call) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static Eina_Bool emitted = 0; @@ -162,7 +162,7 @@ _generation_clamp_step1(void *data EINA_UNUSED, const Efl_Event *e) } -START_TEST(eo_event_generation_bug) +EFL_START_TEST(eo_event_generation_bug) { efl_object_init(); @@ -189,7 +189,7 @@ START_TEST(eo_event_generation_bug) efl_object_shutdown(); } -END_TEST +EFL_END_TEST void eo_test_event(TCase *tc) diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c index a9cba7d449..a52935a9aa 100644 --- a/src/tests/eo/suite/eo_test_general.c +++ b/src/tests/eo/suite/eo_test_general.c @@ -19,7 +19,7 @@ /* Loading this internal header for testing purposes. */ #include "eo_ptr_indirection.h" -START_TEST(eo_simple) +EFL_START_TEST(eo_simple) { efl_object_init(); Eo *obj = efl_add_ref(EO_CLASS, NULL); @@ -33,9 +33,9 @@ START_TEST(eo_simple) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_singleton) +EFL_START_TEST(eo_singleton) { efl_object_init(); @@ -52,7 +52,7 @@ START_TEST(eo_singleton) efl_object_shutdown(); } -END_TEST +EFL_END_TEST #define OVERRIDE_A_SIMPLE 100859 #define OVERRIDE_A 324000 @@ -68,7 +68,7 @@ _simple_obj_override_a_double_set(Eo *obj, void *class_data EINA_UNUSED, int a) simple_a_set(efl_super(obj, EFL_OBJECT_OVERRIDE_CLASS), 2 * a); } -START_TEST(efl_object_override_tests) +EFL_START_TEST(efl_object_override_tests) { efl_object_init(); @@ -135,7 +135,7 @@ START_TEST(efl_object_override_tests) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static int _eo_signals_cb_current = 0; static int _eo_signals_cb_flag = 0; @@ -197,7 +197,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_eo_signals_callbacks, { EV_A_CHANGED, _eo_signals_a_changed_never }, { EFL_EVENT_DEL, _eo_signals_efl_del_cb }); -START_TEST(eo_signals) +EFL_START_TEST(eo_signals) { efl_object_init(); @@ -282,9 +282,9 @@ START_TEST(eo_signals) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_data_fetch) +EFL_START_TEST(efl_data_fetch) { efl_object_init(); @@ -321,9 +321,9 @@ START_TEST(efl_data_fetch) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_data_safe_fetch) +EFL_START_TEST(efl_data_safe_fetch) { efl_object_init(); @@ -345,9 +345,9 @@ START_TEST(efl_data_safe_fetch) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_isa_tests) +EFL_START_TEST(efl_isa_tests) { efl_object_init(); @@ -421,10 +421,10 @@ START_TEST(efl_isa_tests) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_composite_tests) +EFL_START_TEST(efl_composite_tests) { efl_object_init(); @@ -454,7 +454,7 @@ START_TEST(efl_composite_tests) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static Eina_Bool _man_should_con = EINA_TRUE; static Eina_Bool _man_should_des = EINA_TRUE; @@ -487,7 +487,7 @@ _class_initializer(Efl_Class *klass) return efl_class_functions_set(klass, &ops, NULL); } -START_TEST(eo_man_free) +EFL_START_TEST(eo_man_free) { efl_object_init(); @@ -566,9 +566,9 @@ START_TEST(eo_man_free) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_refs) +EFL_START_TEST(efl_refs) { efl_object_init(); Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL); @@ -699,9 +699,9 @@ START_TEST(efl_refs) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_weak_reference) +EFL_START_TEST(efl_weak_reference) { efl_object_init(); @@ -770,9 +770,9 @@ START_TEST(efl_weak_reference) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_generic_data) +EFL_START_TEST(eo_generic_data) { efl_object_init(); Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL); @@ -943,10 +943,10 @@ START_TEST(eo_generic_data) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_magic_checks) +EFL_START_TEST(eo_magic_checks) { char _buf[sizeof(long)]; /* Just enough to hold eina magic + a bit more. */ char *buf = _buf; @@ -1035,7 +1035,7 @@ START_TEST(eo_magic_checks) efl_object_shutdown(); } -END_TEST +EFL_END_TEST /* resolve issues */ @@ -1059,7 +1059,7 @@ _multi_class_initializer(Efl_Class *klass) return efl_class_functions_set(klass, &ops, NULL); } -START_TEST(efl_func_resolve) +EFL_START_TEST(efl_func_resolve) { efl_object_init(); @@ -1095,9 +1095,9 @@ START_TEST(efl_func_resolve) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(efl_add_do_and_custom) +EFL_START_TEST(efl_add_do_and_custom) { Simple_Public_Data *pd = NULL; Eo *obj = NULL; @@ -1129,9 +1129,9 @@ START_TEST(efl_add_do_and_custom) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_pointers_indirection) +EFL_START_TEST(eo_pointers_indirection) { #ifdef HAVE_EO_ID efl_object_init(); @@ -1216,7 +1216,7 @@ START_TEST(eo_pointers_indirection) efl_object_shutdown(); #endif } -END_TEST +EFL_END_TEST static Eo * @@ -1235,7 +1235,7 @@ _add_failures_class_initializer(Efl_Class *klass) return efl_class_functions_set(klass, &ops, NULL); } -START_TEST(efl_add_failures) +EFL_START_TEST(efl_add_failures) { efl_object_init(); @@ -1257,7 +1257,7 @@ START_TEST(efl_add_failures) efl_object_shutdown(); } -END_TEST +EFL_END_TEST #ifdef HAVE_EO_ID static Eina_Bool intercepted = EINA_FALSE; @@ -1277,7 +1277,7 @@ _del_intercept_reuse(Eo *obj) } #endif -START_TEST(efl_del_intercept) +EFL_START_TEST(efl_del_intercept) { #ifdef HAVE_EO_ID efl_object_init(); @@ -1333,9 +1333,9 @@ START_TEST(efl_del_intercept) efl_object_shutdown(); #endif } -END_TEST +EFL_END_TEST -START_TEST(efl_name) +EFL_START_TEST(efl_name) { efl_object_init(); Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL); @@ -1390,9 +1390,9 @@ START_TEST(efl_name) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_comment) +EFL_START_TEST(eo_comment) { efl_object_init(); Eo *obj = efl_add_ref(SIMPLE_CLASS, NULL); @@ -1420,9 +1420,9 @@ START_TEST(eo_comment) efl_object_shutdown(); } -END_TEST +EFL_END_TEST -START_TEST(eo_rec_interface) +EFL_START_TEST(eo_rec_interface) { efl_object_init(); Eo *s = efl_add_ref(SEARCHABLE_CLASS, NULL); @@ -1437,7 +1437,7 @@ START_TEST(eo_rec_interface) efl_object_shutdown(); } -END_TEST +EFL_END_TEST typedef struct { @@ -1530,7 +1530,7 @@ _timeout(int val EINA_UNUSED) } #endif -START_TEST(eo_domain) +EFL_START_TEST(eo_domain) { Eo *obj, *objs; @@ -1621,7 +1621,7 @@ START_TEST(eo_domain) signal(SIGALRM, NULL); #endif } -END_TEST +EFL_END_TEST static int @@ -1652,7 +1652,7 @@ _cast_inherit_class_initializer_2(Efl_Class *klass) return efl_class_functions_set(klass, &ops, NULL); } -START_TEST(efl_cast_test) +EFL_START_TEST(efl_cast_test) { efl_object_init(); @@ -1717,7 +1717,7 @@ START_TEST(efl_cast_test) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static void _destruct_test_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) { @@ -1737,7 +1737,7 @@ static void _destruct_test_destruct_cb(void *data, const Efl_Event *ev) //ck_assert_int_ne(efl_destructed_is(ev->object), 0); } -START_TEST(efl_object_destruct_test) +EFL_START_TEST(efl_object_destruct_test) { int var = 0; Eo *obj; @@ -1755,7 +1755,7 @@ START_TEST(efl_object_destruct_test) efl_object_shutdown(); } -END_TEST +EFL_END_TEST static void _auto_unref_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) @@ -1763,7 +1763,7 @@ _auto_unref_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) *((int *) data) = 1; } -START_TEST(efl_object_auto_unref_test) +EFL_START_TEST(efl_object_auto_unref_test) { int _auto_unref_del; Eo *obj, *parent; @@ -1808,7 +1808,7 @@ START_TEST(efl_object_auto_unref_test) efl_object_shutdown(); } -END_TEST +EFL_END_TEST void eo_test_general(TCase *tc) { diff --git a/src/tests/eo/suite/eo_test_init.c b/src/tests/eo/suite/eo_test_init.c index a625847b7d..31e16d2099 100644 --- a/src/tests/eo/suite/eo_test_init.c +++ b/src/tests/eo/suite/eo_test_init.c @@ -7,16 +7,16 @@ #include "eo_suite.h" #include "eo_test_class_simple.h" -START_TEST(eo_test_simple) +EFL_START_TEST(eo_test_simple) { fail_if(!efl_object_init()); /* one init by test suite */ fail_if(!efl_object_init()); fail_if(!efl_object_shutdown()); fail_if(efl_object_shutdown()); } -END_TEST +EFL_END_TEST -START_TEST(eo_test_init_shutdown) +EFL_START_TEST(eo_test_init_shutdown) { Eo *obj; @@ -40,7 +40,7 @@ START_TEST(eo_test_init_shutdown) ck_assert_int_eq(0xBEEF, simple2_class_beef_get(SIMPLE2_CLASS)); fail_if(efl_object_shutdown()); } -END_TEST +EFL_END_TEST void eo_test_init(TCase *tc) { diff --git a/src/tests/eo/suite/eo_test_threaded_calls.c b/src/tests/eo/suite/eo_test_threaded_calls.c index a42de16352..92d023c6dd 100644 --- a/src/tests/eo/suite/eo_test_threaded_calls.c +++ b/src/tests/eo/suite/eo_test_threaded_calls.c @@ -111,7 +111,7 @@ _thread_job(void *data, Eina_Thread t EINA_UNUSED) return (void *) (uintptr_t) v; } -START_TEST(eo_threaded_calls_test) +EFL_START_TEST(eo_threaded_calls_test) { Eina_Thread threads[2]; @@ -135,7 +135,7 @@ START_TEST(eo_threaded_calls_test) efl_object_shutdown(); } -END_TEST +EFL_END_TEST void eo_test_threaded_calls(TCase *tc) { diff --git a/src/tests/eo/suite/eo_test_value.c b/src/tests/eo/suite/eo_test_value.c index 19ce91c331..36709a9043 100644 --- a/src/tests/eo/suite/eo_test_value.c +++ b/src/tests/eo/suite/eo_test_value.c @@ -9,7 +9,7 @@ #include "eo_suite.h" #include "eo_test_class_simple.h" -START_TEST(eo_value) +EFL_START_TEST(eo_value) { efl_object_init(); char *str, *str2; @@ -47,7 +47,7 @@ START_TEST(eo_value) efl_object_shutdown(); } -END_TEST +EFL_END_TEST void eo_test_value(TCase *tc) { |