test.h File
C++ header file with declarations for the µTest++ test suite. More...
Included Headers
Namespaces Index
| namespace | micro_os_plus |
|
The primary namespace for the µOS++ framework. More... | |
| namespace | micro_test_plus |
|
Primary namespace for the µTest++ testing framework. More... | |
| namespace | detail |
|
Internal implementation details for the µTest++ framework. More... | |
Classes Index
| class | runnable<Self_T> |
|
CRTP base class factoring out callable storage, rule-of-five, and run() logic shared by subtest and suite. More... | |
| class | runnable_base |
|
Non-template base for all runnable objects (suites and subtests). More... | |
| class | static_suite |
|
A test suite designed for static (namespace-scope) registration with a static_runner. More... | |
| class | subtest |
|
A named, runnable test case that lives inside a suite. More... | |
| class | suite |
|
A named, runnable test suite registered with the test runner. More... | |
| class | test_node |
|
Base class for runners and runable tests. More... | |
| class | top_suite |
|
The implicit top-level suite owned by every runner instance. More... | |
Functions Index
| void | register_static_suite (static_runner &static_runner_ref, static_suite &static_suite_ref) |
|
Registers a static suite with a static runner. More... | |
| runner & | to_runner (static_runner &static_runner_ref) noexcept |
|
Converts a static_runner reference to a runner reference. More... | |
Description
C++ header file with declarations for the µTest++ test suite.
This header provides the declarations for the test suite facilities used within the µTest++ framework. It defines the interfaces for constructing, registering, and managing test suites and their associated test cases. The core classes, test_node and suite, offer mechanisms for tracking test case execution, managing counters for successful and failed checks, and supporting automated registration and discovery of test suites.
The design ensures that test suites are non-copyable and non-movable, maintaining unique ownership and consistent state. Flexible support for callable objects enables a wide range of test suite definitions, facilitating expressive and maintainable test organisation across embedded and general C++ projects.
All definitions reside within the micro_os_plus::micro_test_plus namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.
The header files are organised within the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.
This file is intended solely for internal use within the framework and should not be included directly by user code.
Functions
register_static_suite()
|
Registers a static suite with a static runner.
This declaration allows test-inlines.h to request registration without requiring the complete static_runner type in that header.
- Parameters
-
static_runner_ref The destination static runner.
static_suite_ref The static suite to register.
Performs static-suite registration where static_runner is complete, allowing header-only template code to avoid direct dependence on runner.h include order.
Declaration at line 122 of file test.h, definition at line 93 of file runner.cpp.
Reference micro_os_plus::micro_test_plus::static_runner::register_static_suite.
Referenced by micro_os_plus::micro_test_plus::static_suite::static_suite.
to_runner()
| noexcept |
Converts a static_runner reference to a runner reference.
This declaration breaks the include-order cycle between test and runner headers. The definition is provided in a translation unit where both types are complete, so the conversion remains type-safe.
- Parameters
-
static_runner_ref The source static_runner reference.
- Returns
The same object viewed as its runner base.
Performs the static_runner to runner upcast where both types are complete, allowing headers with only forward declarations to request this conversion safely.
Declaration at line 109 of file test.h, definition at line 81 of file runner.cpp.
File Listing
The file content with the documentation metadata removed is:
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.