summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-01 08:48:42 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-01 09:24:28 (GMT)
commit2812bddd81f8a1b804c7460f4e14cd0aa393d129 (patch)
treed46294f35150c4f0f43deaf2d31fceaf945ae715 /3rdParty/CppUnit/src/TestComposite.cpp
downloadswift-contrib-2812bddd81f8a1b804c7460f4e14cd0aa393d129.zip
swift-contrib-2812bddd81f8a1b804c7460f4e14cd0aa393d129.tar.bz2
Import.
Diffstat (limited to '3rdParty/CppUnit/src/TestComposite.cpp')
-rw-r--r--3rdParty/CppUnit/src/TestComposite.cpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/3rdParty/CppUnit/src/TestComposite.cpp b/3rdParty/CppUnit/src/TestComposite.cpp
new file mode 100644
index 0000000..4768791
--- /dev/null
+++ b/3rdParty/CppUnit/src/TestComposite.cpp
@@ -0,0 +1,77 @@
+#include <cppunit/TestComposite.h>
+#include <cppunit/TestResult.h>
+
+
+CPPUNIT_NS_BEGIN
+
+
+TestComposite::TestComposite( const std::string &name )
+ : m_name( name )
+{
+}
+
+
+TestComposite::~TestComposite()
+{
+}
+
+
+void
+TestComposite::run( TestResult *result )
+{
+ doStartSuite( result );
+ doRunChildTests( result );
+ doEndSuite( result );
+}
+
+
+int
+TestComposite::countTestCases() const
+{
+ int count = 0;
+
+ int childCount = getChildTestCount();
+ for ( int index =0; index < childCount; ++index )
+ count += getChildTestAt( index )->countTestCases();
+
+ return count;
+}
+
+
+std::string
+TestComposite::getName() const
+{
+ return m_name;
+}
+
+
+void
+TestComposite::doStartSuite( TestResult *controller )
+{
+ controller->startSuite( this );
+}
+
+
+void
+TestComposite::doRunChildTests( TestResult *controller )
+{
+ int childCount = getChildTestCount();
+ for ( int index =0; index < childCount; ++index )
+ {
+ if ( controller->shouldStop() )
+ break;
+
+ getChildTestAt( index )->run( controller );
+ }
+}
+
+
+void
+TestComposite::doEndSuite( TestResult *controller )
+{
+ controller->endSuite( this );
+}
+
+
+CPPUNIT_NS_END
+