CppUnit project page FAQ

TestNamer.h
Go to the documentation of this file.
1 #ifndef CPPUNIT_EXTENSIONS_TESTNAMER_H
2 #define CPPUNIT_EXTENSIONS_TESTNAMER_H
3 
4 #include <cppunit/Portability.h>
5 #include <string>
6 
7 #if CPPUNIT_HAVE_RTTI
8 # include <typeinfo>
9 #endif
10 
11 
12 
32 #if CPPUNIT_USE_TYPEINFO_NAME
33 # define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \
34  CPPUNIT_NS::TestNamer variableName( typeid(FixtureType) )
35 #else
36 # define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \
37  CPPUNIT_NS::TestNamer variableName( std::string(#FixtureType) )
38 #endif
39 
40 
41 
43 
44 
51 {
52 public:
53 #if CPPUNIT_HAVE_RTTI
54 
57  TestNamer( const std::type_info &typeInfo );
58 #endif
59 
63  TestNamer( const std::string &fixtureName );
64 
65  virtual ~TestNamer();
66 
70  virtual std::string getFixtureName() const;
71 
79  virtual std::string getTestNameFor( const std::string &testMethodName ) const;
80 
81 protected:
82  std::string m_fixtureName;
83 };
84 
85 
87 
88 #endif // CPPUNIT_EXTENSIONS_TESTNAMER_H
89 

Send comments to:
CppUnit Developers