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
5#include <string>
7
8#include <typeinfo>
9
10
11
28# define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType ) \
29 CPPUNIT_NS::TestNamer variableName( typeid(FixtureType) )
30
32
39{
40public:
44 TestNamer( const std::type_info &typeInfo );
45
49 TestNamer( const std::string &fixtureName );
50
51 virtual ~TestNamer();
52
56 virtual std::string getFixtureName() const;
57
65 virtual std::string getTestNameFor( const std::string &testMethodName ) const;
66
67 template<typename E>
68 std::string getTestNameFor( const std::string& testMethodName, const E& val) const
69 {
70 return getTestNameFor(testMethodName) + " with parameter: " + CPPUNIT_NS::StringHelper::toString(val);
71 }
72
73protected:
74 std::string m_fixtureName;
75};
76
78
79#endif // CPPUNIT_EXTENSIONS_TESTNAMER_H
80
#define CPPUNIT_API
Definition CppUnitApi.h:27
#define CPPUNIT_NS_END
Definition Portability.h:106
#define CPPUNIT_NS_BEGIN
Definition Portability.h:105
Names a test or a fixture suite.
Definition TestNamer.h:39
std::string m_fixtureName
Definition TestNamer.h:74
std::string getTestNameFor(const std::string &testMethodName, const E &val) const
Definition TestNamer.h:68

Send comments to:
CppUnit Developers