summaryrefslogtreecommitdiff
path: root/src/cppunit/TestSuite.cpp
diff options
context:
space:
mode:
authorBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-29 13:09:16 +0000
committerBastiaan Bakker <bastiaan.bakker@lifeline.nl>2001-04-29 13:09:16 +0000
commitb08ecaecc1e39b7b01e02b7b73559d8b34ff46a5 (patch)
treebf1ed1e3680cb0256e73336e22fb70c692524fcb /src/cppunit/TestSuite.cpp
parent5ce1a68589aa3ea4f9ee255cfecc94cc1730c6fa (diff)
downloadcppunit-b08ecaecc1e39b7b01e02b7b73559d8b34ff46a5.tar.gz
Merged Baptiste Lepilleurs CppUnitW 1.2.
Some differences: TypeInfo stuff (in TestSuite) compiled in only if USE_TYPEINFO is set. TestSuite.getTests now returns a const ref instead of taking a ref as param. Removed auto_ptr stuff from TestFactoryRegistry: auto_ptr cannot be used in containers.
Diffstat (limited to 'src/cppunit/TestSuite.cpp')
-rw-r--r--src/cppunit/TestSuite.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cppunit/TestSuite.cpp b/src/cppunit/TestSuite.cpp
index 8fe5e65..e776cb2 100644
--- a/src/cppunit/TestSuite.cpp
+++ b/src/cppunit/TestSuite.cpp
@@ -1,5 +1,8 @@
#include "cppunit/TestSuite.h"
#include "cppunit/TestResult.h"
+#ifdef USE_TYPEINFO
+#include "TypeInfoHelper.h"
+#endif // USE_TYPEINFO
namespace CppUnit {
@@ -52,6 +55,17 @@ TestSuite::TestSuite (std::string name)
{
}
+#ifdef USE_TYPEINFO
+/** Constructs a test suite named after the specified type_info.
+ * \param info type_info used to name the suite. The 'class' prefix
+ * is stripped from the name.
+ */
+TestSuite::TestSuite(const std::type_info &info ) :
+ m_name( TypeInfoHelper::getClassName( info ) )
+{
+}
+#endif // USE_TYPEINFO
+
/// Destructor
TestSuite::~TestSuite ()
@@ -82,5 +96,11 @@ std::string
return m_name;
}
+const std::vector<Test *>&
+ TestSuite::getTests () const
+{
+ return m_tests;
+}
+
} // namespace CppUnit