10 #include "ecore_suite.h"
12 typedef struct _Ecore_Test_Case Ecore_Test_Case;
14 struct _Ecore_Test_Case
16 const char *test_case;
17 void (*build)(TCase *tc);
20 static const Ecore_Test_Case etc[] = {
21 { "Ecore", ecore_test_ecore },
22 { "Ecore_Con", ecore_test_ecore_con },
23 { "Ecore_X", ecore_test_ecore_x },
30 const Ecore_Test_Case *itr;
33 fputs("Available Test Cases:\n", stderr);
34 for (; itr->test_case; itr++)
35 fprintf(stderr, "\t%s\n", itr->test_case);
38 _use_test(int argc, const char **argv, const char *test_case)
43 for (; argc > 0; argc--, argv++)
44 if (strcmp(test_case, *argv) == 0)
50 ecore_suite_build(int argc, const char **argv)
56 s = suite_create("Ecore");
58 for (i = 0; etc[i].test_case; ++i)
60 if (!_use_test(argc, argv, etc[i].test_case)) continue;
61 tc = tcase_create(etc[i].test_case);
65 suite_add_tcase(s, tc);
66 tcase_set_timeout(tc, 0);
73 main(int argc, char **argv)
79 for (i = 1; i < argc; i++)
80 if ((strcmp(argv[i], "-h") == 0) ||
81 (strcmp(argv[i], "--help") == 0))
83 fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n",
88 else if ((strcmp(argv[i], "-l") == 0) ||
89 (strcmp(argv[i], "--list") == 0))
95 s = ecore_suite_build(argc - 1, (const char **)argv + 1);
96 sr = srunner_create(s);
98 srunner_run_all(sr, CK_ENV);
99 failed_count = srunner_ntests_failed(sr);
102 return (failed_count == 0) ? 0 : 255;