Macros for defining tests scenarios. More...
Scenarios Definitions | |
| #define | TTS_CASE(ID) |
| Introduces a new test scenario and registers it into the current test driver. | |
| #define | TTS_CASE_TPL(ID, ...) |
| Introduces a template test case and registers it into the current test driver. | |
| #define | TTS_CASE_WITH(ID, TYPES, ...) |
| Introduces a template test case providing dynamically generated data to the test code. | |
Scoped scenarios | |
| #define | TTS_WHEN(STORY) |
| Start a block of scoped environment. | |
| #define | TTS_AND_THEN(MESSAGE) |
| Add a scoped tests to current scoped environment. | |
| #define TTS_AND_THEN | ( | MESSAGE | ) |
#include <tts/test/when.hpp>
Add a scoped tests to current scoped environment.
Compared to regular local scope, whenever a scoped test is run, the data defined in the enclosing TTS_WHEN are re-initialized, thus serving as a setup/tear-down system.
| #define TTS_CASE | ( | ID | ) |
#include <tts/engine/case.hpp>
Introduces a new test scenario and registers it into the current test driver.
The code block following TTS_CASE contains user-defined code for a given test case. Test cases performing no actual tests will be reported as invalid.
| ID | A literal string describing the scenario intents. |
| #define TTS_CASE_TPL | ( | ID, | |
| ... ) |
#include <tts/engine/case.hpp>
Introduces a template test case and registers it into the current test driver.
The code block following TTS_CASE contains user-defined code for a given test case. Those tests are parametrized by a template type of your choice passed as lambda function parameters of the template type tts::type and instantiated for each type in the types list.
Such types list can be provided as:
Test cases performing no actual tests will be reported as invalid.
| ID | A literal string describing the scenario intents. |
| ... | Lists of types to generate the test case from. |
| #define TTS_CASE_WITH | ( | ID, | |
| TYPES, | |||
| ... ) |
#include <tts/engine/case.hpp>
Introduces a template test case providing dynamically generated data to the test code.
The following code block will contain tests parametrized by a template type of your choice passed as lambda function parameters and generated for each type in the types list.
Such types list can be provided as:
Test cases performing no actual tests will be reported as invalid.
| ID | A literal string describing the scenario intents. |
| TYPES | Lists of types to generate the test case from. |
| ... | Lists of generator function |
| #define TTS_WHEN | ( | STORY | ) |
#include <tts/test/when.hpp>
Start a block of scoped environment.
Code in a scoped environment can contain: