CppUnit project page FAQ CppUnit home page

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TestNamer.h

Go to the documentation of this file.
00001 #ifndef CPPUNIT_EXTENSIONS_TESTNAMER_H
00002 #define CPPUNIT_EXTENSIONS_TESTNAMER_H
00003 
00004 #include <cppunit/Portability.h>
00005 #include <string>
00006 
00007 #if CPPUNIT_HAVE_RTTI
00008 #  include <typeinfo>
00009 #endif
00010 
00011 
00012 
00032 #if CPPUNIT_USE_TYPEINFO_NAME
00033 #  define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType )       \
00034               CPPUNIT_NS::TestNamer variableName( typeid(FixtureType) )
00035 #else
00036 #  define CPPUNIT_TESTNAMER_DECL( variableName, FixtureType )       \
00037               CPPUNIT_NS::TestNamer variableName( std::string(#FixtureType) )
00038 #endif
00039 
00040 
00041 
00042 CPPUNIT_NS_BEGIN
00043 
00044 
00050 class CPPUNIT_API TestNamer
00051 {
00052 public:
00053 #if CPPUNIT_HAVE_RTTI
00054 
00057   TestNamer( const std::type_info &typeInfo );
00058 #endif
00059 
00063   TestNamer( const std::string &fixtureName );
00064 
00065   virtual ~TestNamer();
00066 
00070   virtual std::string getFixtureName() const;
00071 
00079   virtual std::string getTestNameFor( const std::string &testMethodName ) const;
00080 
00081 protected:
00082   std::string m_fixtureName;
00083 };
00084 
00085 
00086 CPPUNIT_NS_END
00087 
00088 #endif // CPPUNIT_EXTENSIONS_TESTNAMER_H
00089 

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