2 #include <cppunit/Test.h>
3 #include <cppunit/TestResult.h>
10 BTestSuite::BTestSuite( string name
)
17 BTestSuite::~BTestSuite() {
22 // Deletes all tests in the suite.
25 BTestSuite::deleteContents() {
26 for ( map
<string
, CppUnit::Test
*>::iterator it
= fTests
.begin();
34 /// Runs the tests and collects their result in a TestResult.
37 BTestSuite::run( CppUnit::TestResult
*result
) {
38 for ( map
<string
, CppUnit::Test
*>::iterator it
= fTests
.begin();
42 if ( result
->shouldStop() )
45 Test
*test
= it
->second
;
51 // Counts the number of test cases that will be run by this test.
54 BTestSuite::countTestCases() const {
57 for ( map
<string
, CppUnit::Test
*>::const_iterator it
= fTests
.begin();
60 count
+= it
->second
->countTestCases();
66 // Adds a test to the suite.
69 BTestSuite::addTest(string name
, CppUnit::Test
*test
) {
74 // Returns a string representation of the test suite.
77 BTestSuite::toString() const {
78 return "suite " + getName();
82 // Returns the name of the test suite.
85 BTestSuite::getName() const {
91 const map
<string
, CppUnit::Test
*> &
92 BTestSuite::getTests() const {