diff options
Diffstat (limited to 'tests/modules/testmod4')
-rwxr-xr-x | tests/modules/testmod4/GNUmakefile | 43 | ||||
-rwxr-xr-x | tests/modules/testmod4/Makefile.W32 | 51 | ||||
-rwxr-xr-x | tests/modules/testmod4/TestMod4.cpp | 34 | ||||
-rwxr-xr-x | tests/modules/testmod4/TestMod4.hpp | 25 |
4 files changed, 153 insertions, 0 deletions
diff --git a/tests/modules/testmod4/GNUmakefile b/tests/modules/testmod4/GNUmakefile new file mode 100755 index 0000000..b5bdf06 --- /dev/null +++ b/tests/modules/testmod4/GNUmakefile @@ -0,0 +1,43 @@ +TOPDIR = ../../.. + +SUBDIRS = + +-include $(TOPDIR)/makefiles/gmake/platform.mk + +INCLUDE_DIRS = \ + -I. -I$(TOPDIR)/src -I.. \ + -I$(TOPDIR)/include/module \ + -I$(TOPDIR)/include/util \ + -I$(TOPDIR)/tests/modules/libcommon + +INCLUDE_CXXFLAGS = \ + +INCLUDE_LDFLAGS = \ + -L$(TOPDIR)/src/libcrawler + +INCLUDE_LIBS = \ + -lcrawler + +DYNAMIC_MODULE = \ + mod_test4.so + +STATIC_LIB = \ + libtest4.a + +CPP_OBJS = \ + TestMod4.o + +-include $(TOPDIR)/makefiles/gmake/sub.mk + +local_all: + +local_clean: + +local_distclean: + +local_install: + +local_uninstall: + +local_test: + diff --git a/tests/modules/testmod4/Makefile.W32 b/tests/modules/testmod4/Makefile.W32 new file mode 100755 index 0000000..6bf7af1 --- /dev/null +++ b/tests/modules/testmod4/Makefile.W32 @@ -0,0 +1,51 @@ +TOPDIR = ..\..\.. + +SUBDIRS = + +!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk + +INCLUDE_CXXFLAGS = \ + /D_WIN32_WINNT=0x504 + +INCLUDE_DIRS = \ + /I. \ + /I$(TOPDIR)\src \ + /I$(TOPDIR)\include\module \ + /I$(TOPDIR)\include\util \ + /I$(TOPDIR)\include\crawler \ + /I.. \ + /I..\libcommon + +INCLUDE_LDFLAGS = \ + +INCLUDE_LIBS = \ + $(TOPDIR)\src\libutil\util.lib \ + ..\libcommon\common.lib + +DYNAMIC_MODULE = \ + mod_test4.dll + +STATIC_LIB = \ + test4.lib + +CPP_OBJS = \ + TestMod4.obj + +SHARED_CPP_OBJS = \ + TestMod4.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/modules/testmod4/TestMod4.cpp b/tests/modules/testmod4/TestMod4.cpp new file mode 100755 index 0000000..cd0578e --- /dev/null +++ b/tests/modules/testmod4/TestMod4.cpp @@ -0,0 +1,34 @@ +#include "TestMod4.hpp" +#include "Common.hpp" + +#include <iostream> + +#include <vector> +#include <string> + +using namespace std; + +Derived::Derived( ) +{ +} + +Derived::~Derived( ) +{ +} + +void Derived::hello( ) +{ + Common::instance( ).print( "hello world from module" ); +} + +static void initModule( ) +{ + Common::instance( ).print( "Module 4 initModule called" ); +} + +static void destroyModule( ) +{ + Common::instance( ).print( "Module 4 destroyModule called" ); +} + +REGISTER_MODULE( "testmod4", &initModule, &destroyModule, Base, Derived ) diff --git a/tests/modules/testmod4/TestMod4.hpp b/tests/modules/testmod4/TestMod4.hpp new file mode 100755 index 0000000..d4d4d99 --- /dev/null +++ b/tests/modules/testmod4/TestMod4.hpp @@ -0,0 +1,25 @@ +#ifndef __TESTMOD_H +#define __TESTMOD_H + +#include "Base.hpp" + +#include "ModuleRegistry.hpp" + +#include "ModuleLoader.hpp" + +class Derived : public Base +{ + public: + Derived( ); + + virtual ~Derived( ); + + virtual void hello( ); + + private: + ModuleLoader<Base> *m_loader; +}; + +DECLARE_MODULE( Base ) + +#endif |