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
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{
52public:
53#if CPPUNIT_HAVE_RTTI
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
81protected:
82 std::string m_fixtureName;
83};
84
85
87
88#endif // CPPUNIT_EXTENSIONS_TESTNAMER_H
89
#define CPPUNIT_API
Definition CppUnitApi.h:27
#define CPPUNIT_NS_END
Definition Portability.h:120
#define CPPUNIT_NS_BEGIN
Definition Portability.h:119
std::string m_fixtureName
Definition TestNamer.h:82
virtual std::string getFixtureName() const
Returns the name of the fixture.
Definition TestNamer.cpp:29
virtual std::string getTestNameFor(const std::string &testMethodName) const
Returns the name of the test for the specified method.
Definition TestNamer.cpp:36
TestNamer(const std::string &fixtureName)
Constructs a namer using the specified fixture name.
Definition TestNamer.cpp:17

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