summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-04-15 14:39:11 +0100
committerTom Hacohen <tom@stosb.com>2016-04-15 14:39:56 +0100
commitc1781eb9c8df82c118790e097a46cdf68e05f969 (patch)
tree30023de0d212f10d7ac99c0419cbc84e1adbd001
parent7c5f81d30f8f2960862daf912a833a096cef6c6b (diff)
Elementary tests: Migrate the suite to the efl test infra.
-rw-r--r--src/tests/elementary/elm_suite.c49
1 files changed, 9 insertions, 40 deletions
diff --git a/src/tests/elementary/elm_suite.c b/src/tests/elementary/elm_suite.c
index bb9625fdfe..75facc6e37 100644
--- a/src/tests/elementary/elm_suite.c
+++ b/src/tests/elementary/elm_suite.c
@@ -4,16 +4,9 @@
4 4
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_suite.h" 6#include "elm_suite.h"
7#include "../efl_check.h"
7 8
8typedef struct _Elementary_Test_Case Elementary_Test_Case; 9static const Efl_Test_Case etc[] = {
9
10struct _Elementary_Test_Case
11{
12 const char *test_case;
13 void (*build)(TCase *tc);
14};
15
16static const Elementary_Test_Case etc[] = {
17 { "Elementary", elm_test_init }, 10 { "Elementary", elm_test_init },
18 { "elm_check", elm_test_check }, 11 { "elm_check", elm_test_check },
19 { "elm_colorselector", elm_test_colorselector }, 12 { "elm_colorselector", elm_test_colorselector },
@@ -81,43 +74,19 @@ static const Elementary_Test_Case etc[] = {
81 { NULL, NULL } 74 { NULL, NULL }
82}; 75};
83 76
84Suite *
85elm_suite()
86{
87 TCase *tc;
88 Suite *s;
89 int i;
90
91 s = suite_create("Elementary");
92
93 for (i = 0; etc[i].test_case; ++i)
94 {
95 tc = tcase_create(etc[i].test_case);
96 etc[i].build(tc);
97 suite_add_tcase(s, tc);
98 tcase_set_timeout(tc, 0);
99 }
100
101 return s;
102}
103
104int 77int
105main(int argc EINA_UNUSED, char **argv EINA_UNUSED) 78main(int argc, char **argv)
106{ 79{
107 int failed_count; 80 int failed_count;
108 Suite *s;
109 SRunner *sr;
110 81
111 putenv("ELM_RUN_IN_TREE=1"); 82 if (!_efl_test_option_disp(argc, argv, etc))
112 83 return 0;
113 s = elm_suite();
114 sr = srunner_create(s);
115 84
116 srunner_set_xml(sr, TESTS_BUILD_DIR "/check-results.xml"); 85 putenv("EFL_RUN_IN_TREE=1");
86 putenv("ELM_RUN_IN_TREE=1");
117 87
118 srunner_run_all(sr, CK_ENV); 88 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
119 failed_count = srunner_ntests_failed(sr); 89 "Elementary", etc);
120 srunner_free(sr);
121 90
122 return (failed_count == 0) ? 0 : 255; 91 return (failed_count == 0) ? 0 : 255;
123} 92}