Test rework #9: Efreet

this efreet test suite needs more love later
This commit is contained in:
Vincent Torri 2016-02-04 14:42:13 +01:00 committed by Tom Hacohen
parent 92ff735c11
commit 4498210eb4
18 changed files with 60 additions and 154 deletions

View File

@ -1,13 +1,12 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <Ecore.h>
#include "Efreet.h"
#include <Ecore.h>
#include <Efreet.h>
#include "ef_test.h"
#if 0

View File

@ -1,15 +1,13 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#include <Ecore_File.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <Ecore_File.h>
#include <Efreet.h>
int
ef_cb_efreet_data_home(void)

View File

@ -1,16 +1,15 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <Efreet.h>
#include "ef_test.h"
typedef struct

View File

@ -1,16 +1,15 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "Efreet.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <Ecore.h>
#include <Ecore_File.h>
#include <Efreet.h>
#define SIZE 128
#define THEME "Tango"

View File

@ -1,14 +1,13 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <Efreet.h>
#include "ef_test.h"
int

View File

@ -1,16 +1,15 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#define EFREET_MODULE_LOG_DOM /* no logging in this file */
#include "efreet_private.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <Efreet.h>
#define EFREET_MODULE_LOG_DOM /* no logging in this file */
#include "efreet_private.h"
int
ef_cb_locale(void)
{

View File

@ -1,13 +1,12 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <Efreet.h>
#include "ef_test.h"
#if 0

View File

@ -1,16 +1,15 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#include "Efreet_Mime.h"
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <Ecore.h>
#include <Efreet.h>
#include <Efreet_Mime.h>
#include "ef_test.h"
#define THEME "Tango"

View File

@ -1,8 +1,6 @@
#ifndef EF_TEST
#define EF_TEST
#include "config.h"
#include <eina_types.h>
#define IF_FREE(x) do { if (x) free(x); x = NULL; } while (0);

View File

@ -1,8 +1,11 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#include <stdio.h>
#include <Efreet.h>
int
ef_cb_utils(void)
{

View File

@ -1,6 +1,9 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <unistd.h>
#include <Eina.h>
#include <Ecore.h>
#include <Efreet.h>

View File

@ -1,10 +1,9 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <limits.h>
#include <stdio.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
@ -18,7 +17,7 @@
#define EFREET_MODULE_LOG_DOM /* no logging in this file */
#include "Efreet.h"
#include <Efreet.h>
#include "efreet_private.h"
#include "efreet_cache_private.h"

View File

@ -1,12 +1,11 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Efreet.h>
#include <stdio.h>
#include <limits.h>
#include <Efreet.h>
#include "ef_test.h"
static void dump(Efreet_Menu *menu, const char *path);

View File

@ -1,111 +1,28 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <Efreet.h>
#include "efreet_suite.h"
#include "../efl_check.h"
typedef struct _Efreet_Test_Case Efreet_Test_Case;
struct _Efreet_Test_Case
{
const char *test_case;
void (*build)(TCase *tc);
};
static const Efreet_Test_Case etc[] = {
static const Efl_Test_Case etc[] = {
{ "Efreet", efreet_test_efreet },
{ "Efreet Cache", efreet_test_efreet_cache },
{ NULL, NULL }
};
static void
_list_tests(void)
{
const Efreet_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 *
efreet_suite_build(int argc, const char **argv)
{
TCase *tc;
Suite *s;
int i;
s = suite_create("Efreet");
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");
s = efreet_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_NORMAL);
failed_count = srunner_ntests_failed(sr);
srunner_free(sr);
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Efreet", etc);
return (failed_count == 0) ? 0 : 255;
}

View File

@ -1,5 +1,3 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,3 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,3 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,15 +1,17 @@
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "Efreet.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <Ecore.h>
#include <Efreet.h>
#include <Efreet_Mime.h>
/* no logging */
#define EFREET_MODULE_LOG_DOM
#include "efreet_private.h"
#include "Efreet_Mime.h"
#include "config.h"
#include <Ecore.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int ef_cb_efreet_data_home(void);
int ef_cb_efreet_config_home(void);