A test case that can be split into multiple sections.
More...
#include <Testing.h>
A test case that can be split into multiple sections.
To create a test case derive from SC::TestCase and run tests in the constructor
Example:
namespace SC
{
struct ConsoleTest;
}
{
{
using namespace SC;
char optionalConversionBuffer[512];
Console console(optionalConversionBuffer);
{
console.print(str.
view());
console.print({});
}
}
};
namespace SC
{
void runConsoleTest(
SC::TestReport& report) { ConsoleTest test(report); }
}
An read-only view over a string (to avoid including Strings library when parsing is not needed).
Definition StringSpan.h:37
◆ Execute
| Enumerator |
|---|
| Default | Test is executed if all tests are enabled or if this specific one matches –test-section.
|
| OnlyExplicit | Test is executed only if explicitly requested with –test-section.
|
◆ TestCase()
◆ recordExpectation() [1/2]
Records an expectation for a given expression.
- Parameters
-
| expression | Expression converted to string |
| status | The boolean expectation of a test |
| detailedError | A detailed error message |
- Returns
status
◆ recordExpectation() [2/2]
Records an expectation for a given expression.
- Parameters
-
| expression | Expression converted to string |
| status | A Result object, output from a test |
- Returns
false if status Result is not valid
◆ test_section()
Starts a new test section.
- Parameters
-
| sectionName | The name of the section |
| execution | Execution criteria |
- Returns
true if the test is enabled, false otherwise
◆ report
The documentation for this struct was generated from the following file: