CppUnit - The Unit Testing Library

CppUnit project page | FAQ

PlugInManager.h
Go to the documentation of this file.
1#ifndef CPPUNIT_PLUGIN_PLUGINMANAGER_H
2#define CPPUNIT_PLUGIN_PLUGINMANAGER_H
3
4#include <cppunit/Portability.h>
5
6#if !defined(CPPUNIT_NO_TESTPLUGIN)
7
8#if CPPUNIT_NEED_DLL_DECL
9#pragma warning( push )
10#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
11#endif
12
13#include <cppunit/plugin/PlugInParameters.h>
14struct CppUnitTestPlugIn;
15
16 CPPUNIT_NS_BEGIN
17
18
19class DynamicLibraryManager;
20class TestResult;
21class XmlOutputter;
22
23
26 class CPPUNIT_API PlugInManager
27{
28public:
31 PlugInManager();
32
34 virtual ~PlugInManager();
35
46 void load( const std::string &libraryFileName,
47 const PlugInParameters &parameters = PlugInParameters() );
48
53 void unload( const std::string &libraryFileName );
54
59 void addListener( TestResult *eventManager );
60
64 void removeListener( TestResult *eventManager );
65
68 void addXmlOutputterHooks( XmlOutputter *outputter );
69
74 void removeXmlOutputterHooks();
75
76protected:
79 struct PlugInInfo
80 {
81 std::string m_fileName;
82 DynamicLibraryManager *m_manager;
83 CppUnitTestPlugIn *m_interface;
84 };
85
89 void unload( PlugInInfo &plugIn );
90
91private:
93 PlugInManager( const PlugInManager &copy );
94
96 void operator =( const PlugInManager &copy );
97
98private:
99 typedef std::deque<PlugInInfo> PlugIns;
100 PlugIns m_plugIns;
101};
102
103
104 CPPUNIT_NS_END
105
106#if CPPUNIT_NEED_DLL_DECL
107#pragma warning( pop )
108#endif
109
110#endif // !defined(CPPUNIT_NO_TESTPLUGIN)
111
112
113#endif // CPPUNIT_PLUGIN_PLUGINMANAGER_H
CPPUNIT_API
#define CPPUNIT_API
Definition: CppUnitApi.h:27
PlugInParameters.h
Portability.h
CPPUNIT_NS_END
#define CPPUNIT_NS_END
Definition: Portability.h:106
CPPUNIT_NS_BEGIN
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:105
DynamicLibraryManager
Manages dynamic libraries.
Definition: DynamicLibraryManager.h:35
PlugInManager
Manges TestPlugIn.
Definition: PlugInManager.h:27
PlugInManager::m_plugIns
PlugIns m_plugIns
Definition: PlugInManager.h:100
PlugInManager::PlugInManager
PlugInManager(const PlugInManager &copy)
Prevents the use of the copy constructor.
PlugInManager::PlugIns
std::deque< PlugInInfo > PlugIns
Definition: PlugInManager.h:99
PlugInParameters
Test plug-ins parameters.
Definition: PlugInParameters.h:16
TestResult
Manages TestListener.
Definition: TestResult.h:48
XmlOutputter
Outputs a TestResultCollector in XML format.
Definition: XmlOutputter.h:40
CppUnitTestPlugIn
Test plug-in interface.
Definition: TestPlugIn.h:44
PlugInManager::PlugInInfo
(INTERNAL) Information about a specific plug-in.
Definition: PlugInManager.h:80
PlugInManager::PlugInInfo::m_manager
DynamicLibraryManager * m_manager
Definition: PlugInManager.h:82
PlugInManager::PlugInInfo::m_interface
CppUnitTestPlugIn * m_interface
Definition: PlugInManager.h:83
PlugInManager::PlugInInfo::m_fileName
std::string m_fileName
Definition: PlugInManager.h:81

| Send comments to: CppUnit Developers