summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-10-05 12:39:48 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2014-10-05 12:39:48 +0200
commit08be1164cbaa7ec69bd229e138d3ad86b169f68f (patch)
tree26b212498a9bafe5251bc5e53a506abc3f0d46e5 /tests
parent4174158dc75b5ed892b293b18b7dd5c85aa36f2f (diff)
downloadcrawler-08be1164cbaa7ec69bd229e138d3ad86b169f68f.tar.gz
crawler-08be1164cbaa7ec69bd229e138d3ad86b169f68f.tar.bz2
trying to initialize tolua glue code in test module, segfaulting still
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tolua/libtest1/GNUmakefile3
-rwxr-xr-xtests/tolua/libtest1/TestMod.cpp7
-rwxr-xr-xtests/tolua/test1.cpp4
3 files changed, 8 insertions, 6 deletions
diff --git a/tests/tolua/libtest1/GNUmakefile b/tests/tolua/libtest1/GNUmakefile
index 9393a93..b53a1b2 100755
--- a/tests/tolua/libtest1/GNUmakefile
+++ b/tests/tolua/libtest1/GNUmakefile
@@ -7,7 +7,8 @@ SUBDIRS =
INCLUDE_DIRS = \
-I. -I$(TOPDIR)/src -I.. \
-I$(TOPDIR)/include/module \
- -I$(TOPDIR)/include/util
+ -I$(TOPDIR)/include/util \
+ -I$(TOPDIR)/include/luaglue
INCLUDE_CXXFLAGS = \
diff --git a/tests/tolua/libtest1/TestMod.cpp b/tests/tolua/libtest1/TestMod.cpp
index 491001c..912d652 100755
--- a/tests/tolua/libtest1/TestMod.cpp
+++ b/tests/tolua/libtest1/TestMod.cpp
@@ -1,6 +1,7 @@
#include "TestMod.hpp"
#include "tolua.h"
#include "TestModLua.hpp"
+#include "LuaVM.hpp"
#include <iostream>
@@ -11,9 +12,11 @@ void Derived::hello( )
cout << "hello" << endl;
}
-static void initModule( )
+static void initModule( void *user_data )
{
-// tolua_TestMod_open( 0 /* m_lua, where from? */ );
+ LuaVM *luaVm = (LuaVM *)user_data;
+
+ tolua_TestMod_open( luaVm->handle( ) );
}
static void destroyModule( )
diff --git a/tests/tolua/test1.cpp b/tests/tolua/test1.cpp
index a2e91cb..fe2801a 100755
--- a/tests/tolua/test1.cpp
+++ b/tests/tolua/test1.cpp
@@ -17,9 +17,7 @@ int main( int /* argc */, char *argv[] )
vector<string> modules;
modules.push_back( "./libtest1/mod_test.so" );
- ModuleLoader<Base> loader( modules );
-
- Logger::instance( ).openConsoleLog( logDEBUG );
+ ModuleLoader<Base> loader( modules, (void *)&luaVm );
luaVm.loadSource( argv[1] );
luaVm.executeMain( );