#include <icy/test.h>Test manager queue.
The [TestRunner](#testrunner) is a queue in charge of running one or many tests.
When [run()](#run-10) the [TestRunner](#testrunner) loops through each test in the list calling the test's [run()](#run-10) method.
| Return | Name | Description |
|---|---|---|
TestRunner | ||
void | add | Adds a test to the runner and prints its name to stdout. |
Test * | get const | Return a pointer to the test matching the given name, or nullptr if no matching test exists. |
void | run | Runs all registered tests sequentially, printing results to stdout. |
void | clear | Destroy and clears all managed tests. |
Test * | current const | Return the currently active Test or nullptr. |
TestList | tests const | Return the list of tests. |
ErrorMap | errors const | Return a map of tests and errors. |
bool | passed const | Return true if all tests passed. |
TestRunner()void add(Test * test)Adds a test to the runner and prints its name to stdout.
test Non-null pointer to the test; the runner takes ownership.const
Test * get(std::string_view name) constReturn a pointer to the test matching the given name, or nullptr if no matching test exists.
name Test name to search for.Matching test pointer or nullptr.
void run()Runs all registered tests sequentially, printing results to stdout.
void clear()Destroy and clears all managed tests.
const
Test * current() constReturn the currently active Test or nullptr.
const
TestList tests() constReturn the list of tests.
const
ErrorMap errors() constReturn a map of tests and errors.
const
bool passed() constReturn true if all tests passed.
| Return | Name | Description |
|---|---|---|
TestRunner & | getDefault static | Return the default [TestRunner](#testrunner) singleton, although [TestRunner](#testrunner) instances may also be initialized individually. |
static
static TestRunner & getDefault()Return the default [TestRunner](#testrunner) singleton, although [TestRunner](#testrunner) instances may also be initialized individually.
std::mutex _mutexTestList _testsTest * _current