Base class for all test objects.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.
More...
#include <Test.h>
|
struct | Filter |
| Use this filter to only run some of the registered tests. More...
|
|
Base class for all test objects.
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.
- See Also
- TestCase
-
TestSuite
Enumerator |
---|
NORMAL |
|
IGNORED |
|
DISABLED |
|
void Test::checkIsValidIndex |
( |
int |
index | ) |
const |
|
protectedvirtual |
Throws an exception if the specified index is invalid.
- Parameters
-
index | Zero base index of a child test. |
- Exceptions
-
virtual int Test::countTestCases |
( |
| ) |
const |
|
pure virtual |
virtual Test* Test::doGetChildTestAt |
( |
int |
index | ) |
const |
|
protectedpure virtual |
virtual bool Test::filter |
( |
const Filter & |
| ) |
|
|
pure virtual |
Test * Test::findTest |
( |
const std::string & |
testName | ) |
const |
|
virtual |
Finds the test with the specified name in the hierarchy.
- Parameters
-
testName | Name of the test to find. |
- Returns
- Pointer on the first test found that is named testName. Never
NULL
.
- Exceptions
-
std::invalid_argument | if no test named testName is found. |
bool Test::findTestPath |
( |
const std::string & |
testName, |
|
|
TestPath & |
testPath |
|
) |
| const |
|
virtual |
Finds the test with the specified name and its parents test.
- Parameters
-
testName | Name of the test to find. |
testPath | If the test is found, then all the tests traversed to access test are added to testPath, including this and test. |
- Returns
true
if a test with the specified name is found, false
otherwise.
bool Test::findTestPath |
( |
const Test * |
test, |
|
|
TestPath & |
testPath |
|
) |
| const |
|
virtual |
Finds the specified test and its parents test.
- Parameters
-
test | Test to find. |
testPath | If the test is found, then all the tests traversed to access test are added to testPath, including this and test. |
- Returns
true
if the specified test is found, false
otherwise.
Test * Test::getChildTestAt |
( |
int |
index | ) |
const |
|
virtual |
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.
- Parameters
-
index | Zero based index of the child test to return. |
- Returns
- Pointer on the test. Never
NULL
.
- Exceptions
-
virtual int Test::getChildTestCount |
( |
| ) |
const |
|
pure virtual |
virtual std::string Test::getName |
( |
| ) |
const |
|
pure virtual |
Type Test::getType |
( |
| ) |
const |
|
inline |
TestPath Test::resolveTestPath |
( |
const std::string & |
testPath | ) |
const |
|
virtual |
Resolved the specified test path with this test acting as 'root'.
- Parameters
-
testPath | Test path string to resolve. |
- Returns
- Resolved TestPath.
- Exceptions
-
std::invalid_argument | if testPath could not be resolved. |
- See Also
- TestPath.
unsigned long Test::ignoredCount = 0 |
|
static |
The documentation for this class was generated from the following files: