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
devs/devilhorns/wayland_egl
Gustavo Sverzut Barbieri 10 years ago
parent 365a4acf97
commit 733425c62c
  1. 10
      data/Makefile.am
  2. 2
      data/ecore_imf/checkme
  3. 2
      data/eeze/checkme
  4. 4
      src/Makefile_Ecore.am
  5. 1
      src/Makefile_Ecore_Evas.am
  6. 4
      src/Makefile_Ecore_Imf.am
  7. 4
      src/Makefile_Eeze.am
  8. 2
      src/Makefile_Evas.am
  9. 6
      src/examples/Makefile.am
  10. 30
      src/lib/ecore_evas/ecore_evas_module.c
  11. 49
      src/lib/ecore_imf/ecore_imf_module.c
  12. 46
      src/lib/edje/edje_edit.c
  13. 39
      src/lib/edje/edje_module.c
  14. 24
      src/lib/eeze/eeze_sensor.c
  15. 86
      src/lib/evas/file/evas_module.c
  16. 3
      src/tests/ecore/ecore_suite.c
  17. 1
      src/tests/ecore/ecore_suite.h
  18. 85
      src/tests/ecore/ecore_test_ecore_imf.c
  19. 2
      src/tests/edje/edje_suite.c
  20. 2
      src/tests/eet/eet_suite.c
  21. 2
      src/tests/eeze/eeze_suite.c
  22. 2
      src/tests/efreet/efreet_suite.c
  23. 2
      src/tests/eina/eina_suite.c
  24. 2
      src/tests/eo/suite/eo_suite.c
  25. 3
      src/tests/evas/evas_suite.c
  26. 1
      src/tests/evas/evas_suite.h
  27. 84
      src/tests/evas/evas_test_render_engines.c

@ -12,6 +12,16 @@ embryofiles_DATA = embryo/default.inc
evasfilesdir = $(datadir)/evas
evasfiles_DATA = evas/checkme
########################################################################
# Eeze
eezefilesdir = $(datadir)/eeze
eezefiles_DATA = eeze/checkme
########################################################################
# Ecore_Imf
ecoreimffilesdir = $(datadir)/ecore_imf
ecoreimffiles_DATA = ecore_imf/checkme
########################################################################
# Eo
eofilesdir = $(datadir)/eo

@ -0,0 +1,2 @@
This is just a test file used to help ecore_imf determine its prefix
location.

@ -0,0 +1,2 @@
This is just a test file used to help eeze determine its prefix
location.

@ -79,6 +79,7 @@ tests/ecore/ecore_suite.c \
tests/ecore/ecore_test_ecore.c \
tests/ecore/ecore_test_ecore_con.c \
tests/ecore/ecore_test_ecore_x.c \
tests/ecore/ecore_test_ecore_imf.c \
tests/ecore/ecore_suite.h
tests_ecore_ecore_suite_CPPFLAGS = \
@ -91,10 +92,13 @@ tests_ecore_ecore_suite_CPPFLAGS = \
-I$(top_srcdir)/src/lib/ecore_file \
-I$(top_srcdir)/src/lib/ecore_x \
-I$(top_builddir)/src/lib/ecore_x \
-I$(top_srcdir)/src/lib/ecore_imf \
-I$(top_builddir)/src/lib/ecore_imf \
-DTESTS_SRC_DIR=\"`pwd`/$(top_srcdir)\" \
@CHECK_CFLAGS@
tests_ecore_ecore_suite_LDADD = \
lib/ecore_imf/libecore_imf.la \
lib/ecore_con/libecore_con.la \
lib/ecore_file/libecore_file.la \
lib/ecore/libecore.la \

@ -28,6 +28,7 @@ lib_ecore_evas_libecore_evas_la_CPPFLAGS = \
-I$(top_srcdir)/src/lib/ecore_evas \
-I$(top_srcdir)/src/modules/evas/engines/buffer \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
-DEFL_ECORE_EVAS_BUILD \
@ECORE_EVAS_CFLAGS@ \
@EFL_COV_CFLAGS@ \

@ -22,6 +22,10 @@ lib_ecore_imf_libecore_imf_la_CPPFLAGS = \
-I$(top_srcdir)/src/lib/ecore \
-I$(top_srcdir)/src/lib/ecore_imf \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/ecore_imf\" \
-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
-DEFL_ECORE_IMF_BUILD \
@ECORE_IMF_CFLAGS@ \
@EFL_COV_CFLAGS@

