Test rework #20: Evas

This commit is contained in:
Vincent Torri 2016-02-04 15:11:52 +01:00 committed by Tom Hacohen
parent ee8ff34d7b
commit 71f0fb98f0
14 changed files with 44 additions and 110 deletions

View File

@ -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;
}

View File

@ -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() \

View File

@ -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)

View File

@ -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"

View File

@ -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"

View File

@ -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)
{

View File

@ -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"

View File

@ -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)

View File

@ -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"

View File

@ -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)

View File

@ -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"

View File

@ -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)

View File

@ -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"

View File

@ -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);