diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/modules/Makefile.W32 | 11 | ||||
-rwxr-xr-x | tests/modules/exec_test.cmd | 3 | ||||
-rwxr-xr-x | tests/modules/libcommon/Common.hpp | 10 | ||||
-rwxr-xr-x | tests/modules/libcommon/Makefile.W32 | 30 | ||||
-rwxr-xr-x | tests/modules/testmod/Makefile.W32 | 1 | ||||
-rwxr-xr-x | tests/modules/testmod2/Makefile.W32 | 8 | ||||
-rwxr-xr-x | tests/modules/testmod3/Makefile.W32 | 10 |
7 files changed, 43 insertions, 30 deletions
diff --git a/tests/modules/Makefile.W32 b/tests/modules/Makefile.W32 index 1af8e7b..405166f 100755 --- a/tests/modules/Makefile.W32 +++ b/tests/modules/Makefile.W32 @@ -5,16 +5,21 @@ SUBDIRS = testmod testmod2 testmod3 !INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk INCLUDE_CXXFLAGS = \ - /D_WIN32_WINNT=0x504 + /D_WIN32_WINNT=0x504 /DSHARED INCLUDE_DIRS = \ /I. \ - /I$(TOPDIR)\src + /I$(TOPDIR)\src \ + /I$(TOPDIR)\include\module \ + /I$(TOPDIR)\include\util \ + /I$(TOPDIR)\include\crawler \ + /I$(TOPDIR)\tests\modules\libcommon INCLUDE_LDFLAGS = \ INCLUDE_LIBS = \ - $(TOPDIR)\src\crawler.lib + $(TOPDIR)\src\libcrawler\crawler.lib \ + $(TOPDIR)\tests\modules\libcommon\common.lib TEST_CPP_BINS = \ test1.exe \ diff --git a/tests/modules/exec_test.cmd b/tests/modules/exec_test.cmd index 81a6222..511c14a 100755 --- a/tests/modules/exec_test.cmd +++ b/tests/modules/exec_test.cmd @@ -3,6 +3,9 @@ set BINARY=%1
set TITLE=%2
+copy libcommon\common.dll . >NUL
+copy ..\..\src\libcrawler\crawler.dll . >NUL
+copy ..\..\src\logger\logger.dll . >NUL
%BINARY% >%BINARY%.OUT 2>%BINARY%.ERR
..\..\utils\win32\dos2unix <%BINARY%.OUT >%BINARY%.RES
erase /q %BINARY%.OUT
diff --git a/tests/modules/libcommon/Common.hpp b/tests/modules/libcommon/Common.hpp index 22ca5a2..68db2f8 100755 --- a/tests/modules/libcommon/Common.hpp +++ b/tests/modules/libcommon/Common.hpp @@ -14,13 +14,15 @@ class Common : public Singleton< Common > DECLARE_SINGLETON( Common ) public: - Common( ); - virtual ~Common( ); - void setName( string name ); - void print( string s ); + COMMON_DLL_VISIBLE Common( ); + COMMON_DLL_VISIBLE virtual ~Common( ); + COMMON_DLL_VISIBLE void setName( string name ); + COMMON_DLL_VISIBLE void print( string s ); private: string m_name; }; +DEFINE_SINGLETON( Common ) + #endif diff --git a/tests/modules/libcommon/Makefile.W32 b/tests/modules/libcommon/Makefile.W32 index 3dc28b6..7943bcd 100755 --- a/tests/modules/libcommon/Makefile.W32 +++ b/tests/modules/libcommon/Makefile.W32 @@ -1,40 +1,38 @@ -TOPDIR = ..\.. +TOPDIR = ..\..\.. -SUBDIRS = testmod testmod2 testmod3 +SUBDIRS = !INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk INCLUDE_CXXFLAGS = \ /D_WIN32_WINNT=0x504 \ - /DBUILDING_CRAWLER /DBUILDING_UTIL + /DBUILDING_COMMON /DBUILDING_UTIL INCLUDE_DIRS = \ /I. \ - /I$(TOPDIR)\src + /I$(TOPDIR)\src \ + /I$(TOPDIR)\include\util INCLUDE_LDFLAGS = \ INCLUDE_LIBS = \ - $(TOPDIR)\src\crawler.lib -OBJS = +CPP_OBJS = \ + Common.dllobj + +DYNAMIC_LIB = \ + common.dll !INCLUDE $(TOPDIR)\makefiles\nmake\sub.mk -test1.exe: test1.obj -test2.exe: test2.obj -test3.exe: test3.obj +$(DYNAMIC_LIB): $(CPP_OBJS) + $(LINK) /nologo /dll /out:$@ $(LDFLAGS) $(LIBS) $? -# must build test2.lib first becase it contains DDL exports for the -# Common singleton -local_all: test2.exe +local_all: $(DYNAMIC_LIB) local_clean: - @-erase -f *.RES *.DIFF *.ERR 2>NUL + @-erase $(DYNAMIC_LIB) 2>NUL local_distclean: local_test: - @-exec_test test1 "Module loader" - @-exec_test test2 "Module loader with singleton" - @-exec_test test3 "Load module in module" diff --git a/tests/modules/testmod/Makefile.W32 b/tests/modules/testmod/Makefile.W32 index 77d16cb..4b39aab 100755 --- a/tests/modules/testmod/Makefile.W32 +++ b/tests/modules/testmod/Makefile.W32 @@ -17,7 +17,6 @@ INCLUDE_DIRS = \ INCLUDE_LDFLAGS = \ INCLUDE_LIBS = \ - $(TOPDIR)\src\crawler.lib DYNAMIC_MODULE = \ mod_test.dll diff --git a/tests/modules/testmod2/Makefile.W32 b/tests/modules/testmod2/Makefile.W32 index f1ae5e1..cc78d43 100755 --- a/tests/modules/testmod2/Makefile.W32 +++ b/tests/modules/testmod2/Makefile.W32 @@ -10,13 +10,15 @@ INCLUDE_CXXFLAGS = \ INCLUDE_DIRS = \ /I. \ /I$(TOPDIR)\src \ - /I.. + /I.. \ + /I..\libcommon \ + /I$(TOPDIR)\include\module \ + /I$(TOPDIR)\include\util INCLUDE_LDFLAGS = \ INCLUDE_LIBS = \ - $(TOPDIR)\src\crawler.lib \ - ..\test2.lib + ..\libcommon\common.lib DYNAMIC_MODULE = \ mod_test2.dll diff --git a/tests/modules/testmod3/Makefile.W32 b/tests/modules/testmod3/Makefile.W32 index 0f1aac0..d4ead3c 100755 --- a/tests/modules/testmod3/Makefile.W32 +++ b/tests/modules/testmod3/Makefile.W32 @@ -10,13 +10,17 @@ INCLUDE_CXXFLAGS = \ INCLUDE_DIRS = \ /I. \ /I$(TOPDIR)\src \ - /I.. + /I$(TOPDIR)\include\module \ + /I$(TOPDIR)\include\util \ + /I$(TOPDIR)\include\crawler \ + /I.. \ + /I..\libcommon INCLUDE_LDFLAGS = \ INCLUDE_LIBS = \ - $(TOPDIR)\src\crawler.lib \ - ..\test2.lib + $(TOPDIR)\src\libcrawler\crawler.lib \ + ..\libcommon\common.lib DYNAMIC_MODULE = \ mod_test3.dll |