@ -70,8 +70,10 @@ EEZE_COMMON_USER_LDADD = $(EEZE_COMMON_LDADD) lib/eeze/libeeze.la
lib_eeze_libeeze_la_CPPFLAGS = \
$(EEZE_COMMON_CPPFLAGS) \
-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/eeze\" \
-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
-DEFL_EEZE_BUILD
lib_eeze_libeeze_la_LIBADD = $(EEZE_COMMON_LIBADD)

@ -204,6 +204,7 @@ lib_evas_libevas_la_CPPFLAGS = \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/evas\" \
-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
@EFL_COV_CFLAGS@ \
@EVAS_CFLAGS@ \
@VALGRIND_CFLAGS@ \
@ -1741,6 +1742,7 @@ tests/evas/evas_test_init.c \
tests/evas/evas_test_textblock.c \
tests/evas/evas_test_text.c \
tests/evas/evas_test_callbacks.c \
tests/evas/evas_test_render_engines.c \
tests/evas/evas_tests_helpers.h \
tests/evas/evas_suite.h

@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = eina eo eet evas ecore eio edbus ephysics # edje
SUBDIRS = eina eo eet evas ecore eio edbus ephysics edje
examples:
@$(MAKE) $(AM_MAKEFLAGS) -C eina examples
@ -11,7 +11,7 @@ examples:
@$(MAKE) $(AM_MAKEFLAGS) -C eio examples
@$(MAKE) $(AM_MAKEFLAGS) -C edbus examples
@$(MAKE) $(AM_MAKEFLAGS) -C ephysics examples
# @$(MAKE) $(AM_MAKEFLAGS) -C edje examples
@$(MAKE) $(AM_MAKEFLAGS) -C edje examples
install-examples:
@$(MAKE) $(AM_MAKEFLAGS) -C eina install-examples
@ -22,4 +22,4 @@ install-examples:
@$(MAKE) $(AM_MAKEFLAGS) -C eio install-examples
@$(MAKE) $(AM_MAKEFLAGS) -C edbus install-examples
@$(MAKE) $(AM_MAKEFLAGS) -C ephysics install-examples
# @$(MAKE) $(AM_MAKEFLAGS) -C edje install-examples
@$(MAKE) $(AM_MAKEFLAGS) -C edje install-examples

@ -22,17 +22,32 @@ _ecore_evas_engine_load(const char *engine)
const char *path;
Eina_List *l;
Eina_Module *em = NULL;
Eina_Bool run_in_tree;
EINA_SAFETY_ON_NULL_RETURN_VAL(engine, NULL);
em = (Eina_Module *)eina_hash_find(_registered_engines, engine);
if (em) return em;
run_in_tree = !!getenv("EFL_RUN_IN_TREE");
EINA_LIST_FOREACH(_engines_paths, l, path)
{
char tmp[PATH_MAX];
char tmp[PATH_MAX] = "";
if (run_in_tree)
{
struct stat st;
snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
path, engine, ECORE_EVAS_ENGINE_NAME);
if (stat(tmp, &st) != 0)
tmp[0] = '\0';
}
if (tmp[0] == '\0')
snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
path, engine, MODULE_ARCH, ECORE_EVAS_ENGINE_NAME);
snprintf(tmp, sizeof (tmp), "%s/%s/%s/"ECORE_EVAS_ENGINE_NAME, path, engine, MODULE_ARCH);
em = eina_module_new(tmp);
if (!em) continue;
@ -57,6 +72,17 @@ _ecore_evas_engine_init(void)
_registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
if (getenv("EFL_RUN_IN_TREE"))
{
struct stat st;
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
if (stat(mp, &st) == 0)
{
_engines_paths = eina_list_append(_engines_paths, strdup(mp));
return;
}
}
/* 1. ~/.ecore_evas/modules/ */
paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines");
/* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */

