CppUnit project page FAQ

TestSuiteBuilderContext.h
Go to the documentation of this file.
1 #ifndef CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
2 #define CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
3 
4 #include <cppunit/Portability.h>
5 #include <map>
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 
16 class TestSuite;
17 class TestFixture;
18 class TestFixtureFactory;
19 class TestNamer;
20 
30 {
31 public:
38  const TestNamer &namer,
39  TestFixtureFactory &factory );
40 
41  virtual ~TestSuiteBuilderContextBase();
42 
47  void addTest( Test *test );
48 
53  std::string getFixtureName() const;
54 
63  std::string getTestNameFor( const std::string &testMethodName ) const;
64 
74  template<typename T>
75  std::string getTestNameFor( const std::string &testMethodName, const T& value ) const
76  {
77  return m_namer.getTestNameFor(testMethodName, value);
78  }
79 
84  void addProperty( const std::string &key,
85  const std::string &value );
86 
90  const std::string getStringProperty( const std::string &key ) const;
91 
92 protected:
93  TestFixture *makeTestFixture() const;
94 
95  // Notes: we use a vector here instead of a map to work-around the
96  // shared std::map in dll bug in VC6.
97  // See http://www.dinkumware.com/vc_fixes.html for detail.
98  typedef std::pair<std::string,std::string> Property;
99  typedef std::vector<Property> Properties;
100 
104 
105 private:
107 };
108 
109 
114 template<class Fixture>
116 {
117 public:
118  typedef Fixture FixtureType;
119 
121  : TestSuiteBuilderContextBase( contextBase )
122  {
123  }
124 
132  {
133  return CPPUNIT_STATIC_CAST( FixtureType *,
135  }
136 };
137 
138 
140 
141 #if CPPUNIT_NEED_DLL_DECL
142 #pragma warning( pop )
143 #endif
144 
145 #endif // CPPUNIT_HELPER_TESTSUITEBUILDERCONTEXT_H
146 

Send comments to:
CppUnit Developers