summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-02-26 14:48:24 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-02-26 15:05:36 -0500
commit568b524411651ac5914c06d626444b0d9a309270 (patch)
tree3edd603f841d9e9e98ae31e1a4bcf4ba78c4664d
parentf535a88d54db5d3e296652a4952f04f4d727cc14 (diff)
tests: add test for efl.ui header compilation
-rw-r--r--src/Makefile_Elementary.am22
-rw-r--r--src/tests/elementary/efl_ui_suite.c73
2 files changed, 93 insertions, 2 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index a2e82a5f71..75c319a26e 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -1401,8 +1401,8 @@ AM_TESTS_ENVIRONMENT += \
1401 ELM_RUN_IN_TREE=1 \ 1401 ELM_RUN_IN_TREE=1 \
1402 EFL_RUN_IN_TREE=1 1402 EFL_RUN_IN_TREE=1
1403 1403
1404check_PROGRAMS += tests/elementary/elm_suite 1404check_PROGRAMS += tests/elementary/elm_suite tests/elementary/efl_ui_suite
1405TESTS += tests/elementary/elm_suite 1405TESTS += tests/elementary/elm_suite tests/elementary/efl_ui_suite
1406 1406
1407tests_elementary_elm_suite_SOURCES = \ 1407tests_elementary_elm_suite_SOURCES = \
1408 tests/elementary/elm_suite.c \ 1408 tests/elementary/elm_suite.c \
@@ -1503,6 +1503,24 @@ tests_elementary_elm_suite_CPPFLAGS = \
1503 1503
1504tests_elementary_elm_suite_LDADD = @CHECK_LIBS@ @USE_ELEMENTARY_LIBS@ 1504tests_elementary_elm_suite_LDADD = @CHECK_LIBS@ @USE_ELEMENTARY_LIBS@
1505tests_elementary_elm_suite_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ $(top_builddir)/data/elementary/objects/test.edj 1505tests_elementary_elm_suite_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ $(top_builddir)/data/elementary/objects/test.edj
1506
1507tests_elementary_efl_ui_suite_SOURCES = \
1508 tests/elementary/efl_ui_suite.c
1509
1510tests_elementary_efl_ui_suite_CPPFLAGS = \
1511 -DTESTS_BUILD_DIR=\"${top_builddir}/src/tests/elementary\" \
1512 -DTESTS_SRC_DIR=\"${top_srcdir}/src/tests/elementary\" \
1513 -DELM_IMAGE_DATA_DIR=\"${top_srcdir}/data/elementary\" \
1514 -DELM_TEST_DATA_DIR=\"${abs_top_builddir}/data/elementary\" \
1515 -DPACKAGE_DATA_DIR=\"${abs_top_builddir}/data/elementary\" \
1516 -I$(top_srcdir)/src/lib/elementary \
1517 -I$(top_builddir)/src/lib/elementary \
1518 -I$(top_builddir)/src/tests/elementary \
1519 @CHECK_CFLAGS@ \
1520 @ELEMENTARY_CFLAGS@
1521
1522tests_elementary_efl_ui_suite_LDADD = @CHECK_LIBS@ @USE_ELEMENTARY_LIBS@
1523tests_elementary_efl_ui_suite_DEPENDENCIES = @USE_ELEMENTARY_INTERNAL_LIBS@ $(top_builddir)/data/elementary/objects/test.edj
1506endif 1524endif
1507 1525
1508if HAVE_ELUA 1526if HAVE_ELUA
diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c
new file mode 100644
index 0000000000..629bb10faa
--- /dev/null
+++ b/src/tests/elementary/efl_ui_suite.c
@@ -0,0 +1,73 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <check.h>
5#define EFL_NOLEGACY_API_SUPPORT
6#include <Efl_Ui.h>
7#include "../efl_check.h"
8
9EAPI_MAIN void
10efl_main(void *data EINA_UNUSED,
11 const Efl_Event *ev)
12{
13 Efl_Loop_Arguments *arge = ev->info;
14
15
16 fail_if(!arge->initialization);
17 fprintf(stderr, "ARGC %d\n", eina_array_count(arge->argv));
18 fail_if(eina_array_count(arge->argv) != 1);
19 fail_if(!eina_streq(eina_array_data_get(arge->argv, 0), "test"));
20
21 efl_loop_quit(ev->object, eina_value_string_init("success"));
22}
23
24START_TEST(efl_ui_test_init)
25{
26 /* EFL_MAIN */
27 Eina_Value *ret__;
28 int real__;
29
30 int argc = 2;
31 char *argv[] = { "efl_ui_suite", "test" };
32 _efl_startup_time = ecore_time_unix_get();
33 _EFL_APP_VERSION_SET();
34 fail_if(!ecore_init());
35 efl_event_callback_add(efl_app_main_loop_get(efl_app_get()), EFL_LOOP_EVENT_ARGUMENTS, efl_main, NULL);
36 fail_if(!ecore_init_ex(argc, argv));
37 __EFL_MAIN_CONSTRUCTOR;
38 ret__ = efl_loop_begin(efl_app_main_loop_get(efl_app_get()));
39 real__ = efl_loop_exit_code_process(ret__);
40 __EFL_MAIN_DESTRUCTOR;
41 ecore_shutdown_ex();
42 ecore_shutdown();
43}
44END_TEST
45
46void efl_ui_test(TCase *tc)
47{
48 tcase_add_test(tc, efl_ui_test_init);
49}
50
51
52static const Efl_Test_Case etc[] = {
53 { "Efl_Ui", efl_ui_test },
54 { NULL, NULL }
55};
56
57int
58main(int argc, char **argv)
59{
60 int failed_count;
61
62 if (!_efl_test_option_disp(argc, argv, etc))
63 return 0;
64
65#ifdef NEED_RUN_IN_TREE
66 putenv("EFL_RUN_IN_TREE=1");
67#endif
68
69 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
70 "Efl_Ui", etc);
71
72 return (failed_count == 0) ? 0 : 255;
73}