summaryrefslogtreecommitdiff
path: root/src/cppunit/TestNamer.cpp
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-05-25 08:29:07 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-05-25 08:29:07 +0000
commitb87cde884d03091d81e4d3fa2199155e152dda80 (patch)
tree3a604be990b308ff85e2071116c4e1cc9fae74e1 /src/cppunit/TestNamer.cpp
parent5ad4640702a80078748b38ebaeda37e69dce1189 (diff)
downloadcppunit-b87cde884d03091d81e4d3fa2199155e152dda80.tar.gz
Include/cppunit/extensions/TestSuiteBuilder.
include/cppunit/extensions/TestSuiteBuilder.h: updated to use TestNamer. Removed template method addTestCallerForException() which should solve the compilation issue with Sun 5.0/6.0 compiler. * include/cppunit/extensions/HelperMacros.h: updated against TestSuiteBuilder change. Added CPPUNIT_TEST_CUSTOM and CPPUNIT_TEST_CUSTOMS to add custom tests to the fixture suite. * include/cppunit/extensions/TestNamer.h: * src/cppunit/TestNamer.cpp: added, TestNamer to name test case and fixture.
Diffstat (limited to 'src/cppunit/TestNamer.cpp')
-rw-r--r--src/cppunit/TestNamer.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/cppunit/TestNamer.cpp b/src/cppunit/TestNamer.cpp
new file mode 100644
index 0000000..b5e096c
--- /dev/null
+++ b/src/cppunit/TestNamer.cpp
@@ -0,0 +1,40 @@
+#include <cppunit/extensions/TestNamer.h>
+#include <cppunit/extensions/TypeInfoHelper.h>
+#include <string>
+
+
+namespace CppUnit
+{
+
+
+#if CPPUNIT_HAVE_RTTI
+TestNamer::TestNamer( const std::type_info &typeInfo )
+{
+ m_fixtureName = TypeInfoHelper::getClassName( typeInfo );
+}
+#endif
+
+
+TestNamer::TestNamer( const std::string &fixtureName )
+ : m_fixtureName( fixtureName )
+{
+}
+
+
+std::string
+TestNamer::getFixtureName() const
+{
+ return m_fixtureName;
+}
+
+
+std::string
+TestNamer::getTestNameFor( const std::string &testMethodName ) const
+{
+ return getFixtureName() + "::" + testMethodName;
+}
+
+
+
+
+} // namespace CppUnit