diff options
author | Vincent Torri <vincent dot torri at gmail dot com> | 2016-02-04 15:11:52 +0100 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2016-02-16 12:41:06 +0000 |
commit | 71f0fb98f08f62473a59819a8322930bdd68f090 (patch) | |
tree | b9d78dd3e2c7dcb1acc56c6f655aabb8da97d724 /src/tests | |
parent | ee8ff34d7bbc1f3ff7b4e66ea53b4bfef4ee1736 (diff) | |
download | efl-71f0fb98f08f62473a59819a8322930bdd68f090.tar.gz |
Test rework #20: Evas
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/evas/evas_suite.c | 92 | ||||
-rw-r--r-- | src/tests/evas/evas_test_callbacks.c | 4 | ||||
-rw-r--r-- | src/tests/evas/evas_test_evasgl.c | 8 | ||||
-rw-r--r-- | src/tests/evas/evas_test_filters.c | 8 | ||||
-rw-r--r-- | src/tests/evas/evas_test_image.c | 5 | ||||
-rw-r--r-- | src/tests/evas/evas_test_init.c | 4 | ||||
-rw-r--r-- | src/tests/evas/evas_test_mask.c | 5 | ||||
-rw-r--r-- | src/tests/evas/evas_test_matrix.c | 5 | ||||
-rw-r--r-- | src/tests/evas/evas_test_mesh.c | 5 | ||||
-rw-r--r-- | src/tests/evas/evas_test_object.c | 3 | ||||
-rw-r--r-- | src/tests/evas/evas_test_object_smart.c | 3 | ||||
-rw-r--r-- | src/tests/evas/evas_test_render_engines.c | 3 | ||||
-rw-r--r-- | src/tests/evas/evas_test_text.c | 3 | ||||
-rw-r--r-- | src/tests/evas/evas_test_textblock.c | 6 |
14 files changed, 44 insertions, 110 deletions
diff --git a/src/tests/evas/evas_suite.c b/src/tests/evas/evas_suite.c index 3654ab60dc..3021f2c582 100644 --- a/src/tests/evas/evas_suite.c +++ b/src/tests/evas/evas_suite.c @@ -2,22 +2,12 @@ # include <config.h> #endif -#include <stdlib.h> -#include <stdio.h> - #include <Evas.h> #include "evas_suite.h" +#include "../efl_check.h" -typedef struct _Evas_Test_Case Evas_Test_Case; - -struct _Evas_Test_Case -{ - const char *test_case; - void (*build)(TCase *tc); -}; - -static const Evas_Test_Case etc[] = { +static const Efl_Test_Case etc[] = { { "Evas", evas_test_init }, { "Object", evas_test_object }, { "Object Textblock", evas_test_textblock }, @@ -34,88 +24,22 @@ static const Evas_Test_Case etc[] = { { NULL, NULL } }; -static void -_list_tests(void) -{ - const Evas_Test_Case *itr; - - itr = etc; - fputs("Available Test Cases:\n", stderr); - for (; itr->test_case; itr++) - fprintf(stderr, "\t%s\n", itr->test_case); -} -static Eina_Bool -_use_test(int argc, const char **argv, const char *test_case) -{ - if (argc < 1) - return 1; - - for (; argc > 0; argc--, argv++) - if (strcmp(test_case, *argv) == 0) - return 1; - return 0; -} - -static Suite * -evas_suite_build(int argc, const char **argv) -{ - TCase *tc; - Suite *s; - int i; - - s = suite_create("Evas"); - - for (i = 0; etc[i].test_case; ++i) - { - if (!_use_test(argc, argv, etc[i].test_case)) continue; - tc = tcase_create(etc[i].test_case); - - etc[i].build(tc); - - suite_add_tcase(s, tc); -#ifndef _WIN32 - tcase_set_timeout(tc, 0); -#endif - } - - return s; -} - int main(int argc, char **argv) { - Suite *s; - SRunner *sr; - int i, failed_count; + int failed_count; - for (i = 1; i < argc; i++) - if ((strcmp(argv[i], "-h") == 0) || - (strcmp(argv[i], "--help") == 0)) - { - fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n", - argv[0]); - _list_tests(); - return 0; - } - else if ((strcmp(argv[i], "-l") == 0) || - (strcmp(argv[i], "--list") == 0)) - { - _list_tests(); - return 0; - } + if (!_efl_test_option_disp(argc, argv, etc)) + return 0; putenv("EFL_RUN_IN_TREE=1"); evas_init(); - s = evas_suite_build(argc - 1, (const char **)argv + 1); - sr = srunner_create(s); - srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml"); - - srunner_run_all(sr, CK_ENV); - failed_count = srunner_ntests_failed(sr); - srunner_free(sr); + failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, + "Evas", etc); evas_shutdown(); + return (failed_count == 0) ? 0 : 255; } diff --git a/src/tests/evas/evas_test_callbacks.c b/src/tests/evas/evas_test_callbacks.c index f4244358ca..3f83847202 100644 --- a/src/tests/evas/evas_test_callbacks.c +++ b/src/tests/evas/evas_test_callbacks.c @@ -1,12 +1,12 @@ - #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdio.h> +#include <Evas.h> + #include "evas_suite.h" -#include "Evas.h" #include "evas_tests_helpers.h" #define START_CALLBACK_TEST() \ diff --git a/src/tests/evas/evas_test_evasgl.c b/src/tests/evas/evas_test_evasgl.c index 3263cfa74f..181ed2b031 100644 --- a/src/tests/evas/evas_test_evasgl.c +++ b/src/tests/evas/evas_test_evasgl.c @@ -17,10 +17,12 @@ #endif #define EFL_GFX_FILTER_BETA + +#include <Evas.h> +#include <Evas_GL.h> +#include <Ecore_Evas.h> + #include "evas_suite.h" -#include "Evas.h" -#include "Evas_GL.h" -#include "Ecore_Evas.h" static int _detect_osmesa(void) diff --git a/src/tests/evas/evas_test_filters.c b/src/tests/evas/evas_test_filters.c index 188bb0bfc4..47e9b4cf9a 100644 --- a/src/tests/evas/evas_test_filters.c +++ b/src/tests/evas/evas_test_filters.c @@ -10,10 +10,12 @@ #include <stdio.h> #define EFL_GFX_FILTER_BETA -#include "evas_suite.h" -#include "Evas.h" -#include "Ecore_Evas.h" + +#include <Evas.h> #include "../../lib/evas/include/evas_filter.h" +#include <Ecore_Evas.h> + +#include "evas_suite.h" #define TEST_FONT_NAME "DejaVuSans,UnDotum" #define TEST_FONT_SOURCE TESTS_SRC_DIR "/TestFont.eet" diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c index cfb0f9402c..e56db7ef39 100644 --- a/src/tests/evas/evas_test_image.c +++ b/src/tests/evas/evas_test_image.c @@ -2,13 +2,14 @@ # include "config.h" #endif +#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> -#include <stdio.h> + +#include <Evas.h> #include "evas_suite.h" -#include "Evas.h" #include "evas_tests_helpers.h" #define TESTS_IMG_DIR TESTS_SRC_DIR"/images" diff --git a/src/tests/evas/evas_test_init.c b/src/tests/evas/evas_test_init.c index 7637d9cb2a..827798f3ef 100644 --- a/src/tests/evas/evas_test_init.c +++ b/src/tests/evas/evas_test_init.c @@ -1,12 +1,12 @@ - #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdio.h> +#include <Evas.h> + #include "evas_suite.h" -#include "Evas.h" START_TEST(evas_simple) { diff --git a/src/tests/evas/evas_test_mask.c b/src/tests/evas/evas_test_mask.c index 1f055122a3..d3518d0558 100644 --- a/src/tests/evas/evas_test_mask.c +++ b/src/tests/evas/evas_test_mask.c @@ -4,9 +4,10 @@ #ifdef BUILD_ENGINE_BUFFER +#include <Evas.h> +#include <Ecore_Evas.h> + #include "evas_suite.h" -#include "Evas.h" -#include "Ecore_Evas.h" #include "evas_tests_helpers.h" #define TEST_FONT_NAME "DejaVuSans,UnDotum" diff --git a/src/tests/evas/evas_test_matrix.c b/src/tests/evas/evas_test_matrix.c index d365d24e75..b6df8f28de 100644 --- a/src/tests/evas/evas_test_matrix.c +++ b/src/tests/evas/evas_test_matrix.c @@ -2,15 +2,16 @@ # include "config.h" #endif +#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> -#include <stdio.h> +#include <Evas.h> #include "../../lib/evas/include/evas_common_private.h" #include "../../lib/evas/include/evas_private.h" + #include "evas_suite.h" -#include "Evas.h" #include "evas_tests_helpers.h" START_TEST(evas_matrix) diff --git a/src/tests/evas/evas_test_mesh.c b/src/tests/evas/evas_test_mesh.c index fe82f576d6..d70ab3225a 100644 --- a/src/tests/evas/evas_test_mesh.c +++ b/src/tests/evas/evas_test_mesh.c @@ -2,13 +2,14 @@ # include "config.h" #endif -#include <unistd.h> #include <stdio.h> +#include <unistd.h> +#include <Evas.h> #include "../../lib/evas/include/evas_common_private.h" #include "../../lib/evas/include/evas_private.h" + #include "evas_suite.h" -#include "Evas.h" #include "evas_tests_helpers.h" #define TESTS_MESH_DIR TESTS_SRC_DIR"/meshes" diff --git a/src/tests/evas/evas_test_object.c b/src/tests/evas/evas_test_object.c index 48770b72b1..6b722a5d88 100644 --- a/src/tests/evas/evas_test_object.c +++ b/src/tests/evas/evas_test_object.c @@ -4,8 +4,9 @@ #include <stdio.h> +#include <Evas.h> + #include "evas_suite.h" -#include "Evas.h" #include "evas_tests_helpers.h" START_TEST(evas_object_various) diff --git a/src/tests/evas/evas_test_object_smart.c b/src/tests/evas/evas_test_object_smart.c index 6f31197220..23a43b7ac3 100644 --- a/src/tests/evas/evas_test_object_smart.c +++ b/src/tests/evas/evas_test_object_smart.c @@ -8,10 +8,11 @@ #endif #include <stdio.h> + #include <Eina.h> +#include <Evas.h> #include "evas_suite.h" -#include "Evas.h" #include "evas_tests_helpers.h" #define TEST_FONT_SOURCE TESTS_SRC_DIR "/TestFont.eet" diff --git a/src/tests/evas/evas_test_render_engines.c b/src/tests/evas/evas_test_render_engines.c index 0f98bccc78..3f3ab09f56 100644 --- a/src/tests/evas/evas_test_render_engines.c +++ b/src/tests/evas/evas_test_render_engines.c @@ -4,8 +4,9 @@ #include <stdio.h> +#include <Evas.h> + #include "evas_suite.h" -#include "Evas.h" static Eina_Bool _find_list(const Eina_List *lst, const char *item) diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c index fe5644aed8..746fbee39b 100644 --- a/src/tests/evas/evas_test_text.c +++ b/src/tests/evas/evas_test_text.c @@ -5,8 +5,9 @@ #include <stdio.h> +#include <Evas.h> + #include "evas_suite.h" -#include "Evas.h" #include "evas_tests_helpers.h" #define TEST_FONT_NAME "DejaVuSans,UnDotum" diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 895021bf45..379bc2eafd 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -8,16 +8,14 @@ #endif #include <stdio.h> +#include <locale.h> #include <Eina.h> +#include <Evas.h> #include "evas_suite.h" -#include "Evas.h" - #include "evas_tests_helpers.h" -#include <locale.h> - /* Functions defined in evas_object_textblock.c */ EAPI Eina_Bool _evas_textblock_check_item_node_link(Evas_Object *obj); |