summaryrefslogtreecommitdiff
path: root/src/tests/edje/edje_suite.c
blob: 18eb8856fba302001425b7b0401ce9947b46b83f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "edje_suite.h"
#include "../efl_check.h"
#include <Ecore_Evas.h>
#include <Efreet.h>
#include <Ecore.h>

static const Efl_Test_Case etc[] = {
  { "Edje", edje_test_edje },
  { "Container", edje_test_container },
  { "Features", edje_test_features },
  { "Signal", edje_test_signal },
  { "Swallow", edje_test_swallow },
  { "Text", edje_test_text },
  { "Edje Text", edje_test_text },
  { NULL, NULL }
};

const char *
test_layout_get(const char *name)
{
   static char filename[PATH_MAX];

   snprintf(filename, PATH_MAX, TESTS_BUILD_DIR"/data/%s", name);

   return filename;
}

Evas *
_setup_evas(void)
{
   Evas *evas;
   Evas_Engine_Info *einfo;

   evas = evas_new();

   evas_output_method_set(evas, evas_render_method_lookup("buffer"));
   einfo = evas_engine_info_get(evas);
   evas_engine_info_set(evas, einfo);

   evas_output_size_set(evas, 500, 500);
   evas_output_viewport_set(evas, 0, 0, 500, 500);

   return evas;
}

SUITE_INIT(edje)
{
   ck_assert_int_eq(ecore_evas_init(), 1);
   ck_assert_int_eq(edje_init(), 1);
}

SUITE_SHUTDOWN(edje)
{
   ck_assert_int_eq(edje_shutdown(), 0);
   ck_assert_int_eq(ecore_evas_shutdown(), 0);
}

int
main(int argc, char **argv)
{
   int failed_count;

   if (!_efl_test_option_disp(argc, argv, etc))
     return 0;

#ifdef NEED_RUN_IN_TREE
   putenv("EFL_RUN_IN_TREE=1");
#endif
   ecore_app_no_system_modules();
   efreet_cache_disable();

   failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
                                           "Edje", etc, SUITE_INIT_FN(edje), SUITE_SHUTDOWN_FN(edje));

   return (failed_count == 0) ? 0 : 255;
}