@ -24,13 +24,57 @@ typedef struct _Ecore_IMF_Selector
static Eina_Hash *modules = NULL;
static Eina_Array *module_list = NULL;
static Eina_Prefix *pfx = NULL;
void
ecore_imf_module_init(void)
{
char *homedir;
char buf[PATH_MAX] = "";
module_list = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/ecore/immodules", 0, NULL, NULL);
pfx = eina_prefix_new(NULL, ecore_imf_init,
"ECORE_IMF", "ecore_imf", "checkme",
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
if (getenv("EFL_RUN_IN_TREE"))
{
struct stat st;
snprintf(buf, sizeof(buf), "%s/src/modules/ecore/immodules",
PACKAGE_BUILD_DIR);
if (stat(buf, &st) == 0)
{
const char *built_modules[] = {
#ifdef ENABLE_XIM
"xim",
#endif
#ifdef BUILD_ECORE_IMF_IBUS
"ibus",
#endif
#ifdef BUILD_ECORE_IMF_SCIM
"scim",
#endif
NULL
};
const char **itr;
for (itr = built_modules; *itr != NULL; itr++)
{
snprintf(buf, sizeof(buf),
"%s/src/modules/ecore/immodules/%s/.libs",
PACKAGE_BUILD_DIR, *itr);
module_list = eina_module_list_get(module_list, buf,
EINA_FALSE, NULL, NULL);
}
if (module_list)
eina_module_list_load(module_list);
return;
}
}
snprintf(buf, sizeof(buf), "%s/ecore/immodules", eina_prefix_lib_get(pfx));
module_list = eina_module_list_get(NULL, buf, 0, NULL, NULL);
homedir = eina_module_environment_path_get("HOME", "/.ecore/immodules");
if (homedir)
{
@ -54,6 +98,9 @@ ecore_imf_module_shutdown(void)
eina_array_free(module_list);
module_list = NULL;
}
eina_prefix_free(pfx);
pfx = NULL;
}
static Eina_Bool

@ -6353,12 +6353,15 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
const char *tmp_dir;
char tmp_in[PATH_MAX];
char tmp_out[PATH_MAX];
char embryo_cc_path[PATH_MAX] = "";
char inc_path[PATH_MAX] = "";
char buf[4096];
Eina_Iterator *it;
Program_Script *ps;
Edje_Part_Collection *edc;
Eina_Bool success = EINA_TRUE; /* we are optimists! */
Edje_Edit_Script_Error *se;
Eina_Prefix *pfx;
EINA_LIST_FREE(eed->errors, se)
{
@ -6373,6 +6376,45 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
tmp_dir = "/tmp";
#endif
pfx = eina_prefix_new(NULL, /* argv[0] value (optional) */
edje_init, /* an optional symbol to check path of */
"EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
"edje", /* dir to add after "share" (PREFIX/share/DIRNAME) */
"include/edje.inc", /* a magic file to check for in PREFIX/share/DIRNAME for success */
PACKAGE_BIN_DIR, /* package bin dir @ compile time */
PACKAGE_LIB_DIR, /* package lib dir @ compile time */
PACKAGE_DATA_DIR, /* package data dir @ compile time */
PACKAGE_DATA_DIR /* if locale needed use LOCALE_DIR */
);
#ifdef _WIN32
# define BIN_EXT ".exe"
#else
# define BIN_EXT
#endif
if (getenv("EFL_RUN_IN_TREE"))
{
snprintf(embryo_cc_path, sizeof(embryo_cc_path),
"%s/src/bin/embryo/embryo_cc" BIN_EXT,
PACKAGE_BUILD_DIR);
snprintf(inc_path, sizeof(inc_path),
"%s/data/edje/include", PACKAGE_BUILD_DIR);
if (!ecore_file_exists(embryo_cc_path))
embryo_cc_path[0] = '\0';
}
if (embryo_cc_path[0] == '\0')
{
snprintf(embryo_cc_path, sizeof(embryo_cc_path),
"%s/embryo_cc" BIN_EXT,
eina_prefix_bin_get(pfx));
snprintf(inc_path, sizeof(inc_path),
"%s/include",
eina_prefix_data_get(pfx));
}
#undef BIN_EXT
eina_prefix_free(pfx);
snprintf(tmp_in, sizeof(tmp_in), "%s/edje_edit.sma-tmp-XXXXXX", tmp_dir);
snprintf(tmp_out, sizeof(tmp_out), "%s/edje_edit.amx-tmp-XXXXXX", tmp_dir);
@ -6457,8 +6499,8 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
goto almost_out;
}
snprintf(buf, sizeof(buf), "embryo_cc -i %s/include -o %s %s",
PACKAGE_DATA_DIR, tmp_out, tmp_in);
snprintf(buf, sizeof(buf), "%s -i %s -o %s %s",
embryo_cc_path, inc_path, tmp_out, tmp_in);
ret = system(buf);
if ((ret < 0) || (ret > 1))

@ -5,10 +5,7 @@ Eina_List *_modules_paths = NULL;
Eina_List *_modules_found = NULL;
#if defined(__CEGCC__) || defined(__MINGW32CE__)
# define EDJE_MODULE_NAME "edje_%s.dll"
# define EDJE_EXTRA_MODULE_NAME 1
#elif _WIN32
#if _WIN32
# define EDJE_MODULE_NAME "module.dll"
#else
# define EDJE_MODULE_NAME "module.so"
@ -27,21 +24,32 @@ _edje_module_handle_load(const char *module)
const char *path;
Eina_List *l;
Eina_Module *em = NULL;
Eina_Bool run_in_tree;
EINA_SAFETY_ON_NULL_RETURN_VAL(module, NULL);
em = (Eina_Module *)eina_hash_find(_registered_modules, module);
if (em) return em;
run_in_tree = !!getenv("EFL_RUN_IN_TREE");
EINA_LIST_FOREACH(_modules_paths, l, path)
{
char tmp[PATH_MAX];
char tmp[PATH_MAX] = "";
if (run_in_tree)
{
struct stat st;
snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
path, module, EDJE_MODULE_NAME);
if (stat(tmp, &st) != 0)
tmp[0] = '\0';
}
if (tmp[0] == '\0')
snprintf(tmp, sizeof(tmp), "%s/%s/%s/%s",
path, module, MODULE_ARCH, EDJE_MODULE_NAME);
snprintf(tmp, sizeof (tmp), "%s/%s/%s/" EDJE_MODULE_NAME, path, module, MODULE_ARCH
#ifdef EDJE_EXTRA_MODULE_NAME
, module
#endif
);
em = eina_module_new(tmp);
if (!em) continue;
@ -66,6 +74,17 @@ _edje_module_init(void)
_registered_modules = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
if (getenv("EFL_RUN_IN_TREE"))
{
struct stat st;
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/edje";
if (stat(mp, &st) == 0)
{
_modules_paths = eina_list_append(_modules_paths, strdup(mp));
return;
}
}
/* 1. ~/.edje/modules/ */
paths[0] = eina_module_environment_path_get("HOME", "/.edje/modules");
/* 2. $(EDJE_MODULE_DIR)/edje/modules/ */

@ -9,7 +9,8 @@
#include <Eeze_Sensor.h>
#include "eeze_sensor_private.h"
Eeze_Sensor *g_handle;
static Eeze_Sensor *g_handle;
static Eina_Prefix *pfx;
/* Priority order for modules. The one with the highest order of the available
* 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)
* is one of these items. We do load the modules from the builddir if the
* environment is set. Normal case is to use installed modules from system
*/
if (getenv("EEZE_USE_IN_TREE_MODULES"))
g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_BUILD_DIR "/src/modules/.libs/", 0, NULL, NULL);
if (getenv("EFL_RUN_IN_TREE"))
g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_BUILD_DIR "/src/modules/eeze/.libs/", 0, NULL, NULL);
else
g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/eeze/sensor/", 0, NULL, NULL);
{
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/eeze/sensor/", eina_prefix_lib_get(pfx));
g_handle->modules_array = eina_module_list_get(NULL, buf, 0, NULL, NULL);
}
if (!g_handle->modules_array)
{
@ -104,7 +109,7 @@ eeze_sensor_modules_unload(void)
* been loaded in initialized. They stay in the hash funtion until they
* unregister themself.
*/
Eina_Bool
EAPI Eina_Bool
eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod)
{
Eeze_Sensor_Module *module = NULL;
@ -127,7 +132,7 @@ eeze_sensor_module_register(const char *name, Eeze_Sensor_Module *mod)
/* This function is offered to the modules to unregsiter itself. When requested
* we remove them safely from the hash.
*/
Eina_Bool
EAPI Eina_Bool
eeze_sensor_module_unregister(const char *name)
{
DBG("Unregister module %s", name);
@ -290,6 +295,9 @@ eeze_sensor_shutdown(void)
free(g_handle);
g_handle = NULL;
eina_prefix_free(pfx);
pfx = NULL;
eina_shutdown();
}
@ -298,6 +306,10 @@ eeze_sensor_init(void)
{
if (!eina_init()) return EINA_FALSE;
pfx = eina_prefix_new(NULL, eeze_sensor_init, "EEZE", "eeze", "checkme",
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
g_handle = calloc(1, sizeof(Eeze_Sensor));
if (!g_handle) return EINA_FALSE;

@ -44,6 +44,17 @@ evas_module_paths_init(void)
{
char *libdir, *path;
if (getenv("EFL_RUN_IN_TREE"))
{
struct stat st;
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/evas";
if (stat(mp, &st) == 0)
{
evas_module_paths = _evas_module_append(evas_module_paths, strdup(mp));
return;
}
}
/* 1. ~/.evas/modules/ */
path = eina_module_environment_path_get("HOME", "/.evas/modules");
evas_module_paths = _evas_module_append(evas_module_paths, path);
@ -271,7 +282,10 @@ evas_module_engine_list(void)
Eina_Iterator *it, *it2;
unsigned int i;
const char *s, *s2;
char buf[4096];
char buf[PATH_MAX];
Eina_Bool run_in_tree;
run_in_tree = !!getenv("EFL_RUN_IN_TREE");
EINA_LIST_FOREACH(evas_module_paths, l, s)
{
@ -284,8 +298,20 @@ evas_module_engine_list(void)
EINA_ITERATOR_FOREACH(it, fi)
{
const char *fname = fi->path + fi->name_start;
snprintf(buf, sizeof(buf), "%s/engines/%s/%s",
s, fname, MODULE_ARCH);
buf[0] = '\0';
if (run_in_tree)
{
snprintf(buf, sizeof(buf), "%s/engines/%s/.libs",
s, fname);
if (!evas_file_path_exists(buf))
buf[0] = '\0';
}
if (buf[0] == '\0')
snprintf(buf, sizeof(buf), "%s/engines/%s/%s",
s, fname, MODULE_ARCH);
it2 = eina_file_ls(buf);
if (it2)
{
@ -335,50 +361,54 @@ evas_module_unregister(const Evas_Module_Api *module, Evas_Module_Type type)
return EINA_TRUE;
}
#if defined(__CEGCC__) || defined(__MINGW32CE__)
# define EVAS_MODULE_NAME_IMAGE_SAVER "saver_%s.dll"
# define EVAS_MODULE_NAME_IMAGE_LOADER "loader_%s.dll"
# define EVAS_MODULE_NAME_ENGINE "engine_%s.dll"
# define EVAS_MODULE_NAME_OBJECT "object_%s.dll"
#elif defined(_WIN32) || defined(__CYGWIN__)
# define EVAS_MODULE_NAME_IMAGE_SAVER "module.dll"
# define EVAS_MODULE_NAME_IMAGE_LOADER "module.dll"
# define EVAS_MODULE_NAME_ENGINE "module.dll"
# define EVAS_MODULE_NAME_OBJECT "module.dll"
#if defined(_WIN32) || defined(__CYGWIN__)
# define EVAS_MODULE_NAME "module.dll"
#else
# define EVAS_MODULE_NAME_IMAGE_SAVER "module.so"
# define EVAS_MODULE_NAME_IMAGE_LOADER "module.so"
# define EVAS_MODULE_NAME_ENGINE "module.so"
# define EVAS_MODULE_NAME_OBJECT "module.so"
# define EVAS_MODULE_NAME "module.so"
#endif
Evas_Module *
evas_module_find_type(Evas_Module_Type type, const char *name)
{
const char *path;
const char *format = NULL;
char buffer[4096];
char buffer[PATH_MAX];
Evas_Module *em;
Eina_Module *en;
Eina_List *l;
Eina_Bool run_in_tree;
if ((unsigned int)type > 3) return NULL;
em = eina_hash_find(evas_modules[type], name);
if (em) return em;
run_in_tree = !!getenv("EFL_RUN_IN_TREE");
EINA_LIST_FOREACH(evas_module_paths, l, path)
{
switch (type)
{
case EVAS_MODULE_TYPE_ENGINE: format = "%s/engines/%s/%s/" EVAS_MODULE_NAME_ENGINE; break;
case EVAS_MODULE_TYPE_IMAGE_LOADER: format = "%s/loaders/%s/%s/" EVAS_MODULE_NAME_IMAGE_LOADER; break;
case EVAS_MODULE_TYPE_IMAGE_SAVER: format = "%s/savers/%s/%s/" EVAS_MODULE_NAME_IMAGE_SAVER; break;
case EVAS_MODULE_TYPE_OBJECT: format = "%s/object/%s/%s/" EVAS_MODULE_NAME_OBJECT; break;
}
const char *type_str = "unknown";
switch (type)
{
case EVAS_MODULE_TYPE_ENGINE: type_str = "engines"; break;
case EVAS_MODULE_TYPE_IMAGE_LOADER: type_str = "loaders"; break;
case EVAS_MODULE_TYPE_IMAGE_SAVER: type_str = "savers"; break;
case EVAS_MODULE_TYPE_OBJECT: type_str = "object"; break;
}
buffer[0] = '\0';
if (run_in_tree)
{
snprintf(buffer, sizeof(buffer), "%s/%s/%s/.libs/%s",
path, type_str, name, EVAS_MODULE_NAME);
if (!evas_file_path_exists(buffer))
buffer[0] = '\0';
}
if (buffer[0] == '\0')
snprintf(buffer, sizeof(buffer), "%s/%s/%s/%s/%s",
path, type_str, name, MODULE_ARCH, EVAS_MODULE_NAME);
snprintf(buffer, sizeof (buffer), format, path, name, MODULE_ARCH, name);
if (!evas_file_path_is_file(buffer)) continue;
if (!evas_file_path_is_file(buffer)) continue;
en = eina_module_new(buffer);
if (!en) continue;

@ -21,6 +21,7 @@ static const Ecore_Test_Case etc[] = {
{ "Ecore", ecore_test_ecore },
{ "Ecore_Con", ecore_test_ecore_con },
{ "Ecore_X", ecore_test_ecore_x },
{ "Ecore_Imf", ecore_test_ecore_imf },
#if HAVE_ECORE_AUDIO
{ "Ecore Audio", ecore_test_ecore_audio},
#endif
@ -95,6 +96,8 @@ main(int argc, char **argv)
return 0;
}
putenv("EFL_RUN_IN_TREE=1");
s = ecore_suite_build(argc - 1, (const char **)argv + 1);
sr = srunner_create(s);

@ -6,6 +6,7 @@
void ecore_test_ecore(TCase *tc);
void ecore_test_ecore_con(TCase *tc);
void ecore_test_ecore_x(TCase *tc);
void ecore_test_ecore_imf(TCase *tc);
void ecore_test_ecore_audio(TCase *tc);

@ -0,0 +1,85 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Ecore_IMF.h>
#include "ecore_suite.h"
START_TEST(ecore_test_ecore_imf_init)
{
ecore_imf_init();
ecore_imf_shutdown();
}
END_TEST
static const char *built_modules[] = {
#ifdef ENABLE_XIM
"xim",
#endif
#ifdef BUILD_ECORE_IMF_IBUS
"ibus",
#endif
#ifdef BUILD_ECORE_IMF_SCIM
"scim",
#endif
NULL
};
static Eina_Bool
_find_list(const Eina_List *lst, const char *item)
{
const Eina_List *n;
const char *s;
EINA_LIST_FOREACH(lst, n, s)
{
if (strcmp(s, item) == 0)
return EINA_TRUE;
}
return EINA_FALSE;
}
START_TEST(ecore_test_ecore_imf_modules)
{
Eina_List *modules;
const char **itr;
ecore_imf_init();
modules = ecore_imf_context_available_ids_get();
for (itr = built_modules; *itr != NULL; itr++)
{
Eina_Bool found = _find_list(modules, *itr);
fail_if(!found, "imf module should be built, but was not found: %s",
*itr);
}
eina_list_free(modules);
ecore_imf_shutdown();
}
END_TEST
START_TEST(ecore_test_ecore_imf_modules_load)
{
Eina_List *modules;
const char **itr;
ecore_imf_init();
for (itr = built_modules; *itr != NULL; itr++)
{
Ecore_IMF_Context *ctx = ecore_imf_context_add(*itr);
fail_if(ctx == NULL, "could not add imf context: %s", *itr);
ecore_imf_context_del(ctx);
}
ecore_imf_shutdown();
}
END_TEST
void ecore_test_ecore_imf(TCase *tc)
{
tcase_add_test(tc, ecore_test_ecore_imf_init);
tcase_add_test(tc, ecore_test_ecore_imf_modules);
tcase_add_test(tc, ecore_test_ecore_imf_modules_load);
}

@ -90,6 +90,8 @@ main(int argc, char **argv)
return 0;
}
putenv("EFL_RUN_IN_TREE=1");
s = edje_suite_build(argc - 1, (const char **)argv + 1);
sr = srunner_create(s);

@ -2749,6 +2749,8 @@ main(int argc EINA_UNUSED, char *argv[])
int failed_count;
const char *base = _cert_dir_find(argv[0]);
putenv("EFL_RUN_IN_TREE=1");
eina_str_join(_key_pem, sizeof(_key_pem), '/', base, "key.pem");
eina_str_join(_cert_pem, sizeof(_cert_pem), '/', base,"cert.pem");
eina_str_join(_key_enc, sizeof(_key_enc), '/', base, "key.enc");

@ -668,6 +668,8 @@ main(void)
SRunner *sr;
int failed_count;
putenv("EFL_RUN_IN_TREE=1");
s = eeze_suite();
sr = srunner_create(s);
srunner_run_all(sr, CK_ENV);

@ -92,6 +92,8 @@ main(int argc, char **argv)
return 0;
}
putenv("EFL_RUN_IN_TREE=1");
s = efreet_suite_build(argc - 1, (const char **)argv + 1);
sr = srunner_create(s);

@ -168,6 +168,8 @@ main(int argc, char **argv)
return 0;
}
putenv("EFL_RUN_IN_TREE=1");
s = eina_build_suite(argc - 1, (const char **)argv + 1);
sr = srunner_create(s);

@ -93,6 +93,8 @@ main(int argc, char **argv)
return 0;
}
putenv("EFL_RUN_IN_TREE=1");
s = eo_suite_build(argc - 1, (const char **)argv + 1);
sr = srunner_create(s);

@ -22,6 +22,7 @@ static const Evas_Test_Case etc[] = {
{ "Object Textblock", evas_test_textblock },
{ "Object Text", evas_test_text },
{ "Callbacks", evas_test_callbacks },
{ "Render Engines", evas_test_render_engines },
{ NULL, NULL }
};
@ -93,6 +94,8 @@ main(int argc, char **argv)
return 0;
}
putenv("EFL_RUN_IN_TREE=1");
evas_init();
s = evas_suite_build(argc - 1, (const char **)argv + 1);
sr = srunner_create(s);

@ -7,6 +7,7 @@ void evas_test_init(TCase *tc);
void evas_test_textblock(TCase *tc);
void evas_test_text(TCase *tc);
void evas_test_callbacks(TCase *tc);
void evas_test_render_engines(TCase *tc);
#endif /* _EVAS_SUITE_H */

@ -0,0 +1,84 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include "evas_suite.h"
#include "Evas.h"
static Eina_Bool
_find_list(const Eina_List *lst, const char *item)
{
const Eina_List *n;
const char *s;
EINA_LIST_FOREACH(lst, n, s)
{
if (strcmp(s, item) == 0)
return EINA_TRUE;
}
return EINA_FALSE;
}
static const char *built_engines[] = {
"software_generic",
"buffer",
#ifdef BUILD_ENGINE_FB
"fb",
#endif
#ifdef BUILD_ENGINE_GL_X11
"gl_x11",
#endif
#ifdef BUILD_ENGINE_PSL1GHT
"psl1ght",
#endif
#ifdef BUILD_ENGINE_SOFTWARE_DDRAW
"software_ddraw",
#endif
#ifdef BUILD_ENGINE_SOFTWARE_GDI
"software_gdi",
#endif
#ifdef BUILD_ENGINE_SOFTWARE_X11
"software_x11",
#endif
#ifdef BUILD_ENGINE_WAYLAND_EGL
"wayland_egl",
#endif
#ifdef BUILD_ENGINE_WAYLAND_SHM
"wayland_shm",
#endif
NULL
};
START_TEST(evas_render_engines)
{
Eina_List *lst = evas_render_method_list();
const char **itr;
for (itr = built_engines; *itr != NULL; itr++)
{
Eina_Bool found = _find_list(lst, *itr);
fail_if(!found, "module should be built, but was not found: %s", *itr);
}
evas_render_method_list_free(lst);
}
END_TEST
START_TEST(evas_render_lookup)
{
const char **itr;
for (itr = built_engines; *itr != NULL; itr++)
{
int id = evas_render_method_lookup(*itr);
fail_if(id == 0, "could not load engine: %s", *itr);
}
}
END_TEST
void evas_test_render_engines(TCase *tc)
{
tcase_add_test(tc, evas_render_engines);
tcase_add_test(tc, evas_render_lookup);
}
Loading…
Cancel
Save