summaryrefslogtreecommitdiff
path: root/src/tests/efreet
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2016-02-04 14:42:13 +0100
committerTom Hacohen <tom@stosb.com>2016-02-16 12:41:06 +0000
commit4498210eb4aeff773b7e19fae22aadb1f2987e9e (patch)
treed402ed690ac6e153492353e825aa7f52236fd369 /src/tests/efreet
parent92ff735c110abac6fcb5cc9089d5c960d843888f (diff)
Test rework #9: Efreet
this efreet test suite needs more love later
Diffstat (limited to 'src/tests/efreet')
-rw-r--r--src/tests/efreet/ef_cache.c5
-rw-r--r--src/tests/efreet/ef_data_dirs.c10
-rw-r--r--src/tests/efreet/ef_desktop.c9
-rw-r--r--src/tests/efreet/ef_icon_theme.c7
-rw-r--r--src/tests/efreet/ef_ini.c9
-rw-r--r--src/tests/efreet/ef_locale.c9
-rw-r--r--src/tests/efreet/ef_menu.c7
-rw-r--r--src/tests/efreet/ef_mime.c9
-rw-r--r--src/tests/efreet/ef_test.h2
-rw-r--r--src/tests/efreet/ef_utils.c7
-rw-r--r--src/tests/efreet/efreet_async_test.c5
-rw-r--r--src/tests/efreet/efreet_icon_cache_dump.c7
-rw-r--r--src/tests/efreet/efreet_spec_test.c5
-rw-r--r--src/tests/efreet/efreet_suite.c97
-rw-r--r--src/tests/efreet/efreet_test_efreet.c2
-rw-r--r--src/tests/efreet/efreet_test_efreet_cache.c2
-rw-r--r--src/tests/efreet/efreet_user_dir.c2
-rw-r--r--src/tests/efreet/main.c18
18 files changed, 59 insertions, 153 deletions
diff --git a/src/tests/efreet/ef_cache.c b/src/tests/efreet/ef_cache.c
index c83aa01..847c97b 100644
--- a/src/tests/efreet/ef_cache.c
+++ b/src/tests/efreet/ef_cache.c
@@ -1,13 +1,12 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include <stdio.h> 5#include <stdio.h>
6
8#include <Ecore.h> 7#include <Ecore.h>
8#include <Efreet.h>
9 9
10#include "Efreet.h"
11#include "ef_test.h" 10#include "ef_test.h"
12 11
13#if 0 12#if 0
diff --git a/src/tests/efreet/ef_data_dirs.c b/src/tests/efreet/ef_data_dirs.c
index 894e2e0..d79b742 100644
--- a/src/tests/efreet/ef_data_dirs.c
+++ b/src/tests/efreet/ef_data_dirs.c
@@ -1,15 +1,13 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include "Efreet.h" 5#include <stdlib.h>
8
9#include <Ecore_File.h>
10#include <stdio.h> 6#include <stdio.h>
11#include <string.h> 7#include <string.h>
12#include <stdlib.h> 8
9#include <Ecore_File.h>
10#include <Efreet.h>
13 11
14int 12int
15ef_cb_efreet_data_home(void) 13ef_cb_efreet_data_home(void)
diff --git a/src/tests/efreet/ef_desktop.c b/src/tests/efreet/ef_desktop.c
index 2ceed1b..c4fa675 100644
--- a/src/tests/efreet/ef_desktop.c
+++ b/src/tests/efreet/ef_desktop.c
@@ -1,16 +1,15 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include "Efreet.h" 5#include <stdlib.h>
8#include "config.h"
9#include <stdio.h> 6#include <stdio.h>
10#include <string.h> 7#include <string.h>
11#include <stdlib.h>
12#include <unistd.h> 8#include <unistd.h>
13#include <limits.h> 9#include <limits.h>
10
11#include <Efreet.h>
12
14#include "ef_test.h" 13#include "ef_test.h"
15 14
16typedef struct 15typedef struct
diff --git a/src/tests/efreet/ef_icon_theme.c b/src/tests/efreet/ef_icon_theme.c
index a0d1f1a..7b4cb5b 100644
--- a/src/tests/efreet/ef_icon_theme.c
+++ b/src/tests/efreet/ef_icon_theme.c
@@ -1,16 +1,15 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4#include "config.h" 2#include "config.h"
5#endif 3#endif
6 4
7#include "Efreet.h" 5#include <stdlib.h>
8#include <stdio.h> 6#include <stdio.h>
9#include <string.h> 7#include <string.h>
10#include <stdlib.h>
11#include <limits.h> 8#include <limits.h>
9
12#include <Ecore.h> 10#include <Ecore.h>
13#include <Ecore_File.h> 11#include <Ecore_File.h>
12#include <Efreet.h>
14 13
15#define SIZE 128 14#define SIZE 128
16#define THEME "Tango" 15#define THEME "Tango"
diff --git a/src/tests/efreet/ef_ini.c b/src/tests/efreet/ef_ini.c
index 9fb95ca..57457e0 100644
--- a/src/tests/efreet/ef_ini.c
+++ b/src/tests/efreet/ef_ini.c
@@ -1,14 +1,13 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include "Efreet.h" 5#include <stdlib.h>
8#include "config.h"
9#include <stdio.h> 6#include <stdio.h>
10#include <string.h> 7#include <string.h>
11#include <stdlib.h> 8
9#include <Efreet.h>
10
12#include "ef_test.h" 11#include "ef_test.h"
13 12
14int 13int
diff --git a/src/tests/efreet/ef_locale.c b/src/tests/efreet/ef_locale.c
index 7ad47f2..3d52f6f 100644
--- a/src/tests/efreet/ef_locale.c
+++ b/src/tests/efreet/ef_locale.c
@@ -1,16 +1,15 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include "Efreet.h"
8#define EFREET_MODULE_LOG_DOM /* no logging in this file */
9#include "efreet_private.h"
10#include <stdlib.h> 5#include <stdlib.h>
11#include <stdio.h> 6#include <stdio.h>
12#include <string.h> 7#include <string.h>
13 8
9#include <Efreet.h>
10#define EFREET_MODULE_LOG_DOM /* no logging in this file */
11#include "efreet_private.h"
12
14int 13int
15ef_cb_locale(void) 14ef_cb_locale(void)
16{ 15{
diff --git a/src/tests/efreet/ef_menu.c b/src/tests/efreet/ef_menu.c
index ba53bff..4917341 100644
--- a/src/tests/efreet/ef_menu.c
+++ b/src/tests/efreet/ef_menu.c
@@ -1,13 +1,12 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include "Efreet.h"
8#include "config.h"
9#include <stdio.h> 5#include <stdio.h>
10#include <unistd.h> 6#include <unistd.h>
7
8#include <Efreet.h>
9
11#include "ef_test.h" 10#include "ef_test.h"
12 11
13#if 0 12#if 0
diff --git a/src/tests/efreet/ef_mime.c b/src/tests/efreet/ef_mime.c
index 8940974..adbb2aa 100644
--- a/src/tests/efreet/ef_mime.c
+++ b/src/tests/efreet/ef_mime.c
@@ -1,16 +1,15 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include "Efreet.h"
8#include "Efreet_Mime.h"
9#include "config.h"
10#include <stdio.h> 5#include <stdio.h>
11#include <string.h> 6#include <string.h>
12#include <sys/time.h> 7#include <sys/time.h>
8
13#include <Ecore.h> 9#include <Ecore.h>
10#include <Efreet.h>
11#include <Efreet_Mime.h>
12
14#include "ef_test.h" 13#include "ef_test.h"
15 14
16#define THEME "Tango" 15#define THEME "Tango"
diff --git a/src/tests/efreet/ef_test.h b/src/tests/efreet/ef_test.h
index 5d2b83a..4fdde4d 100644
--- a/src/tests/efreet/ef_test.h
+++ b/src/tests/efreet/ef_test.h
@@ -1,8 +1,6 @@
1#ifndef EF_TEST 1#ifndef EF_TEST
2#define EF_TEST 2#define EF_TEST
3 3
4#include "config.h"
5
6#include <eina_types.h> 4#include <eina_types.h>
7 5
8#define IF_FREE(x) do { if (x) free(x); x = NULL; } while (0); 6#define IF_FREE(x) do { if (x) free(x); x = NULL; } while (0);
diff --git a/src/tests/efreet/ef_utils.c b/src/tests/efreet/ef_utils.c
index 75f520d..7ecda39 100644
--- a/src/tests/efreet/ef_utils.c
+++ b/src/tests/efreet/ef_utils.c
@@ -1,8 +1,11 @@
1#include "config.h" 1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
2 4
3#include "Efreet.h"
4#include <stdio.h> 5#include <stdio.h>
5 6
7#include <Efreet.h>
8
6int 9int
7ef_cb_utils(void) 10ef_cb_utils(void)
8{ 11{
diff --git a/src/tests/efreet/efreet_async_test.c b/src/tests/efreet/efreet_async_test.c
index ce85e42..49acaa0 100644
--- a/src/tests/efreet/efreet_async_test.c
+++ b/src/tests/efreet/efreet_async_test.c
@@ -1,6 +1,9 @@
1#include "config.h" 1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
2 4
3#include <unistd.h> 5#include <unistd.h>
6
4#include <Eina.h> 7#include <Eina.h>
5#include <Ecore.h> 8#include <Ecore.h>
6#include <Efreet.h> 9#include <Efreet.h>
diff --git a/src/tests/efreet/efreet_icon_cache_dump.c b/src/tests/efreet/efreet_icon_cache_dump.c
index 095f8fa..313c890 100644
--- a/src/tests/efreet/efreet_icon_cache_dump.c
+++ b/src/tests/efreet/efreet_icon_cache_dump.c
@@ -1,10 +1,9 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6#include <limits.h> 4
7#include <stdio.h> 5#include <stdio.h>
6#include <limits.h>
8#include <sys/stat.h> 7#include <sys/stat.h>
9#include <sys/mman.h> 8#include <sys/mman.h>
10#include <fcntl.h> 9#include <fcntl.h>
@@ -18,7 +17,7 @@
18 17
19#define EFREET_MODULE_LOG_DOM /* no logging in this file */ 18#define EFREET_MODULE_LOG_DOM /* no logging in this file */
20 19
21#include "Efreet.h" 20#include <Efreet.h>
22#include "efreet_private.h" 21#include "efreet_private.h"
23#include "efreet_cache_private.h" 22#include "efreet_cache_private.h"
24 23
diff --git a/src/tests/efreet/efreet_spec_test.c b/src/tests/efreet/efreet_spec_test.c
index 92ce538..c209107 100644
--- a/src/tests/efreet/efreet_spec_test.c
+++ b/src/tests/efreet/efreet_spec_test.c
@@ -1,12 +1,11 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include <Efreet.h>
8#include <stdio.h> 5#include <stdio.h>
9#include <limits.h> 6#include <limits.h>
7
8#include <Efreet.h>
10#include "ef_test.h" 9#include "ef_test.h"
11 10
12static void dump(Efreet_Menu *menu, const char *path); 11static void dump(Efreet_Menu *menu, const char *path);
diff --git a/src/tests/efreet/efreet_suite.c b/src/tests/efreet/efreet_suite.c
index bbfd69c..732e101 100644
--- a/src/tests/efreet/efreet_suite.c
+++ b/src/tests/efreet/efreet_suite.c
@@ -1,111 +1,28 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
6 4
7#include <stdlib.h>
8#include <stdio.h>
9
10#include <Efreet.h>
11
12#include "efreet_suite.h" 5#include "efreet_suite.h"
6#include "../efl_check.h"
13 7
14typedef struct _Efreet_Test_Case Efreet_Test_Case; 8static const Efl_Test_Case etc[] = {
15
16struct _Efreet_Test_Case
17{
18 const char *test_case;
19 void (*build)(TCase *tc);
20};
21
22static const Efreet_Test_Case etc[] = {
23 { "Efreet", efreet_test_efreet }, 9 { "Efreet", efreet_test_efreet },
24 { "Efreet Cache", efreet_test_efreet_cache }, 10 { "Efreet Cache", efreet_test_efreet_cache },
25 { NULL, NULL } 11 { NULL, NULL }
26}; 12};
27 13
28static void
29_list_tests(void)
30{
31 const Efreet_Test_Case *itr;
32
33 itr = etc;
34 fputs("Available Test Cases:\n", stderr);
35 for (; itr->test_case; itr++)
36 fprintf(stderr, "\t%s\n", itr->test_case);
37}
38
39static Eina_Bool
40_use_test(int argc, const char **argv, const char *test_case)
41{
42 if (argc < 1)
43 return 1;
44
45 for (; argc > 0; argc--, argv++)
46 if (strcmp(test_case, *argv) == 0)
47 return 1;
48 return 0;
49}
50
51static Suite *
52efreet_suite_build(int argc, const char **argv)
53{
54 TCase *tc;
55 Suite *s;
56 int i;
57
58 s = suite_create("Efreet");
59
60 for (i = 0; etc[i].test_case; ++i)
61 {
62 if (!_use_test(argc, argv, etc[i].test_case)) continue;
63 tc = tcase_create(etc[i].test_case);
64
65 etc[i].build(tc);
66
67 suite_add_tcase(s, tc);
68#ifndef _WIN32
69 tcase_set_timeout(tc, 0);
70#endif
71 }
72
73 return s;
74}
75
76int 14int
77main(int argc, char **argv) 15main(int argc, char **argv)
78{ 16{
79 Suite *s; 17 int failed_count;
80 SRunner *sr;
81 int i, failed_count;
82 18
83 for (i = 1; i < argc; i++) 19 if (!_efl_test_option_disp(argc, argv, etc))
84 if ((strcmp(argv[i], "-h") == 0) || 20 return 0;
85 (strcmp(argv[i], "--help") == 0))
86 {
87 fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n",
88 argv[0]);
89 _list_tests();
90 return 0;
91 }
92 else if ((strcmp(argv[i], "-l") == 0) ||
93 (strcmp(argv[i], "--list") == 0))
94 {
95 _list_tests();
96 return 0;
97 }
98 21
99 putenv("EFL_RUN_IN_TREE=1"); 22 putenv("EFL_RUN_IN_TREE=1");
100 23
101 s = efreet_suite_build(argc - 1, (const char **)argv + 1); 24 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
102 sr = srunner_create(s); 25 "Efreet", etc);
103
104 srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml");
105
106 srunner_run_all(sr, CK_NORMAL);
107 failed_count = srunner_ntests_failed(sr);
108 srunner_free(sr);
109 26
110 return (failed_count == 0) ? 0 : 255; 27 return (failed_count == 0) ? 0 : 255;
111} 28}
diff --git a/src/tests/efreet/efreet_test_efreet.c b/src/tests/efreet/efreet_test_efreet.c
index a21a388..d35ec9e 100644
--- a/src/tests/efreet/efreet_test_efreet.c
+++ b/src/tests/efreet/efreet_test_efreet.c
@@ -1,5 +1,3 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
diff --git a/src/tests/efreet/efreet_test_efreet_cache.c b/src/tests/efreet/efreet_test_efreet_cache.c
index 1e15953..2f8972d 100644
--- a/src/tests/efreet/efreet_test_efreet_cache.c
+++ b/src/tests/efreet/efreet_test_efreet_cache.c
@@ -1,5 +1,3 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
diff --git a/src/tests/efreet/efreet_user_dir.c b/src/tests/efreet/efreet_user_dir.c
index 7a37fb0..1555efd 100644
--- a/src/tests/efreet/efreet_user_dir.c
+++ b/src/tests/efreet/efreet_user_dir.c
@@ -1,5 +1,3 @@
1#include "config.h"
2
3#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
4# include <config.h> 2# include <config.h>
5#endif 3#endif
diff --git a/src/tests/efreet/main.c b/src/tests/efreet/main.c
index 4bf2697..6c8a700 100644
--- a/src/tests/efreet/main.c
+++ b/src/tests/efreet/main.c
@@ -1,15 +1,17 @@
1#include "config.h" 1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <stdio.h>
7#include <string.h>
2 8
3#include "Efreet.h" 9#include <Ecore.h>
10#include <Efreet.h>
11#include <Efreet_Mime.h>
4/* no logging */ 12/* no logging */
5#define EFREET_MODULE_LOG_DOM 13#define EFREET_MODULE_LOG_DOM
6#include "efreet_private.h" 14#include "efreet_private.h"
7#include "Efreet_Mime.h"
8#include "config.h"
9#include <Ecore.h>
10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13 15
14int ef_cb_efreet_data_home(void); 16int ef_cb_efreet_data_home(void);
15int ef_cb_efreet_config_home(void); 17int ef_cb_efreet_config_home(void);