CppUnit project page | FAQ | CppUnit home page |
#include <Test.h>
Inheritance diagram for Test:
Public Member Functions | |
virtual | ~Test () |
virtual void | run (TestResult *result)=0 |
Run the test, collecting results. | |
virtual int | countTestCases () const =0 |
Return the number of test cases invoked by run(). | |
virtual int | getChildTestCount () const =0 |
Returns the number of direct child of the test. | |
virtual Test * | getChildTestAt (int index) const |
Returns the child test of the specified index. | |
virtual std::string | getName () const =0 |
Returns the test name. | |
virtual bool | findTestPath (const std::string &testName, TestPath &testPath) const |
Finds the test with the specified name and its parents test. | |
virtual bool | findTestPath (const Test *test, TestPath &testPath) const |
Finds the specified test and its parents test. | |
virtual Test * | findTest (const std::string &testName) const |
Finds the test with the specified name in the hierarchy. | |
virtual TestPath | resolveTestPath (const std::string &testPath) const |
Resolved the specified test path with this test acting as 'root'. | |
Protected Member Functions | |
virtual void | checkIsValidIndex (int index) const |
virtual Test * | doGetChildTestAt (int index) const =0 |
Returns the child test of the specified valid index. |
All test objects should be a subclass of Test. Some test objects, TestCase for example, represent one individual test. Other test objects, such as TestSuite, are comprised of several tests.
When a Test is run, the result is collected by a TestResult object.
|
|
|
Throws an exception if the specified index is invalid.
|
|
Return the number of test cases invoked by run(). The base unit of testing is the class TestCase. This method returns the number of TestCase objects invoked by the run() method. Implemented in RepeatedTest, TestDecorator, TestComposite, and TestLeaf. |
|
Returns the child test of the specified valid index.
Implemented in TestDecorator, TestLeaf, TestRunner::WrappingSuite, and TestSuite. |
|
Finds the test with the specified name in the hierarchy.
|
|
Finds the specified test and its parents test.
|
|
Finds the test with the specified name and its parents test.
|
|
Returns the child test of the specified index. This method test if the index is valid, then call doGetChildTestAt() if the index is valid. Otherwise std::out_of_range exception is thrown. You should override doGetChildTestAt() method.
|
|
Returns the number of direct child of the test.
Implemented in TestDecorator, TestLeaf, TestRunner::WrappingSuite, and TestSuite. |
|
Returns the test name. Each test has a name. This name may be used to find the test in a suite or registry of tests. Implemented in TestCaseDecorator, TestDecorator, TestCase, TestComposite, and TestRunner::WrappingSuite. |
|
Resolved the specified test path with this test acting as 'root'.
|
|
Run the test, collecting results.
Implemented in RepeatedTest, TestDecorator, TestSetUp, TestCase, TestComposite, and TestRunner::WrappingSuite. |
hosts this site. |
Send comments to: CppUnit Developers |