CppUnit - The Unit Testing Library

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
42 CPPUNIT_NS_BEGIN
43
44
50 class CPPUNIT_API TestNamer
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
86 CPPUNIT_NS_END
87
88 #endif // CPPUNIT_EXTENSIONS_TESTNAMER_H
89
Portability.h
CPPUNIT_NS_END
#define CPPUNIT_NS_END
Definition: Portability.h:120
CPPUNIT_NS_BEGIN
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:119
TestNamer::m_fixtureName
std::string m_fixtureName
Definition: TestNamer.h:82
TestNamer
Names a test or a fixture suite.
Definition: TestNamer.h:50
CPPUNIT_API
#define CPPUNIT_API
Definition: CppUnitApi.h:27

| Send comments to: CppUnit Developers