10 #include "edje_suite.h"
12 typedef struct _Edje_Test_Case Edje_Test_Case;
14 struct _Edje_Test_Case
16 const char *test_case;
17 void (*build)(TCase *tc);
20 static const Edje_Test_Case etc[] = {
21 { "Edje", edje_test_edje },
28 const Edje_Test_Case *itr;
31 fputs("Available Test Cases:\n", stderr);
32 for (; itr->test_case; itr++)
33 fprintf(stderr, "\t%s\n", itr->test_case);
36 _use_test(int argc, const char **argv, const char *test_case)
41 for (; argc > 0; argc--, argv++)
42 if (strcmp(test_case, *argv) == 0)
48 edje_suite_build(int argc, const char **argv)
54 s = suite_create("Edje");
56 for (i = 0; etc[i].test_case; ++i)
58 if (!_use_test(argc, argv, etc[i].test_case)) continue;
59 tc = tcase_create(etc[i].test_case);
63 suite_add_tcase(s, tc);
64 tcase_set_timeout(tc, 0);
71 main(int argc, char **argv)
77 for (i = 1; i < argc; i++)
78 if ((strcmp(argv[i], "-h") == 0) ||
79 (strcmp(argv[i], "--help") == 0))
81 fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n",
86 else if ((strcmp(argv[i], "-l") == 0) ||
87 (strcmp(argv[i], "--list") == 0))
93 s = edje_suite_build(argc - 1, (const char **)argv + 1);
94 sr = srunner_create(s);
96 srunner_run_all(sr, CK_ENV);
97 failed_count = srunner_ntests_failed(sr);
100 return (failed_count == 0) ? 0 : 255;