CppUnit project page
FAQ
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
include
cppunit
extensions
TestFactoryRegistry.h
Go to the documentation of this file.
1
#ifndef CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
2
#define CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
3
4
#include <
cppunit/Portability.h
>
5
6
#if CPPUNIT_NEED_DLL_DECL
7
#pragma warning( push )
8
#pragma warning( disable: 4251) // X needs to have dll-interface to be used by clients of class Z
9
#endif
10
11
#include <set>
12
#include <
cppunit/extensions/TestFactory.h
>
13
#include <string>
14
15
CPPUNIT_NS_BEGIN
16
17
18
class
TestSuite
;
19
75
class
CPPUNIT_API
TestFactoryRegistry
:
public
TestFactory
76
{
77
public
:
82
TestFactoryRegistry
( std::string name );
83
85
virtual
~
TestFactoryRegistry
();
86
91
virtual
Test
*
makeTest
();
92
102
static
TestFactoryRegistry
&getRegistry(
const
std::string &name =
"All Tests"
);
103
107
void
addTestToSuite(
TestSuite
*suite );
108
113
void
registerFactory(
TestFactory
*factory );
114
121
void
unregisterFactory(
TestFactory
*factory );
122
133
void
addRegistry(
const
std::string &name );
134
148
static
bool
isValid();
149
155
void
registerFactory(
const
std::string &name,
156
TestFactory
*factory );
157
158
private
:
159
TestFactoryRegistry
(
const
TestFactoryRegistry
© );
160
void
operator =(
const
TestFactoryRegistry
© );
161
162
private
:
163
typedef
std::set<TestFactory *, std::less<TestFactory*> >
Factories
;
164
Factories
m_factories
;
165
166
std::string
m_name
;
167
};
168
169
170
CPPUNIT_NS_END
171
172
#if CPPUNIT_NEED_DLL_DECL
173
#pragma warning( pop )
174
#endif
175
176
177
#endif // CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H
Send comments to:
CppUnit Developers