diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2014-10-08 14:29:34 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2014-10-08 14:29:34 +0200 |
commit | 7280e10e8bfa507953d8c823abd502db98c514fa (patch) | |
tree | 9c60dad32369be442e659dede923f67e2a9a546c /tests | |
parent | 4aec1091870aaeec9d64b4bd9d7d143ef4a2bbcc (diff) | |
download | crawler-7280e10e8bfa507953d8c823abd502db98c514fa.tar.gz crawler-7280e10e8bfa507953d8c823abd502db98c514fa.tar.bz2 |
some fixes on Windows
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/modules/Makefile.W32 | 1 | ||||
-rwxr-xr-x | tests/modules/testmod3/Makefile.W32 | 1 | ||||
-rwxr-xr-x | tests/modules/testmod4/Makefile.W32 | 1 | ||||
-rw-r--r-- | tests/tolua/Makefile.W32 | 44 | ||||
-rw-r--r-- | tests/tolua/exec_test | 8 | ||||
-rw-r--r-- | tests/tolua/exec_test.cmd | 21 | ||||
-rw-r--r-- | tests/tolua/libtest1/Makefile.W32 | 53 | ||||
-rwxr-xr-x | tests/url/Makefile.W32 | 8 |
8 files changed, 137 insertions, 0 deletions
diff --git a/tests/modules/Makefile.W32 b/tests/modules/Makefile.W32 index 5705031..307e8a4 100755 --- a/tests/modules/Makefile.W32 +++ b/tests/modules/Makefile.W32 @@ -10,6 +10,7 @@ INCLUDE_CXXFLAGS = \ INCLUDE_DIRS = \ /I. \ /I$(TOPDIR)\src \ + /I$(TOPDIR)\include \ /I$(TOPDIR)\include\module \ /I$(TOPDIR)\include\util \ /I$(TOPDIR)\include\crawler \ diff --git a/tests/modules/testmod3/Makefile.W32 b/tests/modules/testmod3/Makefile.W32 index 44d289d..f8fc46c 100755 --- a/tests/modules/testmod3/Makefile.W32 +++ b/tests/modules/testmod3/Makefile.W32 @@ -10,6 +10,7 @@ INCLUDE_CXXFLAGS = \ INCLUDE_DIRS = \ /I. \ /I$(TOPDIR)\src \ + /I$(TOPDIR)\include \ /I$(TOPDIR)\include\module \ /I$(TOPDIR)\include\util \ /I$(TOPDIR)\include\crawler \ diff --git a/tests/modules/testmod4/Makefile.W32 b/tests/modules/testmod4/Makefile.W32 index 6bf7af1..c688308 100755 --- a/tests/modules/testmod4/Makefile.W32 +++ b/tests/modules/testmod4/Makefile.W32 @@ -10,6 +10,7 @@ INCLUDE_CXXFLAGS = \ INCLUDE_DIRS = \ /I. \ /I$(TOPDIR)\src \ + /I$(TOPDIR)\include \ /I$(TOPDIR)\include\module \ /I$(TOPDIR)\include\util \ /I$(TOPDIR)\include\crawler \ diff --git a/tests/tolua/Makefile.W32 b/tests/tolua/Makefile.W32 new file mode 100644 index 0000000..aedc3e2 --- /dev/null +++ b/tests/tolua/Makefile.W32 @@ -0,0 +1,44 @@ +TOPDIR = ..\.. + +SUBDIRS = libtest1 + +!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk + +INCLUDE_CXXFLAGS = \ + /D_WIN32_WINNT=0x504 /DSHARED + +INCLUDE_DIRS = \ + /I. \ + /I$(TOPDIR)\src \ + /I$(TOPDIR)\include \ + /I$(TOPDIR)\include\module \ + /I$(TOPDIR)\include\util \ + /I$(TOPDIR)\include\logger \ + /I$(TOPDIR)\include\crawler \ + /I$(TOPDIR)\include\luaglue \ + /I$(TOPDIR)\lua\src + +INCLUDE_LDFLAGS = \ + +INCLUDE_LIBS = \ + $(TOPDIR)\src\libutil\util.lib \ + $(TOPDIR)\src\libcrawler\crawler.lib \ + $(TOPDIR)\src\liblogger\logger.lib \ + $(TOPDIR)\src\libluaglue\luaglue.lib + +TEST_CPP_BINS = \ + test1.exe + +OBJS = + +!INCLUDE $(TOPDIR)\makefiles\nmake\sub.mk + +test1.exe: test1.obj + +local_clean: + @-erase -f *.RES *.DIFF *.ERR 2>NUL + +local_distclean: + +local_test: + @-exec_test test1 "ToLua binding in module" diff --git a/tests/tolua/exec_test b/tests/tolua/exec_test new file mode 100644 index 0000000..5b29fc8 --- /dev/null +++ b/tests/tolua/exec_test @@ -0,0 +1,8 @@ +#!/bin/sh + +BINARY=$1 +TITLE=$2 + +printf "$BINARY: $TITLE .. " +LD_LIBRARY_PATH=../../src:../../src/liblogger:../../src/libcrawler:../../src/libluaglue:libcommon ./$BINARY >$BINARY.RES 2>&1 +diff $BINARY.MUST $BINARY.RES > $BINARY.DIFF && printf "OK\n" || printf "ERROR\n" diff --git a/tests/tolua/exec_test.cmd b/tests/tolua/exec_test.cmd new file mode 100644 index 0000000..49d6168 --- /dev/null +++ b/tests/tolua/exec_test.cmd @@ -0,0 +1,21 @@ +@echo off + +set BINARY=%1 +set TITLE=%2 + +copy libcommon\common.dll . >NUL +copy ..\..\src\libcrawler\crawler.dll . >NUL +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 +..\..\utils\win32\dos2unix <%BINARY%.OUT >%BINARY%.RES +erase /q %BINARY%.OUT +echo n | comp %BINARY%.MUST %BINARY%.RES > %BINARY%.DIFF 2>NUL +if ERRORLEVEL 1 GOTO FAIL +echo %BINARY%: %TITLE%.. OK +goto END +:FAIL +echo %BINARY%: %TITLE% .. ERROR +:END diff --git a/tests/tolua/libtest1/Makefile.W32 b/tests/tolua/libtest1/Makefile.W32 new file mode 100644 index 0000000..407d9ae --- /dev/null +++ b/tests/tolua/libtest1/Makefile.W32 @@ -0,0 +1,53 @@ +TOPDIR = ..\..\.. + +SUBDIRS = + +!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk + +INCLUDE_CXXFLAGS = \ + /D_WIN32_WINNT=0x504 + +INCLUDE_DIRS = \ + /I. \ + /I$(TOPDIR)\src \ + /I$(TOPDIR)\include \ + /I$(TOPDIR)\include\module \ + /I$(TOPDIR)\include\util \ + /I$(TOPDIR)\include\luaglue \ + /I.. + +INCLUDE_LDFLAGS = \ + +INCLUDE_LIBS = \ + $(TOPDIR)\src\libutil\util.lib \ + $(TOPDIR)\src\libluaglue\luaglue.lib + +DYNAMIC_MODULE = \ + mod_test.dll + +STATIC_LIB = \ + libtest.lib + +CPP_OBJS = \ + TestMod.obj \ + TestModLua.obj + +SHARED_CPP_OBJS = \ + TestMod.dllobj \ + TestModLua.dllobj + +!INCLUDE $(TOPDIR)\makefiles\nmake\sub.mk + +$(STATIC_LIB): $(CPP_OBJS) + $(LINK) /lib /nologo /out:$@ $(STATIC_LDFLAGS) $? + +$(DYNAMIC_MODULE): $(SHARED_CPP_OBJS) + $(LINK) /dll /nologo /out:$@ $(LDFLAGS) $(LIBS) $? + +local_all: $(STATIC_LIB) $(DYNAMIC_MODULE) + +local_clean: + +local_distclean: + +local_test: diff --git a/tests/url/Makefile.W32 b/tests/url/Makefile.W32 index d71853c..93e6494 100755 --- a/tests/url/Makefile.W32 +++ b/tests/url/Makefile.W32 @@ -11,6 +11,7 @@ INCLUDE_CXXFLAGS = \ INCLUDE_DIRS = \ /I. \ /I$(TOPDIR)\src \ + /I$(TOPDIR)\include \ /I$(TOPDIR)\include\module \ /I$(TOPDIR)\include\util \ /I$(TOPDIR)\include\crawler \ @@ -25,7 +26,14 @@ INCLUDE_LIBS = \ $(TOPDIR)\src\modules\urlnormalizer\simpleurl\simpleurlnormalizer.lib \ $(TOPDIR)\src\modules\urlnormalizer\googleurl\googleurlnormalizer.lib \ $(TOPDIR)\googleurl\googleurl.lib \ + +!IFDEF DEBUG +INCLUDE_LIBS = $(INCLUDE_LIBS) \ + "$(ICU_DIR)\lib\icuucd.lib" +!ELSE +INCLUDE_LIBS = $(INCLUDE_LIBS) \ "$(ICU_DIR)\lib\icuuc.lib" +!ENDIF TEST_CPP_BINS = \ test1.exe |