summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:19:43 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-04 17:19:43 +0000
commit733425c62c7b9a23ad465b5b9700612fae3ee356 (patch)
treefdc2f4e310d964cb96fa56a73d66fdba246d06b8
parent365a4acf97c59470c317a3e80d7586efe9344bb5 (diff)
efl: make libraries aware of EFL_RUN_IN_TREE.
this variable tells that the build is being done in tree and we should not look at install locations. SVN revision: 82217
-rw-r--r--data/Makefile.am10
-rw-r--r--data/ecore_imf/checkme2
-rw-r--r--data/eeze/checkme2
-rw-r--r--src/Makefile_Ecore.am4
-rw-r--r--src/Makefile_Ecore_Evas.am1
-rw-r--r--src/Makefile_Ecore_Imf.am4
-rw-r--r--src/Makefile_Eeze.am4
-rw-r--r--src/Makefile_Evas.am2
-rw-r--r--src/examples/Makefile.am6
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c30
-rw-r--r--src/lib/ecore_imf/ecore_imf_module.c49
-rw-r--r--src/lib/edje/edje_edit.c46
-rw-r--r--src/lib/edje/edje_module.c39
-rw-r--r--src/lib/eeze/eeze_sensor.c24
-rw-r--r--src/lib/evas/file/evas_module.c86
-rw-r--r--src/tests/ecore/ecore_suite.c3
-rw-r--r--src/tests/ecore/ecore_suite.h1
-rw-r--r--src/tests/ecore/ecore_test_ecore_imf.c85
-rw-r--r--src/tests/edje/edje_suite.c2
-rw-r--r--src/tests/eet/eet_suite.c2
-rw-r--r--src/tests/eeze/eeze_suite.c2
-rw-r--r--src/tests/efreet/efreet_suite.c2
-rw-r--r--src/tests/eina/eina_suite.c2
-rw-r--r--src/tests/eo/suite/eo_suite.c2
-rw-r--r--src/tests/evas/evas_suite.c3
-rw-r--r--src/tests/evas/evas_suite.h1
-rw-r--r--src/tests/evas/evas_test_render_engines.c84
27 files changed, 445 insertions, 53 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index fc04b81..40efb04 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -13,6 +13,16 @@ evasfilesdir = $(datadir)/evas
13evasfiles_DATA = evas/checkme 13evasfiles_DATA = evas/checkme
14 14
15######################################################################## 15########################################################################
16# Eeze
17eezefilesdir = $(datadir)/eeze
18eezefiles_DATA = eeze/checkme
19
20########################################################################
21# Ecore_Imf
22ecoreimffilesdir = $(datadir)/ecore_imf
23ecoreimffiles_DATA = ecore_imf/checkme
24
25########################################################################
16# Eo 26# Eo
17eofilesdir = $(datadir)/eo 27eofilesdir = $(datadir)/eo
18eofiles_DATA = eo/eo_step.py 28eofiles_DATA = eo/eo_step.py
diff --git a/data/ecore_imf/checkme b/data/ecore_imf/checkme
new file mode 100644
index 0000000..6ca85fb
--- /dev/null
+++ b/data/ecore_imf/checkme
@@ -0,0 +1,2 @@
1This is just a test file used to help ecore_imf determine its prefix
2location.
diff --git a/data/eeze/checkme b/data/eeze/checkme
new file mode 100644
index 0000000..3c67c27
--- /dev/null
+++ b/data/eeze/checkme
@@ -0,0 +1,2 @@
1This is just a test file used to help eeze determine its prefix
2location.
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 1b0a13d..ebf4cb4 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -79,6 +79,7 @@ tests/ecore/ecore_suite.c \
79tests/ecore/ecore_test_ecore.c \ 79tests/ecore/ecore_test_ecore.c \
80tests/ecore/ecore_test_ecore_con.c \ 80tests/ecore/ecore_test_ecore_con.c \
81tests/ecore/ecore_test_ecore_x.c \ 81tests/ecore/ecore_test_ecore_x.c \
82tests/ecore/ecore_test_ecore_imf.c \
82tests/ecore/ecore_suite.h 83tests/ecore/ecore_suite.h
83 84
84tests_ecore_ecore_suite_CPPFLAGS = \ 85tests_ecore_ecore_suite_CPPFLAGS = \
@@ -91,10 +92,13 @@ tests_ecore_ecore_suite_CPPFLAGS = \
91-I$(top_srcdir)/src/lib/ecore_file \ 92-I$(top_srcdir)/src/lib/ecore_file \
92-I$(top_srcdir)/src/lib/ecore_x \ 93-I$(top_srcdir)/src/lib/ecore_x \
93-I$(top_builddir)/src/lib/ecore_x \ 94-I$(top_builddir)/src/lib/ecore_x \
95-I$(top_srcdir)/src/lib/ecore_imf \
96-I$(top_builddir)/src/lib/ecore_imf \
94-DTESTS_SRC_DIR=\"`pwd`/$(top_srcdir)\" \ 97-DTESTS_SRC_DIR=\"`pwd`/$(top_srcdir)\" \
95@CHECK_CFLAGS@ 98@CHECK_CFLAGS@
96 99
97tests_ecore_ecore_suite_LDADD = \ 100tests_ecore_ecore_suite_LDADD = \
101lib/ecore_imf/libecore_imf.la \
98lib/ecore_con/libecore_con.la \ 102lib/ecore_con/libecore_con.la \
99lib/ecore_file/libecore_file.la \ 103lib/ecore_file/libecore_file.la \
100lib/ecore/libecore.la \ 104lib/ecore/libecore.la \
diff --git a/src/Makefile_Ecore_Evas.am b/src/Makefile_Ecore_Evas.am
index 07bda5e..79875e0 100644
--- a/src/Makefile_Ecore_Evas.am
+++ b/src/Makefile_Ecore_Evas.am
@@ -28,6 +28,7 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS = \
28-I$(top_srcdir)/src/lib/ecore_evas \ 28-I$(top_srcdir)/src/lib/ecore_evas \
29-I$(top_srcdir)/src/modules/evas/engines/buffer \ 29-I$(top_srcdir)/src/modules/evas/engines/buffer \
30-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 30-DPACKAGE_LIB_DIR=\"$(libdir)\" \
31-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
31-DEFL_ECORE_EVAS_BUILD \ 32-DEFL_ECORE_EVAS_BUILD \
32@ECORE_EVAS_CFLAGS@ \ 33@ECORE_EVAS_CFLAGS@ \
33@EFL_COV_CFLAGS@ \ 34@EFL_COV_CFLAGS@ \
diff --git a/src/Makefile_Ecore_Imf.am b/src/Makefile_Ecore_Imf.am
index 2cb68a4..5f106fb 100644
--- a/src/Makefile_Ecore_Imf.am
+++ b/src/Makefile_Ecore_Imf.am
@@ -22,6 +22,10 @@ lib_ecore_imf_libecore_imf_la_CPPFLAGS = \
22-I$(top_srcdir)/src/lib/ecore \ 22-I$(top_srcdir)/src/lib/ecore \
23-I$(top_srcdir)/src/lib/ecore_imf \ 23-I$(top_srcdir)/src/lib/ecore_imf \
24-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 24-DPACKAGE_LIB_DIR=\"$(libdir)\" \
25-DPACKAGE_BIN_DIR=\"$(bindir)\" \
26-DPACKAGE_LIB_DIR=\"$(libdir)\" \
27-DPACKAGE_DATA_DIR=\"$(datadir)/ecore_imf\" \
28-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
25-DEFL_ECORE_IMF_BUILD \ 29-DEFL_ECORE_IMF_BUILD \
26@ECORE_IMF_CFLAGS@ \ 30@ECORE_IMF_CFLAGS@ \
27@EFL_COV_CFLAGS@ 31@EFL_COV_CFLAGS@
diff --git a/src/Makefile_Eeze.am b/src/Makefile_Eeze.am
index 2375b4e..c1e36b3 100644
--- a/src/Makefile_Eeze.am
+++ b/src/Makefile_Eeze.am
@@ -70,8 +70,10 @@ EEZE_COMMON_USER_LDADD = $(EEZE_COMMON_LDADD) lib/eeze/libeeze.la
70 70
71lib_eeze_libeeze_la_CPPFLAGS = \ 71lib_eeze_libeeze_la_CPPFLAGS = \
72$(EEZE_COMMON_CPPFLAGS) \ 72$(EEZE_COMMON_CPPFLAGS) \
73-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \ 73-DPACKAGE_BIN_DIR=\"$(bindir)\" \
74-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 74-DPACKAGE_LIB_DIR=\"$(libdir)\" \
75-DPACKAGE_DATA_DIR=\"$(datadir)/eeze\" \
76-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
75-DEFL_EEZE_BUILD 77-DEFL_EEZE_BUILD
76 78
77lib_eeze_libeeze_la_LIBADD = $(EEZE_COMMON_LIBADD) 79lib_eeze_libeeze_la_LIBADD = $(EEZE_COMMON_LIBADD)
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 9242508..efd6225 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -204,6 +204,7 @@ lib_evas_libevas_la_CPPFLAGS = \
204-DPACKAGE_BIN_DIR=\"$(bindir)\" \ 204-DPACKAGE_BIN_DIR=\"$(bindir)\" \
205-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 205-DPACKAGE_LIB_DIR=\"$(libdir)\" \
206-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \ 206-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \
207-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
207@EFL_COV_CFLAGS@ \ 208@EFL_COV_CFLAGS@ \
208@EVAS_CFLAGS@ \ 209@EVAS_CFLAGS@ \
209@VALGRIND_CFLAGS@ \ 210@VALGRIND_CFLAGS@ \
@@ -1741,6 +1742,7 @@ tests/evas/evas_test_init.c \
1741tests/evas/evas_test_textblock.c \ 1742tests/evas/evas_test_textblock.c \
1742tests/evas/evas_test_text.c \ 1743tests/evas/evas_test_text.c \
1743tests/evas/evas_test_callbacks.c \ 1744tests/evas/evas_test_callbacks.c \
1745tests/evas/evas_test_render_engines.c \
1744tests/evas/evas_tests_helpers.h \ 1746tests/evas/evas_tests_helpers.h \
1745tests/evas/evas_suite.h 1747tests/evas/evas_suite.h
1746 1748
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 12edbbb..615af7a 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -1,6 +1,6 @@
1MAINTAINERCLEANFILES = Makefile.in 1MAINTAINERCLEANFILES = Makefile.in
2 2
3SUBDIRS = eina eo eet evas ecore eio edbus ephysics # edje 3SUBDIRS = eina eo eet evas ecore eio edbus ephysics edje
4 4
5examples: 5examples:
6 @$(MAKE) $(AM_MAKEFLAGS) -C eina examples 6 @$(MAKE) $(AM_MAKEFLAGS) -C eina examples
@@ -11,7 +11,7 @@ examples:
11 @$(MAKE) $(AM_MAKEFLAGS) -C eio examples 11 @$(MAKE) $(AM_MAKEFLAGS) -C eio examples
12 @$(MAKE) $(AM_MAKEFLAGS) -C edbus examples 12 @$(MAKE) $(AM_MAKEFLAGS) -C edbus examples
13 @$(MAKE) $(AM_MAKEFLAGS) -C ephysics examples 13 @$(MAKE) $(AM_MAKEFLAGS) -C ephysics examples
14# @$(MAKE) $(AM_MAKEFLAGS) -C edje examples 14 @$(MAKE) $(AM_MAKEFLAGS) -C edje examples
15 15
16install-examples: 16install-examples:
17 @$(MAKE) $(AM_MAKEFLAGS) -C eina install-examples 17 @$(MAKE) $(AM_MAKEFLAGS) -C eina install-examples
@@ -22,4 +22,4 @@ install-examples:
22 @$(MAKE) $(AM_MAKEFLAGS) -C eio install-examples 22 @$(MAKE) $(AM_MAKEFLAGS) -C eio install-examples
23 @$(MAKE) $(AM_MAKEFLAGS) -C edbus install-examples 23 @$(MAKE) $(AM_MAKEFLAGS) -C edbus install-examples
24 @$(MAKE) $(AM_MAKEFLAGS) -C ephysics install-examples 24 @$(MAKE) $(AM_MAKEFLAGS) -C ephysics install-examples
25# @$(MAKE) $(AM_MAKEFLAGS) -C edje install-examples 25 @$(MAKE) $(AM_MAKEFLAGS) -C edje install-examples
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 3abbbf3..a93f3e5 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -22,17 +22,32 @@ _ecore_evas_engine_load(const char *engine)
22 const char *path; 22 const char *path;
23 Eina_List *l; 23 Eina_List *l;
24 Eina_Module *em = NULL; 24 Eina_Module *em = NULL;
25 Eina_Bool run_in_tree;
25 26
26 EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL); 27 EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL);
27 28
28 em = (Eina_Module *)eina_hash_find(_registered_engines, engine); 29 em = (Eina_Module *)eina_hash_find(_registered_engines, engine);
29 if (em) return em; 30 if (em) return em;
30 31
32 run_in_tree = !!getenv("EFL_RUN_IN_TREE");
33
31 EINA_LIST_FOREACH(_engines_paths, l, path) 34 EINA_LIST_FOREACH(_engines_paths, l, path)
32 { 35 {
33 char tmp[PATH_MAX]; 36 char tmp[PATH_MAX] = "";
37
38 if (run_in_tree)
39 {
40 struct stat st;
41 snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
42 path, engine, ECORE_EVAS_ENGINE_NAME);
43 if (stat(tmp, &st) != 0)
44 tmp[0] = '\0';
45 }
46
47 if (tmp[0] == '\0')
48 snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
49 path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME);
34 50
35 snprintf(tmp, sizeof (tmp), "%s/%s/%s/"ECORE_EVAS_ENGINE_NAME, path, engine, MODULE_ARCH);
36 em = eina_module_new(tmp); 51 em = eina_module_new(tmp);
37 if (!em) continue; 52 if (!em) continue;
38 53
@@ -57,6 +72,17 @@ _ecore_evas_engine_init(void)
57 72
58 _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free)); 73 _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
59 74
75 if (getenv("EFL_RUN_IN_TREE"))
76 {
77 struct stat st;
78 const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
79 if (stat(mp, &st) == 0)
80 {
81 _engines_paths = eina_list_append(_engines_paths, strdup(mp));
82 return;
83 }
84 }
85
60 /* 1. ~/.ecore_evas/modules/ */ 86 /* 1. ~/.ecore_evas/modules/ */
61 paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines"); 87 paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines");
62 /* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */ 88 /* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */
diff --git a/src/lib/ecore_imf/ecore_imf_module.c b/src/lib/ecore_imf/ecore_imf_module.c
index cbdee47..bf8cf6b 100644
--- a/src/lib/ecore_imf/ecore_imf_module.c
+++ b/src/lib/ecore_imf/ecore_imf_module.c
@@ -24,13 +24,57 @@ typedef struct _Ecore_IMF_Selector
24 24
25static Eina_Hash *modules = NULL; 25static Eina_Hash *modules = NULL;
26static Eina_Array *module_list = NULL; 26static Eina_Array *module_list = NULL;
27static Eina_Prefix *pfx = NULL;
27 28
28void 29void
29ecore_imf_module_init(void) 30ecore_imf_module_init(void)
30{ 31{
31 char *homedir; 32 char *homedir;
33 char buf[PATH_MAX] = "";
32 34
33 module_list = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/ecore/immodules", 0, NULL, NULL); 35 pfx = eina_prefix_new(NULL, ecore_imf_init,
36 "ECORE_IMF", "ecore_imf", "checkme",
37 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
38 PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
39
40 if (getenv("EFL_RUN_IN_TREE"))
41 {
42 struct stat st;
43 snprintf(buf, sizeof(buf), "%s/src/modules/ecore/immodules",
44 PACKAGE_BUILD_DIR);
45 if (stat(buf, &st) == 0)
46 {
47 const char *built_modules[] = {
48#ifdef ENABLE_XIM
49 "xim",
50#endif
51#ifdef BUILD_ECORE_IMF_IBUS
52 "ibus",
53#endif
54#ifdef BUILD_ECORE_IMF_SCIM
55 "scim",
56#endif
57 NULL
58 };
59 const char **itr;
60 for (itr = built_modules; *itr != NULL; itr++)
61 {
62 snprintf(buf, sizeof(buf),
63 "%s/src/modules/ecore/immodules/%s/.libs",
64 PACKAGE_BUILD_DIR, *itr);
65 module_list = eina_module_list_get(module_list, buf,
66 EINA_FALSE, NULL, NULL);
67 }
68
69 if (module_list)
70 eina_module_list_load(module_list);
71 return;
72 }
73 }
74
75 snprintf(buf, sizeof(buf), "%s/ecore/immodules", eina_prefix_lib_get(pfx));
76
77 module_list = eina_module_list_get(NULL, buf, 0, NULL, NULL);
34 homedir = eina_module_environment_path_get("HOME", "/.ecore/immodules"); 78 homedir = eina_module_environment_path_get("HOME", "/.ecore/immodules");
35 if (homedir) 79 if (homedir)
36 { 80 {
@@ -54,6 +98,9 @@ ecore_imf_module_shutdown(void)
54 eina_array_free(module_list); 98 eina_array_free(module_list);
55 module_list = NULL; 99 module_list = NULL;
56 } 100 }
101
102 eina_prefix_free(pfx);
103 pfx = NULL;
57} 104}
58 105
59static Eina_Bool 106static Eina_Bool
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 819d385..437e6aa 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -6353,12 +6353,15 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
6353 const char *tmp_dir; 6353 const char *tmp_dir;
6354 char tmp_in[PATH_MAX]; 6354 char tmp_in[PATH_MAX];
6355 char tmp_out[PATH_MAX]; 6355 char tmp_out[PATH_MAX];
6356 char embryo_cc_path[PATH_MAX] = "";
6357 char inc_path[PATH_MAX] = "";
6356 char buf[4096]; 6358 char buf[4096];
6357 Eina_Iterator *it; 6359 Eina_Iterator *it;
6358 Program_Script *ps; 6360 Program_Script *ps;
6359 Edje_Part_Collection *edc; 6361 Edje_Part_Collection *edc;
6360 Eina_Bool success = EINA_TRUE; /* we are optimists! */ 6362 Eina_Bool success = EINA_TRUE; /* we are optimists! */
6361 Edje_Edit_Script_Error *se; 6363 Edje_Edit_Script_Error *se;
6364 Eina_Prefix *pfx;
6362 6365
6363 EINA_LIST_FREE(eed->errors, se) 6366 EINA_LIST_FREE(eed->errors, se)
6364 { 6367 {
@@ -6373,6 +6376,45 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
6373 tmp_dir = "/tmp"; 6376 tmp_dir = "/tmp";
6374#endif 6377#endif
6375 6378
6379 pfx = eina_prefix_new(NULL, /* argv[0] value (optional) */
6380 edje_init, /* an optional symbol to check path of */
6381 "EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
6382 "edje", /* dir to add after "share" (PREFIX/share/DIRNAME) */
6383 "include/edje.inc", /* a magic file to check for in PREFIX/share/DIRNAME for success */
6384 PACKAGE_BIN_DIR, /* package bin dir @ compile time */
6385 PACKAGE_LIB_DIR, /* package lib dir @ compile time */
6386 PACKAGE_DATA_DIR, /* package data dir @ compile time */
6387 PACKAGE_DATA_DIR /* if locale needed use LOCALE_DIR */
6388 );
6389#ifdef _WIN32
6390# define BIN_EXT ".exe"
6391#else
6392# define BIN_EXT
6393#endif
6394 if (getenv("EFL_RUN_IN_TREE"))
6395 {
6396 snprintf(embryo_cc_path, sizeof(embryo_cc_path),
6397 "%s/src/bin/embryo/embryo_cc" BIN_EXT,
6398 PACKAGE_BUILD_DIR);
6399 snprintf(inc_path, sizeof(inc_path),
6400 "%s/data/edje/include", PACKAGE_BUILD_DIR);
6401 if (!ecore_file_exists(embryo_cc_path))
6402 embryo_cc_path[0] = '\0';
6403 }
6404
6405 if (embryo_cc_path[0] == '\0')
6406 {
6407 snprintf(embryo_cc_path, sizeof(embryo_cc_path),
6408 "%s/embryo_cc" BIN_EXT,
6409 eina_prefix_bin_get(pfx));
6410 snprintf(inc_path, sizeof(inc_path),
6411 "%s/include",
6412 eina_prefix_data_get(pfx));
6413 }
6414#undef BIN_EXT
6415
6416 eina_prefix_free(pfx);
6417
6376 snprintf(tmp_in, sizeof(tmp_in), "%s/edje_edit.sma-tmp-XXXXXX", tmp_dir); 6418 snprintf(tmp_in, sizeof(tmp_in), "%s/edje_edit.sma-tmp-XXXXXX", tmp_dir);
6377 snprintf(tmp_out, sizeof(tmp_out), "%s/edje_edit.amx-tmp-XXXXXX", tmp_dir); 6419 snprintf(tmp_out, sizeof(tmp_out), "%s/edje_edit.amx-tmp-XXXXXX", tmp_dir);
6378 6420
@@ -6457,8 +6499,8 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
6457 goto almost_out; 6499 goto almost_out;
6458 } 6500 }
6459 6501
6460 snprintf(buf, sizeof(buf), "embryo_cc -i %s/include -o %s %s", 6502 snprintf(buf, sizeof(buf), "%s -i %s -o %s %s",
6461 PACKAGE_DATA_DIR, tmp_out, tmp_in); 6503 embryo_cc_path, inc_path, tmp_out, tmp_in);
6462 ret = system(buf); 6504 ret = system(buf);
6463 6505
6464 if ((ret < 0) || (ret > 1)) 6506 if ((ret < 0) || (ret > 1))
diff --git a/src/lib/edje/edje_module.c b/src/lib/edje/edje_module.c
index 358295b..115329c 100644
--- a/src/lib/edje/edje_module.c
+++ b/src/lib/edje/edje_module.c
@@ -5,10 +5,7 @@ Eina_List *_modules_paths = NULL;
5 5
6Eina_List *_modules_found = NULL; 6Eina_List *_modules_found = NULL;
7 7
8#if defined(__CEGCC__) || defined(__MINGW32CE__) 8#if _WIN32
9# define EDJE_MODULE_NAME "edje_%s.dll"
10# define EDJE_EXTRA_MODULE_NAME 1
11#elif _WIN32
12# define EDJE_MODULE_NAME "module.dll" 9# define EDJE_MODULE_NAME "module.dll"
13#else 10#else
14# define EDJE_MODULE_NAME "module.so" 11# define EDJE_MODULE_NAME "module.so"
@@ -27,21 +24,32 @@ _edje_module_handle_load(const char *module)
27 const char *path; 24 const char *path;
28 Eina_List *l; 25 Eina_List *l;
29 Eina_Module *em = NULL; 26 Eina_Module *em = NULL;
27 Eina_Bool run_in_tree;
30 28
31 EINA_SAFETY_ON_NULL_RETURN_VAL(module, NULL); 29 EINA_SAFETY_ON_NULL_RETURN_VAL(module, NULL);
32 30
33 em = (Eina_Module *)eina_hash_find(_registered_modules, module); 31 em = (Eina_Module *)eina_hash_find(_registered_modules, module);
34 if (em) return em; 32 if (em) return em;
35 33
34 run_in_tree = !!getenv("EFL_RUN_IN_TREE");
35
36 EINA_LIST_FOREACH(_modules_paths, l, path) 36 EINA_LIST_FOREACH(_modules_paths, l, path)
37 { 37 {
38 char tmp[PATH_MAX]; 38 char tmp[PATH_MAX] = "";
39
40 if (run_in_tree)
41 {
42 struct stat st;
43 snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
44 path, module, EDJE_MODULE_NAME);
45 if (stat(tmp, &st) != 0)
46 tmp[0] = '\0';
47 }
48
49 if (tmp[0] == '\0')
50 snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
51 path, module, MODULE_ARCH, EDJE_MODULE_NAME);
39 52
40 snprintf(tmp, sizeof (tmp), "%s/%s/%s/" EDJE_MODULE_NAME, path, module, MODULE_ARCH
41#ifdef EDJE_EXTRA_MODULE_NAME
42 , module
43#endif
44 );
45 em = eina_module_new(tmp); 53 em = eina_module_new(tmp);
46 if (!em) continue; 54 if (!em) continue;
47 55
@@ -66,6 +74,17 @@ _edje_module_init(void)
66 74
67 _registered_modules = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free)); 75 _registered_modules = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
68 76
77 if (getenv("EFL_RUN_IN_TREE"))
78 {
79 struct stat st;
80 const char mp[] = PACKAGE_BUILD_DIR"/src/modules/edje";
81 if (stat(mp, &st) == 0)
82 {
83 _modules_paths = eina_list_append(_modules_paths, strdup(mp));
84 return;
85 }
86 }
87
69 /* 1. ~/.edje/modules/ */ 88 /* 1. ~/.edje/modules/ */
70 paths[0] = eina_module_environment_path_get("HOME", "/.edje/modules"); 89 paths[0] = eina_module_environment_path_get("HOME", "/.edje/modules");
71 /* 2. $(EDJE_MODULE_DIR)/edje/modules/ */ 90 /* 2. $(EDJE_MODULE_DIR)/edje/modules/ */
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index b808c6c..157b8a9 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -9,7 +9,8 @@
9#include <Eeze_Sensor.h> 9#include <Eeze_Sensor.h>
10#include "eeze_sensor_private.h" 10#include "eeze_sensor_private.h"
11 11
12Eeze_Sensor *g_handle; 12static Eeze_Sensor *g_handle;
13static Eina_Prefix *pfx;
13 14
14/* Priority order for modules. The one with the highest order of the available 15/* Priority order for modules. The one with the highest order of the available
15 * ones will be used. This in good enough for now as we only have two modules 16 * ones will be used. This in good enough for now as we only have two modules
@@ -77,10 +78,14 @@ eeze_sensor_modules_load(void)
77 * is one of these items. We do load the modules from the builddir if the 78 * is one of these items. We do load the modules from the builddir if the
78 * environment is set. Normal case is to use installed modules from system 79 * environment is set. Normal case is to use installed modules from system
79 */ 80 */
80 if (getenv("EEZE_USE_IN_TREE_MODULES")) 81 if (getenv("EFL_RUN_IN_TREE"))
81 g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_BUILD_DIR "/src/modules/.libs/", 0, NULL, NULL); 82 g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_BUILD_DIR "/src/modules/eeze/.libs/", 0, NULL, NULL);
82 else 83 else
83 g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/eeze/sensor/", 0, NULL, NULL); 84 {
85 char buf[PATH_MAX];
86 snprintf(buf, sizeof(buf), "%s/eeze/sensor/", eina_prefix_lib_get(pfx));
87 g_handle->modules_array = eina_module_list_get(NULL, buf, 0, NULL, NULL);
88 }
84 89
85 if (!g_handle->modules_array) 90 if (!g_handle->modules_array)
86 { 91 {
@@ -104,7 +109,7 @@ eeze_sensor_modules_unload(void)
104 * been loaded in initialized. They stay in the hash funtion until they 109 * been loaded in initialized. They stay in the hash funtion until they
105 * unregister themself. 110 * unregister themself.
106 */ 111 */
107Eina_Bool 112EAPI Eina_Bool
108eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod) 113eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod)
109{ 114{
110 Eeze_Sensor_Module *module = NULL; 115 Eeze_Sensor_Module *module = NULL;
@@ -127,7 +132,7 @@ eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod)
127/* This function is offered to the modules to unregsiter itself. When requested 132/* This function is offered to the modules to unregsiter itself. When requested
128 * we remove them safely from the hash. 133 * we remove them safely from the hash.
129 */ 134 */
130Eina_Bool 135EAPI Eina_Bool
131eeze_sensor_module_unregister(const char *name) 136eeze_sensor_module_unregister(const char *name)
132{ 137{
133 DBG("Unregister module %s", name); 138 DBG("Unregister module %s", name);
@@ -290,6 +295,9 @@ eeze_sensor_shutdown(void)
290 free(g_handle); 295 free(g_handle);
291 g_handle = NULL; 296 g_handle = NULL;
292 297
298 eina_prefix_free(pfx);
299 pfx = NULL;
300
293 eina_shutdown(); 301 eina_shutdown();
294} 302}
295 303
@@ -298,6 +306,10 @@ eeze_sensor_init(void)
298{ 306{
299 if (!eina_init()) return EINA_FALSE; 307 if (!eina_init()) return EINA_FALSE;
300 308
309 pfx = eina_prefix_new(NULL, eeze_sensor_init, "EEZE", "eeze", "checkme",
310 PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
311 PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
312
301 g_handle = calloc(1, sizeof(Eeze_Sensor)); 313 g_handle = calloc(1, sizeof(Eeze_Sensor));
302 if (!g_handle) return EINA_FALSE; 314 if (!g_handle) return EINA_FALSE;
303 315
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c
index cae88d8..0378423 100644
--- a/src/lib/evas/file/evas_module.c
+++ b/src/lib/evas/file/evas_module.c
@@ -44,6 +44,17 @@ evas_module_paths_init(void)
44{ 44{
45 char *libdir, *path; 45 char *libdir, *path;
46 46
47 if (getenv("EFL_RUN_IN_TREE"))
48 {
49 struct stat st;
50 const char mp[] = PACKAGE_BUILD_DIR"/src/modules/evas";
51 if (stat(mp, &st) == 0)
52 {
53 evas_module_paths = _evas_module_append(evas_module_paths, strdup(mp));
54 return;
55 }
56 }
57
47 /* 1. ~/.evas/modules/ */ 58 /* 1. ~/.evas/modules/ */
48 path = eina_module_environment_path_get("HOME", "/.evas/modules"); 59 path = eina_module_environment_path_get("HOME", "/.evas/modules");
49 evas_module_paths = _evas_module_append(evas_module_paths, path); 60 evas_module_paths = _evas_module_append(evas_module_paths, path);
@@ -271,7 +282,10 @@ evas_module_engine_list(void)
271 Eina_Iterator *it, *it2; 282 Eina_Iterator *it, *it2;
272 unsigned int i; 283 unsigned int i;
273 const char *s, *s2; 284 const char *s, *s2;
274 char buf[4096]; 285 char buf[PATH_MAX];
286 Eina_Bool run_in_tree;
287
288 run_in_tree = !!getenv("EFL_RUN_IN_TREE");
275 289
276 EINA_LIST_FOREACH(evas_module_paths, l, s) 290 EINA_LIST_FOREACH(evas_module_paths, l, s)
277 { 291 {
@@ -284,8 +298,20 @@ evas_module_engine_list(void)
284 EINA_ITERATOR_FOREACH(it, fi) 298 EINA_ITERATOR_FOREACH(it, fi)
285 { 299 {
286 const char *fname = fi->path + fi->name_start; 300 const char *fname = fi->path + fi->name_start;
287 snprintf(buf, sizeof(buf), "%s/engines/%s/%s", 301
288 s, fname, MODULE_ARCH); 302 buf[0] = '\0';
303 if (run_in_tree)
304 {
305 snprintf(buf, sizeof(buf), "%s/engines/%s/.libs",
306 s, fname);
307 if (!evas_file_path_exists(buf))
308 buf[0] = '\0';
309 }
310
311 if (buf[0] == '\0')
312 snprintf(buf, sizeof(buf), "%s/engines/%s/%s",
313 s, fname, MODULE_ARCH);
314
289 it2 = eina_file_ls(buf); 315 it2 = eina_file_ls(buf);
290 if (it2) 316 if (it2)
291 { 317 {
@@ -335,50 +361,54 @@ evas_module_unregister(const Evas_Module_Api *module, Evas_Module_Type type)
335 return EINA_TRUE; 361 return EINA_TRUE;
336} 362}
337 363
338#if defined(__CEGCC__) || defined(__MINGW32CE__) 364#if defined(_WIN32) || defined(__CYGWIN__)
339# define EVAS_MODULE_NAME_IMAGE_SAVER "saver_%s.dll" 365# define EVAS_MODULE_NAME "module.dll"
340# define EVAS_MODULE_NAME_IMAGE_LOADER "loader_%s.dll"
341# define EVAS_MODULE_NAME_ENGINE "engine_%s.dll"
342# define EVAS_MODULE_NAME_OBJECT "object_%s.dll"
343#elif defined(_WIN32) || defined(__CYGWIN__)
344# define EVAS_MODULE_NAME_IMAGE_SAVER "module.dll"
345# define EVAS_MODULE_NAME_IMAGE_LOADER "module.dll"
346# define EVAS_MODULE_NAME_ENGINE "module.dll"
347# define EVAS_MODULE_NAME_OBJECT "module.dll"
348#else 366#else
349# define EVAS_MODULE_NAME_IMAGE_SAVER "module.so" 367# define EVAS_MODULE_NAME "module.so"
350# define EVAS_MODULE_NAME_IMAGE_LOADER "module.so"
351# define EVAS_MODULE_NAME_ENGINE "module.so"
352# define EVAS_MODULE_NAME_OBJECT "module.so"
353#endif 368#endif
354 369
355Evas_Module * 370Evas_Module *
356evas_module_find_type(Evas_Module_Type type, const char *name) 371evas_module_find_type(Evas_Module_Type type, const char *name)
357{ 372{
358 const char *path; 373 const char *path;
359 const char *format = NULL; 374 char buffer[PATH_MAX];
360 char buffer[4096];
361 Evas_Module *em; 375 Evas_Module *em;
362 Eina_Module *en; 376 Eina_Module *en;
363 Eina_List *l; 377 Eina_List *l;
378 Eina_Bool run_in_tree;
364 379
365 if ((unsigned int)type > 3) return NULL; 380 if ((unsigned int)type > 3) return NULL;
366 381
367 em = eina_hash_find(evas_modules[type], name); 382 em = eina_hash_find(evas_modules[type], name);
368 if (em) return em; 383 if (em) return em;
369 384
385 run_in_tree = !!getenv("EFL_RUN_IN_TREE");
386
370 EINA_LIST_FOREACH(evas_module_paths, l, path) 387 EINA_LIST_FOREACH(evas_module_paths, l, path)
371 { 388 {
372 switch (type) 389 const char *type_str = "unknown";
373 { 390 switch (type)
374 case EVAS_MODULE_TYPE_ENGINE: format = "%s/engines/%s/%s/" EVAS_MODULE_NAME_ENGINE; break; 391 {
375 case EVAS_MODULE_TYPE_IMAGE_LOADER: format = "%s/loaders/%s/%s/" EVAS_MODULE_NAME_IMAGE_LOADER; break; 392 case EVAS_MODULE_TYPE_ENGINE: type_str = "engines"; break;
376 case EVAS_MODULE_TYPE_IMAGE_SAVER: format = "%s/savers/%s/%s/" EVAS_MODULE_NAME_IMAGE_SAVER; break; 393 case EVAS_MODULE_TYPE_IMAGE_LOADER: type_str = "loaders"; break;
377 case EVAS_MODULE_TYPE_OBJECT: format = "%s/object/%s/%s/" EVAS_MODULE_NAME_OBJECT; break; 394 case EVAS_MODULE_TYPE_IMAGE_SAVER: type_str = "savers"; break;
378 } 395 case EVAS_MODULE_TYPE_OBJECT: type_str = "object"; break;
396 }
397
398 buffer[0] = '\0';
399 if (run_in_tree)
400 {
401 snprintf(buffer, sizeof(buffer), "%s/%s/%s/.libs/%s",
402 path, type_str, name, EVAS_MODULE_NAME);
403 if (!evas_file_path_exists(buffer))
404 buffer[0] = '\0';
405 }
406
407 if (buffer[0] == '\0')
408 snprintf(buffer, sizeof(buffer), "%s/%s/%s/%s/%s",
409 path, type_str, name, MODULE_ARCH, EVAS_MODULE_NAME);
379 410
380 snprintf(buffer, sizeof (buffer), format, path, name, MODULE_ARCH, name); 411 if (!evas_file_path_is_file(buffer)) continue;
381 if (!evas_file_path_is_file(buffer)) continue;
382 412
383 en = eina_module_new(buffer); 413 en = eina_module_new(buffer);
384 if (!en) continue; 414 if (!en) continue;
diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c
index 139d2e6..5c631a3 100644
--- a/src/tests/ecore/ecore_suite.c
+++ b/src/tests/ecore/ecore_suite.c
@@ -21,6 +21,7 @@ static const Ecore_Test_Case etc[] = {
21 { "Ecore", ecore_test_ecore }, 21 { "Ecore", ecore_test_ecore },
22 { "Ecore_Con", ecore_test_ecore_con }, 22 { "Ecore_Con", ecore_test_ecore_con },
23 { "Ecore_X", ecore_test_ecore_x }, 23 { "Ecore_X", ecore_test_ecore_x },
24 { "Ecore_Imf", ecore_test_ecore_imf },
24#if HAVE_ECORE_AUDIO 25#if HAVE_ECORE_AUDIO
25 { "Ecore Audio", ecore_test_ecore_audio}, 26 { "Ecore Audio", ecore_test_ecore_audio},
26#endif 27#endif
@@ -95,6 +96,8 @@ main(int argc, char **argv)
95 return 0; 96 return 0;
96 } 97 }
97 98
99 putenv("EFL_RUN_IN_TREE=1");
100
98 s = ecore_suite_build(argc - 1, (const char **)argv + 1); 101 s = ecore_suite_build(argc - 1, (const char **)argv + 1);
99 sr = srunner_create(s); 102 sr = srunner_create(s);
100 103
diff --git a/src/tests/ecore/ecore_suite.h b/src/tests/ecore/ecore_suite.h
index 74f9ed3..6473d2a 100644
--- a/src/tests/ecore/ecore_suite.h
+++ b/src/tests/ecore/ecore_suite.h
@@ -6,6 +6,7 @@
6void ecore_test_ecore(TCase *tc); 6void ecore_test_ecore(TCase *tc);
7void ecore_test_ecore_con(TCase *tc); 7void ecore_test_ecore_con(TCase *tc);
8void ecore_test_ecore_x(TCase *tc); 8void ecore_test_ecore_x(TCase *tc);
9void ecore_test_ecore_imf(TCase *tc);
9void ecore_test_ecore_audio(TCase *tc); 10void ecore_test_ecore_audio(TCase *tc);
10 11
11 12
diff --git a/src/tests/ecore/ecore_test_ecore_imf.c b/src/tests/ecore/ecore_test_ecore_imf.c
new file mode 100644
index 0000000..84deafc
--- /dev/null
+++ b/src/tests/ecore/ecore_test_ecore_imf.c
@@ -0,0 +1,85 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore_IMF.h>
6
7#include "ecore_suite.h"
8
9START_TEST(ecore_test_ecore_imf_init)
10{
11 ecore_imf_init();
12 ecore_imf_shutdown();
13}
14END_TEST
15
16static const char *built_modules[] = {
17#ifdef ENABLE_XIM
18 "xim",
19#endif
20#ifdef BUILD_ECORE_IMF_IBUS
21 "ibus",
22#endif
23#ifdef BUILD_ECORE_IMF_SCIM
24 "scim",
25#endif
26 NULL
27};
28
29static Eina_Bool
30_find_list(const Eina_List *lst, const char *item)
31{
32 const Eina_List *n;
33 const char *s;
34 EINA_LIST_FOREACH(lst, n, s)
35 {
36 if (strcmp(s, item) == 0)
37 return EINA_TRUE;
38 }
39 return EINA_FALSE;
40}
41
42START_TEST(ecore_test_ecore_imf_modules)
43{
44 Eina_List *modules;
45 const char **itr;
46
47 ecore_imf_init();
48 modules = ecore_imf_context_available_ids_get();
49
50 for (itr = built_modules; *itr != NULL; itr++)
51 {
52 Eina_Bool found = _find_list(modules, *itr);
53 fail_if(!found, "imf module should be built, but was not found: %s",
54 *itr);
55 }
56
57 eina_list_free(modules);
58 ecore_imf_shutdown();
59}
60END_TEST
61
62START_TEST(ecore_test_ecore_imf_modules_load)
63{
64 Eina_List *modules;
65 const char **itr;
66
67 ecore_imf_init();
68
69 for (itr = built_modules; *itr != NULL; itr++)
70 {
71 Ecore_IMF_Context *ctx = ecore_imf_context_add(*itr);
72 fail_if(ctx == NULL, "could not add imf context: %s", *itr);
73 ecore_imf_context_del(ctx);
74 }
75
76 ecore_imf_shutdown();
77}
78END_TEST
79
80void ecore_test_ecore_imf(TCase *tc)
81{
82 tcase_add_test(tc, ecore_test_ecore_imf_init);
83 tcase_add_test(tc, ecore_test_ecore_imf_modules);
84 tcase_add_test(tc, ecore_test_ecore_imf_modules_load);
85}
diff --git a/src/tests/edje/edje_suite.c b/src/tests/edje/edje_suite.c
index ad789b6..dab966f 100644
--- a/src/tests/edje/edje_suite.c
+++ b/src/tests/edje/edje_suite.c
@@ -90,6 +90,8 @@ main(int argc, char **argv)
90 return 0; 90 return 0;
91 } 91 }
92 92
93 putenv("EFL_RUN_IN_TREE=1");
94
93 s = edje_suite_build(argc - 1, (const char **)argv + 1); 95 s = edje_suite_build(argc - 1, (const char **)argv + 1);
94 sr = srunner_create(s); 96 sr = srunner_create(s);
95 97
diff --git a/src/tests/eet/eet_suite.c b/src/tests/eet/eet_suite.c
index f1b0dd9..a58233c 100644
--- a/src/tests/eet/eet_suite.c
+++ b/src/tests/eet/eet_suite.c
@@ -2749,6 +2749,8 @@ main(int argc EINA_UNUSED, char *argv[])
2749 int failed_count; 2749 int failed_count;
2750 const char *base = _cert_dir_find(argv[0]); 2750 const char *base = _cert_dir_find(argv[0]);
2751 2751
2752 putenv("EFL_RUN_IN_TREE=1");
2753
2752 eina_str_join(_key_pem, sizeof(_key_pem), '/', base, "key.pem"); 2754 eina_str_join(_key_pem, sizeof(_key_pem), '/', base, "key.pem");
2753 eina_str_join(_cert_pem, sizeof(_cert_pem), '/', base,"cert.pem"); 2755 eina_str_join(_cert_pem, sizeof(_cert_pem), '/', base,"cert.pem");
2754 eina_str_join(_key_enc, sizeof(_key_enc), '/', base, "key.enc"); 2756 eina_str_join(_key_enc, sizeof(_key_enc), '/', base, "key.enc");
diff --git a/src/tests/eeze/eeze_suite.c b/src/tests/eeze/eeze_suite.c
index 6ae6e1a..191f30b 100644
--- a/src/tests/eeze/eeze_suite.c
+++ b/src/tests/eeze/eeze_suite.c
@@ -668,6 +668,8 @@ main(void)
668 SRunner *sr; 668 SRunner *sr;
669 int failed_count; 669 int failed_count;
670 670
671 putenv("EFL_RUN_IN_TREE=1");
672
671 s = eeze_suite(); 673 s = eeze_suite();
672 sr = srunner_create(s); 674 sr = srunner_create(s);
673 srunner_run_all(sr, CK_ENV); 675 srunner_run_all(sr, CK_ENV);
diff --git a/src/tests/efreet/efreet_suite.c b/src/tests/efreet/efreet_suite.c
index 7424435..ed1d82f 100644
--- a/src/tests/efreet/efreet_suite.c
+++ b/src/tests/efreet/efreet_suite.c
@@ -92,6 +92,8 @@ main(int argc, char **argv)
92 return 0; 92 return 0;
93 } 93 }
94 94
95 putenv("EFL_RUN_IN_TREE=1");
96
95 s = efreet_suite_build(argc - 1, (const char **)argv + 1); 97 s = efreet_suite_build(argc - 1, (const char **)argv + 1);
96 sr = srunner_create(s); 98 sr = srunner_create(s);
97 99
diff --git a/src/tests/eina/eina_suite.c b/src/tests/eina/eina_suite.c
index d69cd47..866db27 100644
--- a/src/tests/eina/eina_suite.c
+++ b/src/tests/eina/eina_suite.c
@@ -168,6 +168,8 @@ main(int argc, char **argv)
168 return 0; 168 return 0;
169 } 169 }
170 170
171 putenv("EFL_RUN_IN_TREE=1");
172
171 s = eina_build_suite(argc - 1, (const char **)argv + 1); 173 s = eina_build_suite(argc - 1, (const char **)argv + 1);
172 sr = srunner_create(s); 174 sr = srunner_create(s);
173 175
diff --git a/src/tests/eo/suite/eo_suite.c b/src/tests/eo/suite/eo_suite.c
index 0494136..ea5c1c5 100644
--- a/src/tests/eo/suite/eo_suite.c
+++ b/src/tests/eo/suite/eo_suite.c
@@ -93,6 +93,8 @@ main(int argc, char **argv)
93 return 0; 93 return 0;
94 } 94 }
95 95
96 putenv("EFL_RUN_IN_TREE=1");
97
96 s = eo_suite_build(argc - 1, (const char **)argv + 1); 98 s = eo_suite_build(argc - 1, (const char **)argv + 1);
97 sr = srunner_create(s); 99 sr = srunner_create(s);
98 100
diff --git a/src/tests/evas/evas_suite.c b/src/tests/evas/evas_suite.c
index 0d3300c..7848b3d 100644
--- a/src/tests/evas/evas_suite.c
+++ b/src/tests/evas/evas_suite.c
@@ -22,6 +22,7 @@ static const Evas_Test_Case etc[] = {
22 { "Object Textblock", evas_test_textblock }, 22 { "Object Textblock", evas_test_textblock },
23 { "Object Text", evas_test_text }, 23 { "Object Text", evas_test_text },
24 { "Callbacks", evas_test_callbacks }, 24 { "Callbacks", evas_test_callbacks },
25 { "Render Engines", evas_test_render_engines },
25 { NULL, NULL } 26 { NULL, NULL }
26}; 27};
27 28
@@ -93,6 +94,8 @@ main(int argc, char **argv)
93 return 0; 94 return 0;
94 } 95 }
95 96
97 putenv("EFL_RUN_IN_TREE=1");
98
96 evas_init(); 99 evas_init();
97 s = evas_suite_build(argc - 1, (const char **)argv + 1); 100 s = evas_suite_build(argc - 1, (const char **)argv + 1);
98 sr = srunner_create(s); 101 sr = srunner_create(s);
diff --git a/src/tests/evas/evas_suite.h b/src/tests/evas/evas_suite.h
index 31d6d18..98b24de 100644
--- a/src/tests/evas/evas_suite.h
+++ b/src/tests/evas/evas_suite.h
@@ -7,6 +7,7 @@ void evas_test_init(TCase *tc);
7void evas_test_textblock(TCase *tc); 7void evas_test_textblock(TCase *tc);
8void evas_test_text(TCase *tc); 8void evas_test_text(TCase *tc);
9void evas_test_callbacks(TCase *tc); 9void evas_test_callbacks(TCase *tc);
10void evas_test_render_engines(TCase *tc);
10 11
11 12
12#endif /* _EVAS_SUITE_H */ 13#endif /* _EVAS_SUITE_H */
diff --git a/src/tests/evas/evas_test_render_engines.c b/src/tests/evas/evas_test_render_engines.c
new file mode 100644
index 0000000..0f98bcc
--- /dev/null
+++ b/src/tests/evas/evas_test_render_engines.c
@@ -0,0 +1,84 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdio.h>
6
7#include "evas_suite.h"
8#include "Evas.h"
9
10static Eina_Bool
11_find_list(const Eina_List *lst, const char *item)
12{
13 const Eina_List *n;
14 const char *s;
15 EINA_LIST_FOREACH(lst, n, s)
16 {
17 if (strcmp(s, item) == 0)
18 return EINA_TRUE;
19 }
20 return EINA_FALSE;
21}
22
23static const char *built_engines[] = {
24 "software_generic",
25 "buffer",
26#ifdef BUILD_ENGINE_FB
27 "fb",
28#endif
29#ifdef BUILD_ENGINE_GL_X11
30 "gl_x11",
31#endif
32#ifdef BUILD_ENGINE_PSL1GHT
33 "psl1ght",
34#endif
35#ifdef BUILD_ENGINE_SOFTWARE_DDRAW
36 "software_ddraw",
37#endif
38#ifdef BUILD_ENGINE_SOFTWARE_GDI
39 "software_gdi",
40#endif
41#ifdef BUILD_ENGINE_SOFTWARE_X11
42 "software_x11",
43#endif
44#ifdef BUILD_ENGINE_WAYLAND_EGL
45 "wayland_egl",
46#endif
47#ifdef BUILD_ENGINE_WAYLAND_SHM
48 "wayland_shm",
49#endif
50 NULL
51};
52
53START_TEST(evas_render_engines)
54{
55 Eina_List *lst = evas_render_method_list();
56 const char **itr;
57
58 for (itr = built_engines; *itr != NULL; itr++)
59 {
60 Eina_Bool found = _find_list(lst, *itr);
61 fail_if(!found, "module should be built, but was not found: %s", *itr);
62 }
63
64 evas_render_method_list_free(lst);
65}
66END_TEST
67
68START_TEST(evas_render_lookup)
69{
70 const char **itr;
71
72 for (itr = built_engines; *itr != NULL; itr++)
73 {
74 int id = evas_render_method_lookup(*itr);
75 fail_if(id == 0, "could not load engine: %s", *itr);
76 }
77}
78END_TEST
79
80void evas_test_render_engines(TCase *tc)
81{
82 tcase_add_test(tc, evas_render_engines);
83 tcase_add_test(tc, evas_render_lookup);
84}