aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-04-16 14:58:42 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-06 15:05:21 +0100
commite77ba60a5829136bd393f3b434c91427640ac20e (patch)
treee9c3ac650d47821c2e44ddc6c07a82d2a6b25bbb
parentelua lib: test progname (diff)
downloadefl-e77ba60a5829136bd393f3b434c91427640ac20e.tar.gz
elua lib: tests for core dirs + fix core dirs
-rw-r--r--src/Makefile_Elua.am9
-rw-r--r--src/Makefile_Elua_Helper.am7
-rw-r--r--src/lib/elua/elua.c2
-rw-r--r--src/tests/elua/elua_lib.c6
4 files changed, 18 insertions, 6 deletions
diff --git a/src/Makefile_Elua.am b/src/Makefile_Elua.am
index fa2f078428..a053053321 100644
--- a/src/Makefile_Elua.am
+++ b/src/Makefile_Elua.am
@@ -46,6 +46,11 @@ bin_elua_elua_LDADD = @ELUA_LIBS@ @USE_ELUA_LIBS@
endif
bin_elua_elua_DEPENDENCIES = @ELUA_INTERNAL_LIBS@ lib/elua/libelua.la
+ELUA_BINDINGS_DIR = $(abs_top_srcdir)/src/bindings/luajit
+ELUA_CORE_DIR = $(abs_top_srcdir)/src/scripts/elua/core
+ELUA_MODULES_DIR = $(abs_top_srcdir)/src/scripts/elua/modules
+ELUA_APPS_DIR = $(abs_top_srcdir)/src/scripts/elua/apps
+
### Helper for other modules using Elua
include Makefile_Elua_Helper.am
@@ -115,6 +120,10 @@ tests_elua_elua_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/elua\" \
-DPACKAGE_DATA_DIR=\"$(top_srcdir)/src/tests/elua\" \
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
+-DELUA_BINDINGS_DIR=\"$(ELUA_BINDINGS_DIR)\" \
+-DELUA_CORE_DIR=\"$(ELUA_CORE_DIR)\" \
+-DELUA_MODULES_DIR=\"$(ELUA_MODULES_DIR)\" \
+-DELUA_APPS_DIR=\"$(ELUA_APPS_DIR)\" \
@CHECK_CFLAGS@ \
@ELUA_CFLAGS@
diff --git a/src/Makefile_Elua_Helper.am b/src/Makefile_Elua_Helper.am
index 479a31ddb6..10b15541fc 100644
--- a/src/Makefile_Elua_Helper.am
+++ b/src/Makefile_Elua_Helper.am
@@ -4,11 +4,8 @@ _ELUA_GEN_DEP = @elua_bin@
else
ELUA_GEN = ELUA_EOLIAN_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \
$(top_builddir)/src/bin/elua/elua${EXEEXT} \
- -I$(abs_top_srcdir)/src/bindings/luajit \
- -C$(abs_top_srcdir)/src/scripts/elua/core \
- -M$(abs_top_srcdir)/src/scripts/elua/modules \
- -A$(abs_top_srcdir)/src/scripts/elua/apps \
- lualian
+ -I$(ELUA_BINDINGS_DIR) -C$(ELUA_CORE_DIR) -M$(ELUA_MODULES_DIR) \
+ -A$(ELUA_APPS_DIR) lualian
_ELUA_GEN_DEP = bin/elua/elua${EXEEXT} scripts/elua/apps/lualian.lua \
scripts/elua/modules/lualian.lua \
scripts/elua/modules/getopt.lua scripts/elua/core/util.lua \
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index 799dd07ee2..d60f1a3963 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -169,7 +169,7 @@ EAPI Eina_Stringshare *
elua_state_apps_dir_get(const Elua_State *es)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(es, NULL);
- return es->moddir;
+ return es->appsdir;
}
EAPI Eina_Stringshare *
diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c
index 600ef5f695..cfe123657c 100644
--- a/src/tests/elua/elua_lib.c
+++ b/src/tests/elua/elua_lib.c
@@ -19,6 +19,12 @@ START_TEST(elua_api)
st = elua_state_new("test");
fail_if(!st);
+ elua_state_dirs_set(st, ELUA_CORE_DIR, ELUA_MODULES_DIR, ELUA_APPS_DIR);
+
+ fail_if(strcmp(elua_state_core_dir_get(st), ELUA_CORE_DIR));
+ fail_if(strcmp(elua_state_mod_dir_get(st), ELUA_MODULES_DIR));
+ fail_if(strcmp(elua_state_apps_dir_get(st), ELUA_APPS_DIR));
+
lst = elua_state_lua_state_get(st);
fail_if(!lst);