summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2014-10-14 10:58:50 +0200
committerAndreas Baumann <abaumann@yahoo.com>2014-10-14 10:58:50 +0200
commit0b3f1a0e088575988beaaea11b3e32a0bd26f63a (patch)
tree6d19a10e4280d127e06409be785faa9e5450ec9a /tests
parentc53b92a2da701e0ae8c0263ab92344dd418558c2 (diff)
downloadcrawler-0b3f1a0e088575988beaaea11b3e32a0bd26f63a.tar.gz
crawler-0b3f1a0e088575988beaaea11b3e32a0bd26f63a.tar.bz2
tolua test runs on Windows
Diffstat (limited to 'tests')
-rw-r--r--tests/tolua/Makefile.W324
-rw-r--r--tests/tolua/exec_test.cmd5
-rwxr-xr-xtests/tolua/libtest1/GNUmakefile3
-rw-r--r--tests/tolua/libtest1/Makefile.W3221
-rw-r--r--tests/tolua/test1.MUST2
-rwxr-xr-xtests/tolua/test1.cpp4
6 files changed, 32 insertions, 7 deletions
diff --git a/tests/tolua/Makefile.W32 b/tests/tolua/Makefile.W32
index aedc3e2..5513cca 100644
--- a/tests/tolua/Makefile.W32
+++ b/tests/tolua/Makefile.W32
@@ -35,10 +35,12 @@ OBJS =
test1.exe: test1.obj
+local_all:
+
local_clean:
@-erase -f *.RES *.DIFF *.ERR 2>NUL
local_distclean:
local_test:
- @-exec_test test1 "ToLua binding in module"
+ @-exec_test.cmd test1 test1.lua "ToLua binding in module"
diff --git a/tests/tolua/exec_test.cmd b/tests/tolua/exec_test.cmd
index 49d6168..3c4c627 100644
--- a/tests/tolua/exec_test.cmd
+++ b/tests/tolua/exec_test.cmd
@@ -1,7 +1,8 @@
@echo off
set BINARY=%1
-set TITLE=%2
+set LUA=%2
+set TITLE=3
copy libcommon\common.dll . >NUL
copy ..\..\src\libcrawler\crawler.dll . >NUL
@@ -9,7 +10,7 @@ copy ..\..\src\liblogger\logger.dll . >NUL
copy ..\..\src\libutil\util.dll . >NUL
copy ..\..\src\libluaglue\luaglue.dll . >NUL
copy ..\..\lua\src\lua52.dll . >NUL
-%BINARY% >%BINARY%.OUT 2>%BINARY%.ERR
+%BINARY% %LUA% >%BINARY%.OUT 2>%BINARY%.ERR
..\..\utils\win32\dos2unix <%BINARY%.OUT >%BINARY%.RES
erase /q %BINARY%.OUT
echo n | comp %BINARY%.MUST %BINARY%.RES > %BINARY%.DIFF 2>NUL
diff --git a/tests/tolua/libtest1/GNUmakefile b/tests/tolua/libtest1/GNUmakefile
index 2a83f6e..4845035 100755
--- a/tests/tolua/libtest1/GNUmakefile
+++ b/tests/tolua/libtest1/GNUmakefile
@@ -37,6 +37,9 @@ CPP_OBJS = \
TestModLua.cpp: TestMod.pkg
$(TOLUA) -H TestModLua.hpp -o TestModLua.cpp TestMod.pkg
+TestModLua.hpp: TestMod.pkg
+ $(TOLUA) -H TestModLua.hpp -o TestModLua.cpp TestMod.pkg
+
local_all:
local_clean:
diff --git a/tests/tolua/libtest1/Makefile.W32 b/tests/tolua/libtest1/Makefile.W32
index 407d9ae..368fc78 100644
--- a/tests/tolua/libtest1/Makefile.W32
+++ b/tests/tolua/libtest1/Makefile.W32
@@ -5,7 +5,8 @@ SUBDIRS =
!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk
INCLUDE_CXXFLAGS = \
- /D_WIN32_WINNT=0x504
+ /D_WIN32_WINNT=0x504 \
+ $(TOLUA_CFLAGS)
INCLUDE_DIRS = \
/I. \
@@ -14,13 +15,16 @@ INCLUDE_DIRS = \
/I$(TOPDIR)\include\module \
/I$(TOPDIR)\include\util \
/I$(TOPDIR)\include\luaglue \
- /I..
+ /I.. \
+ $(TOLUA_INCLUDES)
INCLUDE_LDFLAGS = \
-
+ $(TOLUA_LDFLAGS)
+
INCLUDE_LIBS = \
$(TOPDIR)\src\libutil\util.lib \
- $(TOPDIR)\src\libluaglue\luaglue.lib
+ $(TOPDIR)\src\libluaglue\luaglue.lib \
+ $(TOLUA_LIBS)
DYNAMIC_MODULE = \
mod_test.dll
@@ -46,7 +50,16 @@ $(DYNAMIC_MODULE): $(SHARED_CPP_OBJS)
local_all: $(STATIC_LIB) $(DYNAMIC_MODULE)
+TestMod.cpp: TestModLua.hpp
+
+TestModLua.cpp: TestMod.pkg
+ $(TOLUA) -H TestModLua.hpp -o TestModLua.cpp TestMod.pkg
+
+TestModLua.hpp: TestMod.pkg
+ $(TOLUA) -H TestModLua.hpp -o TestModLua.cpp TestMod.pkg
+
local_clean:
+ @-erase TestModLua.cpp TestModLua.hpp 2>NUL
local_distclean:
diff --git a/tests/tolua/test1.MUST b/tests/tolua/test1.MUST
new file mode 100644
index 0000000..5cd91bf
--- /dev/null
+++ b/tests/tolua/test1.MUST
@@ -0,0 +1,2 @@
+hello
+Show this string
diff --git a/tests/tolua/test1.cpp b/tests/tolua/test1.cpp
index a3810e2..4ee26ff 100755
--- a/tests/tolua/test1.cpp
+++ b/tests/tolua/test1.cpp
@@ -17,7 +17,11 @@ int main( int /* argc */, char *argv[] )
LuaVM luaVm;
vector<string> modules;
+#ifndef _WIN32
modules.push_back( "./libtest1/mod_test.so" );
+#else
+ modules.push_back( ".\\libtest1\\mod_test.dll" );
+#endif
ModuleLoader<Base> loader( modules, CLOSE_DEFERRED, (void *)&luaVm );
luaVm.loadSource( argv[1] );