CppUnit project page FAQ CppUnit home page

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 #if CPPUNIT_NEED_DLL_DECL
41 #pragma warning( push )
42 #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
43 #endif
44 
46 
47 
54 {
55 public:
56 #if CPPUNIT_HAVE_RTTI
57 
60  TestNamer( const std::type_info &typeInfo );
61 #endif
62 
66  TestNamer( const std::string &fixtureName );
67 
68  virtual ~TestNamer();
69 
73  virtual std::string getFixtureName() const;
74 
82  virtual std::string getTestNameFor( const std::string &testMethodName ) const;
83 
84 protected:
85  std::string m_fixtureName;
86 };
87 
88 
90 
91 #if CPPUNIT_NEED_DLL_DECL
92 #pragma warning( pop )
93 #endif
94 
95 #endif // CPPUNIT_EXTENSIONS_TESTNAMER_H
96 

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