RobotTestingFramework
2.0.1
Robot Testing Framework
|
The TestResultCollector class can be used to store all the events issued by the test cases, suites and runner during the test run. More...
#include <robottestingframework/TestResultCollector.h>
Public Types | |
typedef std::vector< ResultEvent * > | EventResultContainer |
typedef std::vector< ResultEvent * >::iterator | EventResultIterator |
Public Member Functions | |
TestResultCollector () | |
TestResultCollector constructor. More... | |
~TestResultCollector () override | |
TestResultCollector destructor. More... | |
void | reset () |
reset clear the results More... | |
unsigned int | testCount () |
testCount gets the number of test cases. More... | |
unsigned int | failedCount () |
failedCount gets the number of failed test cases. More... | |
unsigned int | passedCount () |
passedCount gets the number of passed test cases. More... | |
unsigned int | suiteCount () |
suiteCount gets the number of test suites. More... | |
unsigned int | failedSuiteCount () |
failedCount gets the number of failed test suites. More... | |
unsigned int | passedSuiteCount () |
passedCount gets the number of passed test suites. More... | |
EventResultContainer & | getResults () |
getResults return any result event caught by the TestResultCollector. More... | |
void | addReport (const Test *test, TestMessage msg) override |
This is called to report any arbitrary message from tests. More... | |
void | addError (const Test *test, TestMessage msg) override |
This is called when an error occurred during test run. More... | |
void | addFailure (const Test *test, TestMessage msg) override |
This is called when a failure occurred during test run. More... | |
void | startTest (const Test *test) override |
This is called when a Test is started. More... | |
void | endTest (const Test *test) override |
This is called when a Test is finished. More... | |
void | startTestSuite (const Test *test) override |
This is called when a TestSuite is started. More... | |
void | endTestSuite (const Test *test) override |
This is called when a TestSuite is finished. More... | |
![]() | |
TestListener ()=default | |
TestListener constructor. More... | |
virtual | ~TestListener ()=default |
TestListener destructor. More... | |
virtual void | startTestRunner () |
This is called when the TestRunner is started. More... | |
virtual void | endTestRunner () |
This is called when the TestRunner is finished. More... | |
Private Attributes | |
EventResultContainer | events |
unsigned int | nTests |
unsigned int | nFailures |
unsigned int | nPasses |
unsigned int | nTestSuites |
unsigned int | nSuiteFailures |
unsigned int | nSuitePasses |
The TestResultCollector class can be used to store all the events issued by the test cases, suites and runner during the test run.
The collected events later can be used by a proper result formatter to be exported as HTML, XML or other desired formats.
Here's an example of using a TestResultCollector:
Definition at line 43 of file TestResultCollector.h.
typedef std::vector<ResultEvent*> robottestingframework::TestResultCollector::EventResultContainer |
Definition at line 46 of file TestResultCollector.h.
typedef std::vector<ResultEvent*>::iterator robottestingframework::TestResultCollector::EventResultIterator |
Definition at line 47 of file TestResultCollector.h.
robottestingframework::TestResultCollector::TestResultCollector | ( | ) |
TestResultCollector constructor.
|
override |
TestResultCollector destructor.
|
overridevirtual |
This is called when an error occurred during test run.
test | pointer to the corresponding test |
msg | correspoinding error message |
Reimplemented from robottestingframework::TestListener.
|
overridevirtual |
This is called when a failure occurred during test run.
test | pointer to the corresponding test |
msg | correspoinding failure message |
Reimplemented from robottestingframework::TestListener.
|
overridevirtual |
This is called to report any arbitrary message from tests.
test | pointer to the corresponding test |
msg | correspoinding error message |
Reimplemented from robottestingframework::TestListener.
|
overridevirtual |
This is called when a Test is finished.
test | pointer to the corresponding test |
Reimplemented from robottestingframework::TestListener.
|
overridevirtual |
This is called when a TestSuite is finished.
test | pointer to the corresponding test |
Reimplemented from robottestingframework::TestListener.
unsigned int robottestingframework::TestResultCollector::failedCount | ( | ) |
failedCount gets the number of failed test cases.
The test suites are not counted.
unsigned int robottestingframework::TestResultCollector::failedSuiteCount | ( | ) |
failedCount gets the number of failed test suites.
EventResultContainer& robottestingframework::TestResultCollector::getResults | ( | ) |
getResults return any result event caught by the TestResultCollector.
The events are stored in the ResultEvent format which can be type casted to any subtype event such as ResultEventReport, ResultEventError and etc. to indicate the actual type of the events.
unsigned int robottestingframework::TestResultCollector::passedCount | ( | ) |
passedCount gets the number of passed test cases.
The test suites are not counted.
unsigned int robottestingframework::TestResultCollector::passedSuiteCount | ( | ) |
passedCount gets the number of passed test suites.
void robottestingframework::TestResultCollector::reset | ( | ) |
reset clear the results
|
overridevirtual |
This is called when a Test is started.
test | pointer to the corresponding test |
Reimplemented from robottestingframework::TestListener.
|
overridevirtual |
This is called when a TestSuite is started.
test | pointer to the corresponding test |
Reimplemented from robottestingframework::TestListener.
unsigned int robottestingframework::TestResultCollector::suiteCount | ( | ) |
suiteCount gets the number of test suites.
unsigned int robottestingframework::TestResultCollector::testCount | ( | ) |
testCount gets the number of test cases.
The test suites are not counted.
|
private |
Definition at line 161 of file TestResultCollector.h.
|
private |
Definition at line 163 of file TestResultCollector.h.
|
private |
Definition at line 164 of file TestResultCollector.h.
|
private |
Definition at line 166 of file TestResultCollector.h.
|
private |
Definition at line 167 of file TestResultCollector.h.
|
private |
Definition at line 162 of file TestResultCollector.h.
|
private |
Definition at line 165 of file TestResultCollector.h.