summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvivek <vivek.ellur@samsung.com>2015-04-15 16:59:38 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-07 09:53:07 +0200
commita415fa9a7f11db0aa5716772e2a2015d987590e4 (patch)
treeceb68f76d672eda34a858ede0bd836642d778be5 /src
parent35119e7bfdc7c13c2041293f3d0b2ebe1fb7c313 (diff)
emile: add emile_suite_build function to separate creation of test suite.
Summary: Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2319 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/tests/emile/emile_suite.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/tests/emile/emile_suite.c b/src/tests/emile/emile_suite.c
index 9ba150f66b..7d37367bb1 100644
--- a/src/tests/emile/emile_suite.c
+++ b/src/tests/emile/emile_suite.c
@@ -44,7 +44,7 @@ _list_tests(void)
44} 44}
45 45
46static Eina_Bool 46static Eina_Bool
47_use_test(const char *name, int argc, char *argv[]) 47_use_test(const char *name, int argc, const char *argv[])
48{ 48{
49 argc--; 49 argc--;
50 argv--; 50 argv--;
@@ -58,12 +58,36 @@ _use_test(const char *name, int argc, char *argv[])
58 return EINA_FALSE; 58 return EINA_FALSE;
59} 59}
60 60
61static Suite *
62emile_suite_build(int argc, const char **argv)
63{
64 TCase *tc;
65 Suite *s;
66 unsigned int i;
67
68 s = suite_create("Emile");
69
70 for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i)
71 {
72 if (!_use_test(tests[i].name, argc, argv))
73 continue;
74
75 tc = tcase_create(tests[i].name);
76 tests[i].build(tc);
77 suite_add_tcase(s, tc);
78#ifndef _WIN32
79 tcase_set_timeout(tc, 0);
80#endif
81 }
82
83 return s;
84}
85
61int 86int
62main(int argc, char *argv[]) 87main(int argc, char *argv[])
63{ 88{
64 SRunner *sr; 89 SRunner *sr;
65 Suite *s; 90 Suite *s;
66 unsigned int i;
67 int failed_count; 91 int failed_count;
68 int j; 92 int j;
69 93
@@ -80,24 +104,9 @@ main(int argc, char *argv[])
80 return 0; 104 return 0;
81 } 105 }
82 106
83 s = suite_create("Emile"); 107 s = emile_suite_build(argc, (const char **)argv);
84
85 for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i)
86 {
87 TCase *tc;
88
89 if (!_use_test(tests[i].name, argc, argv))
90 continue;
91
92 tc = tcase_create(tests[i].name);
93 tests[i].build(tc);
94 suite_add_tcase(s, tc);
95#ifndef _WIN32
96 tcase_set_timeout(tc, 0);
97#endif
98 }
99
100 sr = srunner_create(s); 108 sr = srunner_create(s);
109
101 srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml"); 110 srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml");
102 srunner_run_all(sr, CK_ENV); 111 srunner_run_all(sr, CK_ENV);
103 failed_count = srunner_ntests_failed(sr); 112 failed_count = srunner_ntests_failed(sr);