Collects multiple TestCase and reports their results.
More...
#include <Testing.h>
|
| | TestReport (IOutput &console, int argc, const char **argv) |
| | Build from a console and executable arguments.
|
| |
| int | getTestReturnCode () const |
| | Gets return code for this process.
|
| |
| bool | hasStartupFailure () const |
| | Returns true when startup path resolution failed before tests ran.
|
| |
| uint16_t | mapPort (uint16_t basePort) const |
| | Applies an optional port offset configured through command line or environment.
|
| |
| bool | isTestExplicitlySelected (StringSpan testName) const |
| | Returns true only when --test explicitly matches testName.
|
| |
|
template<typename Statistics > |
| void | runGlobalMemoryReport (Statistics stats, bool reportFailure=true) |
| |
Collects multiple TestCase and reports their results.
This is passed as argument to SC::TestCase derived classes, and contains handle to globals like a console, paths to the library and application root, path to executable etc.
◆ TestReport()
| SC::TestReport::TestReport |
( |
IOutput & | console, |
|
|
int | argc, |
|
|
const char ** | argv ) |
Build from a console and executable arguments.
- Parameters
-
| console | A Console object where to print test results |
| argc | Number of command line arguments |
| argv | Command line arguments Arguments |
◆ getTestReturnCode()
| int SC::TestReport::getTestReturnCode |
( |
| ) |
const |
|
nodiscard |
Gets return code for this process.
- Returns
-1 if tests are failed, 0 if tests are successful
◆ hasStartupFailure()
| bool SC::TestReport::hasStartupFailure |
( |
| ) |
const |
|
inlinenodiscard |
Returns true when startup path resolution failed before tests ran.
◆ isTestExplicitlySelected()
| bool SC::TestReport::isTestExplicitlySelected |
( |
StringSpan | testName | ) |
const |
|
nodiscard |
Returns true only when --test explicitly matches testName.
- Parameters
-
| testName | Name of test case to evaluate |
◆ mapPort()
| uint16_t SC::TestReport::mapPort |
( |
uint16_t | basePort | ) |
const |
|
nodiscard |
Applies an optional port offset configured through command line or environment.
- Parameters
-
| basePort | The default test port |
- Returns
- The mapped port (basePort + portOffset if representable as uint16_t)
◆ abortOnFirstFailedTest
| bool SC::TestReport::abortOnFirstFailedTest = true |
If true will abort after first failed test.
◆ applicationRootDirectory
| StringPath SC::TestReport::applicationRootDirectory |
Path to application (on macOS is different from executable path)
◆ debugBreakOnFailedTest
| bool SC::TestReport::debugBreakOnFailedTest = true |
If true will issue a debugger halt when a test fails.
◆ executableFile
| StringPath SC::TestReport::executableFile |
Path to current executable.
◆ libraryRootDirectory
| StringPath SC::TestReport::libraryRootDirectory |
Path to sources directory for library.
◆ quietMode
| bool SC::TestReport::quietMode = false |
If true will not print recaps at start or end of the test.
◆ runAllTests
| bool SC::TestReport::runAllTests = false |
If true will run optional/slow tests that are skipped by default.
The documentation for this struct was generated from the following file: