The TestSuite holds a group of tests.
More...
#include <robottestingframework/TestSuite.h>
|
virtual bool | setup () |
| setup is called before the test run More...
|
|
virtual void | tearDown () |
| tearDown is called after the test run More...
|
|
void | setName (std::string name) |
| setName setting the test name More...
|
|
The TestSuite holds a group of tests.
When the run()
method of a TestSuite is called, it executes all its tests. A TestSuite can also has a FixtureManager. In this case, it calls the setup()
method of FixtureManager to setup any fixture which is required for the tests before executing the tests. After running all the tests, the tearDown()
method of the FixtureManager is called to tear down the fixture.
The fixtureCollapsed
method is used by a fixture manager to inform the test suite that the corresponding fixture has been collapsed. In this case, an exception is thrown by the TestSuite and the remaining tests will not be executed any more. This method can be also overriden by a subclass if any specific action is required to be taken (such as retrying to setup the fixture and runing the reamining tests) upon collapsing the fixture.
Here's an example of using a TestSuite:
#include <cstdio>
{
public:
MyTest1() :
{
}
{
}
};
{
public:
MyTest2() :
{
}
{
}
};
int main(int argc, char** argv)
{
MyTest1 test1;
MyTest2 test2;
suite.addTest(&test1);
suite.addTest(&test2);
}
- Examples:
- simple_collector.cpp, simple_fixture.cpp, simple_suite.cpp, and simple_web.cpp.
Definition at line 52 of file TestSuite.h.
◆ FixtureContainer
◆ FixtureIterator
◆ FixtureRIterator
◆ TestContainer
◆ TestIterator
◆ TestSuite()
robottestingframework::TestSuite::TestSuite |
( |
std::string |
name | ) |
|
◆ ~TestSuite()
virtual robottestingframework::TestSuite::~TestSuite |
( |
| ) |
|
|
virtual |
◆ addFixtureManager()
void robottestingframework::TestSuite::addFixtureManager |
( |
FixtureManager * |
manager | ) |
|
addFixtureManager add a fixture manager for the current test suite.
- Parameters
-
- Examples:
- simple_fixture.cpp.
◆ addTest()
void robottestingframework::TestSuite::addTest |
( |
Test * |
test | ) |
|
◆ fixtureCollapsed()
void robottestingframework::TestSuite::fixtureCollapsed |
( |
TestMessage |
reason | ) |
|
|
overridevirtual |
fixtureCollapsed is called by a fixture manager (if it is already setup) to inform the test suite that the corresponding fixture has been collapsed.
- Parameters
-
reason | An error message indicates the reason for collapsing the fixture. |
Implements robottestingframework::FixtureEvents.
◆ getResult()
TestResult* robottestingframework::TestSuite::getResult |
( |
| ) |
|
◆ interrupt()
void robottestingframework::TestSuite::interrupt |
( |
| ) |
|
|
overridevirtual |
◆ removeTest()
void robottestingframework::TestSuite::removeTest |
( |
Test * |
test | ) |
|
Remove a test.
- Parameters
-
test | pointer to a Test object |
◆ reset()
void robottestingframework::TestSuite::reset |
( |
| ) |
|
◆ run()
void robottestingframework::TestSuite::run |
( |
TestResult & |
rsl | ) |
|
|
overridevirtual |
◆ setup()
virtual bool robottestingframework::TestSuite::setup |
( |
| ) |
|
|
protectedvirtual |
setup is called before the test run
- Returns
- true or false depending of the test initialization
◆ size()
std::size_t robottestingframework::TestSuite::size |
( |
| ) |
const |
returns the number of tests in this suite
- Returns
- the number of tests in this suite
◆ succeeded()
bool robottestingframework::TestSuite::succeeded |
( |
| ) |
const |
|
overridevirtual |
◆ tearDown()
virtual void robottestingframework::TestSuite::tearDown |
( |
| ) |
|
|
protectedvirtual |
tearDown is called after the test run
◆ current
Test* robottestingframework::TestSuite::current |
|
private |
◆ fixtureManagers
◆ fixtureMessage
TestMessage robottestingframework::TestSuite::fixtureMessage |
|
private |
◆ fixtureOK
bool robottestingframework::TestSuite::fixtureOK |
|
private |
◆ interrupted
bool robottestingframework::TestSuite::interrupted |
|
private |
◆ result
TestResult* robottestingframework::TestSuite::result |
|
private |
◆ successful
bool robottestingframework::TestSuite::successful |
|
private |
◆ tests
The documentation for this class was generated from the following file:
- src/robottestingframework/include/robottestingframework/TestSuite.h