TestGroup Class Referenceabstract
Class to simplify generation of begin/end messages for a test group. More...
#include <TestGroup.h>
Inheritance diagram for TestGroup:
Collaboration diagram for TestGroup:
Public Types | |
| enum | State { State::running, State::pending, State::complete, State::failed } |
Public Member Functions | |
| TestGroup (const String &name) | |
| void | commenceTest () |
| virtual void | execute ()=0 |
| Implement this method to define the test. More... | |
| void | startItem (const String &tag, const String &description=nullptr) |
| Note the start of a test item within a group. More... | |
| void | fail (const char *func) override |
| Called when test fails to identify location. More... | |
| const String & | getName () |
| NanoTime::Time< uint32_t > | elapsedTime () const |
| State | getState () const |
| void | initialiseAndExecute () |
| Called by test runner. More... | |
Public Member Functions inherited from TestBase | |
| virtual | ~TestBase () |
| virtual bool | testVerify (bool res, const TestParam ¶m) |
| Print result of a test. More... | |
| bool | test_verify (bool res, const char *expr, const String &value1, const String &value2, bool verbose) |
| template<typename V > | |
| std::enable_if< std::is_arithmetic< V >::value, bool >::type | test_verify (bool res, const char *expr, const V &value1, const V &value2, bool verbose) |
| template<typename V > | |
| std::enable_if<!std::is_same< V, String >::value &&!std::is_arithmetic< V >::value, bool >::type | test_verify (bool res, const char *expr, const V &value1, const V &value2, bool verbose) |
Protected Member Functions | |
| void | pending () |
Call to mark test as pending so it will be executed asynchronously Call complete() when test is finished. More... | |
| void | complete () |
| Call to complete pending (asynchronous) test. More... | |
Detailed Description
Class to simplify generation of begin/end messages for a test group.
Member Enumeration Documentation
◆ State
|
strong |
Constructor & Destructor Documentation
◆ TestGroup()
|
inline |
Member Function Documentation
◆ commenceTest()
| void TestGroup::commenceTest | ( | ) |
◆ complete()
|
protected |
Call to complete pending (asynchronous) test.
◆ elapsedTime()
|
inline |
◆ execute()
|
pure virtual |
Implement this method to define the test.
- Note
- If tests are asynchronous, call
pending()before returning and callcomplete()when the group has completed execution (e.g. via timer callback, etc.)
◆ fail()
|
overridevirtual |
Called when test fails to identify location.
Reimplemented from TestBase.
◆ getName()
|
inline |
◆ getState()
|
inline |
◆ initialiseAndExecute()
| void TestGroup::initialiseAndExecute | ( | ) |
Called by test runner.
◆ pending()
|
inlineprotected |
Call to mark test as pending so it will be executed asynchronously Call complete() when test is finished.
◆ startItem()
Note the start of a test item within a group.
The documentation for this class was generated from the following file:
Public Member Functions inherited from
1.8.17