Suite of tests. More...
#include <testsuite.hh>

Public Member Functions | |
| void | addSuite (const TestSuite &) throw (TestSuiteError) |
| Adds a test suite to this test suite. | |
| void | addTest (TestCase *t) throw (TestSuiteError) |
| Adds a test case to the suite of tests. | |
| void | free () |
| Deletes the tests. | |
| string | getName () const |
| Returns name of test suite. | |
| long | getNumFailed () const |
| Returns number of failed tests. | |
| long | getNumPassed () const |
| Returns number of passed tests. | |
| const ostream * | getStream () const |
| Returns output stream. | |
| long | report () const |
| Prints a report on the number of passed and failed tests in the whole suite to the output stream. | |
| void | run () |
| Runs all test cases in the suite. | |
| void | setStream (ostream *osptr) |
| Sets the output stream. | |
| TestSuite (const string &name, ostream *osptr=0) | |
| Constructor. | |
Private Member Functions | |
| TestSuite & | operator= (const TestSuite &) |
| Disallowed. | |
| void | reset () |
| TestSuite (const TestSuite &) | |
| Disallowed. | |
Private Attributes | |
| string | m_name |
| ostream * | m_osptr |
| vector< TestCase * > | m_tests |
Suite of tests.
Running a group of test cases is best be done by adding each test case to a test suite. This suite does then the run and report of the whole group.
Definition at line 38 of file testsuite.hh.
| test::TestSuite::TestSuite | ( | const string & | name, |
| ostream * | osptr = 0 |
||
| ) | [inline] |
Constructor.
| name | Name of the test suite |
| osptr | Pointer to the output stream. Defaults to stdout. |
Definition at line 82 of file testsuite.hh.
| test::TestSuite::TestSuite | ( | const TestSuite & | ) | [private] |
Disallowed.
| void test::TestSuite::addSuite | ( | const TestSuite & | ) | throw (TestSuiteError) |
Adds a test suite to this test suite.
| void test::TestSuite::addTest | ( | TestCase * | t | ) | throw (TestSuiteError) |
Adds a test case to the suite of tests.
| void test::TestSuite::free | ( | ) |
Deletes the tests.
| string test::TestSuite::getName | ( | ) | const [inline] |
Returns name of test suite.
Definition at line 47 of file testsuite.hh.
| long test::TestSuite::getNumFailed | ( | ) | const |
Returns number of failed tests.
| long test::TestSuite::getNumPassed | ( | ) | const |
Returns number of passed tests.
| const ostream* test::TestSuite::getStream | ( | ) | const [inline] |
Returns output stream.
Definition at line 53 of file testsuite.hh.
| long test::TestSuite::report | ( | ) | const |
Prints a report on the number of passed and failed tests in the whole suite to the output stream.
| void test::TestSuite::reset | ( | ) | [private] |
| void test::TestSuite::run | ( | ) |
Runs all test cases in the suite.
| void test::TestSuite::setStream | ( | ostream * | osptr | ) | [inline] |
Sets the output stream.
Definition at line 55 of file testsuite.hh.
string test::TestSuite::m_name [private] |
Definition at line 71 of file testsuite.hh.
ostream* test::TestSuite::m_osptr [private] |
Definition at line 72 of file testsuite.hh.
vector<TestCase*> test::TestSuite::m_tests [private] |
Definition at line 73 of file testsuite.hh.