aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/edje/edje_suite.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 02:08:14 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 02:08:14 +0000
commit9ea2ce1041549c90f94062ce5ec145056e7fbdfa (patch)
tree3bcd3fb016bc498a72ff99c8d67c8b7ef2d91718 /src/tests/edje/edje_suite.c
parentevas: add event source evas object (diff)
downloadefl-9ea2ce1041549c90f94062ce5ec145056e7fbdfa.tar.gz
efl: merge edje.
this is still in progress, mostly the multisense stuff is pending. it seems that when we merge ecore_audio in edje the libremix and similar are gone, at least from Edje, and will be in ecore_audio itself (or pulseaudio). Changes: * __UNUSED__ to EINA_UNUSED * binaries (epp, embryo_cc, edje_cc) now consider EFL_RUN_IN_TREE and will assume the binaries are still not installed, running from build tree location (needs more testing, maybe doesn't work with srcdir != builddir, still doesn't solve cross compile builds) SVN revision: 82139
Diffstat (limited to 'src/tests/edje/edje_suite.c')
-rw-r--r--src/tests/edje/edje_suite.c101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/tests/edje/edje_suite.c b/src/tests/edje/edje_suite.c
new file mode 100644
index 0000000000..ad789b65df
--- /dev/null
+++ b/src/tests/edje/edje_suite.c
@@ -0,0 +1,101 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <Edje.h>
+
+#include "edje_suite.h"
+
+typedef struct _Edje_Test_Case Edje_Test_Case;
+
+struct _Edje_Test_Case
+{
+ const char *test_case;
+ void (*build)(TCase *tc);
+};
+
+static const Edje_Test_Case etc[] = {
+ { "Edje", edje_test_edje },
+ { NULL, NULL }
+};
+
+static void
+_list_tests(void)
+{
+ const Edje_Test_Case *itr;
+
+ itr = etc;
+ fputs("Available Test Cases:\n", stderr);
+ for (; itr->test_case; itr++)
+ fprintf(stderr, "\t%s\n", itr->test_case);
+}
+static Eina_Bool
+_use_test(int argc, const char **argv, const char *test_case)
+{
+ if (argc < 1)
+ return 1;
+
+ for (; argc > 0; argc--, argv++)
+ if (strcmp(test_case, *argv) == 0)
+ return 1;
+ return 0;
+}
+
+static Suite *
+edje_suite_build(int argc, const char **argv)
+{
+ TCase *tc;
+ Suite *s;
+ int i;
+
+ s = suite_create("Edje");
+
+ for (i = 0; etc[i].test_case; ++i)
+ {
+ if (!_use_test(argc, argv, etc[i].test_case)) continue;
+ tc = tcase_create(etc[i].test_case);
+
+ etc[i].build(tc);
+
+ suite_add_tcase(s, tc);
+ tcase_set_timeout(tc, 0);
+ }
+
+ return s;
+}
+
+int
+main(int argc, char **argv)
+{
+ Suite *s;
+ SRunner *sr;
+ int i, failed_count;
+
+ for (i = 1; i < argc; i++)
+ if ((strcmp(argv[i], "-h") == 0) ||
+ (strcmp(argv[i], "--help") == 0))
+ {
+ fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n",
+ argv[0]);
+ _list_tests();
+ return 0;
+ }
+ else if ((strcmp(argv[i], "-l") == 0) ||
+ (strcmp(argv[i], "--list") == 0))
+ {
+ _list_tests();
+ return 0;
+ }
+
+ s = edje_suite_build(argc - 1, (const char **)argv + 1);
+ sr = srunner_create(s);
+
+ srunner_run_all(sr, CK_ENV);
+ failed_count = srunner_ntests_failed(sr);
+ srunner_free(sr);
+
+ return (failed_count == 0) ? 0 : 255;
+}