CppUnit project page FAQ CppUnit home page

TestSuiteBuilderContext.h
Go to the documentation of this file.
1#ifndef CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
2#define CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
3
6#include <string>
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
15
16class TestSuite;
17class TestFixture;
19class TestNamer;
20
30{
31public:
38 const TestNamer &namer,
39 TestFixtureFactory &factory );
40
42
47 void addTest( Test *test );
48
53 std::string getFixtureName() const;
54
63 std::string getTestNameFor( const std::string &testMethodName ) const;
64
69 void addProperty( const std::string &key,
70 const std::string &value );
71
75 const std::string getStringProperty( const std::string &key ) const;
76
77protected:
79
80 // Notes: we use a vector here instead of a map to work-around the
81 // shared std::map in dll bug in VC6.
82 // See http://www.dinkumware.com/vc_fixes.html for detail.
83 typedef std::pair<std::string,std::string> Property;
85
89
90private:
92};
93
94
99template<class Fixture>
101{
102public:
103 typedef Fixture FixtureType;
104
109
121};
122
123
125
126#if CPPUNIT_NEED_DLL_DECL
127#pragma warning( pop )
128#endif
129
130#endif // CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
131
#define CPPUNIT_API
Definition CppUnitApi.h:27
#define CppUnitVector
Definition CppUnitVector.h:20
#define CPPUNIT_NS_END
Definition Portability.h:120
#define CPPUNIT_STATIC_CAST(TargetType, pointer)
Definition Portability.h:101
#define CPPUNIT_NS_BEGIN
Definition Portability.h:119
Abstract TestFixture factory (Implementation).
Definition TestFixtureFactory.h:17
Wraps a test case with setUp and tearDown methods.
Definition TestFixture.h:84
Base class for all test objects.
Definition Test.h:26
Names a test or a fixture suite.
Definition TestNamer.h:51
const std::string getStringProperty(const std::string &key) const
Returns property value assigned to param key.
Definition TestSuiteBuilderContext.cpp:73
TestSuite & m_suite
Definition TestSuiteBuilderContext.h:86
std::pair< std::string, std::string > Property
Definition TestSuiteBuilderContext.h:83
void addProperty(const std::string &key, const std::string &value)
Adds property pair.
Definition TestSuiteBuilderContext.cpp:55
std::string getTestNameFor(const std::string &testMethodName) const
Returns the name of the test for the specified method.
Definition TestSuiteBuilderContext.cpp:40
TestFixture * makeTestFixture() const
Definition TestSuiteBuilderContext.cpp:48
TestSuiteBuilderContextBase(TestSuite &suite, const TestNamer &namer, TestFixtureFactory &factory)
Constructs a new context.
Definition TestSuiteBuilderContext.cpp:9
std::string getFixtureName() const
Returns the fixture name.
Definition TestSuiteBuilderContext.cpp:33
void addTest(Test *test)
Adds a test to the fixture suite.
Definition TestSuiteBuilderContext.cpp:26
CppUnitVector< Property > Properties
Definition TestSuiteBuilderContext.h:84
const TestNamer & m_namer
Definition TestSuiteBuilderContext.h:87
Properties m_properties
Definition TestSuiteBuilderContext.h:91
TestFixtureFactory & m_factory
Definition TestSuiteBuilderContext.h:88
TestSuiteBuilderContext(TestSuiteBuilderContextBase &contextBase)
Definition TestSuiteBuilderContext.h:105
Fixture FixtureType
Definition TestSuiteBuilderContext.h:103
FixtureType * makeFixture() const
Returns a new TestFixture instance.
Definition TestSuiteBuilderContext.h:116
A Composite of Tests.
Definition TestSuite.h:41

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers