The micro_test_plus
Namespace Reference
Primary namespace for the µTest++ testing framework. More...
Definition
namespace micro_os_plus::micro_test_plus { ... }
Namespaces Index
namespace | micro_os_plus::micro_test_plus::detail |
Internal implementation details for the µTest++ framework. More... | |
namespace | micro_os_plus::micro_test_plus::literals |
User-defined literals and type wrappers for the µTest++ testing framework. More... | |
namespace | micro_os_plus::micro_test_plus::math |
Mathematical utilities for the µTest++ testing framework. More... | |
namespace | micro_os_plus::micro_test_plus::operators |
Custom operator overloads for expressive and type-safe test assertions. More... | |
namespace | micro_os_plus::micro_test_plus::reflection |
Reflection utilities for the µTest++ testing framework. More... | |
namespace | micro_os_plus::micro_test_plus::type_traits |
Type trait utilities and metaprogramming support for the µTest++ testing framework. More... | |
namespace | micro_os_plus::micro_test_plus::utility |
Utility functions for the µTest++ testing framework. More... | |
Classes Index
struct | _t<T> |
Deprecated generic strongly-typed wrapper for explicit type conversion. More... | |
struct | colors |
Colours used to highlight pass and fail results in test reports. More... | |
class | test_reporter |
Reporter to display test results, including operand values and types for failures. More... | |
class | test_runner |
The test runner for the µTest++ framework. More... | |
class | test_suite |
Represents a named group of test cases that self-register to the runner. More... | |
class | test_suite_base |
Base class for all test suites. More... | |
struct | to_t<T> |
Generic strongly-typed wrapper for explicit type conversion. More... | |
Typedefs Index
typedef | verbosity verbosity_t |
Type alias for the verbosity enumeration used in test reporting. More... | |
Enumerations Index
enum class | : { ... } |
The verbosity levels for test reporting. More... | |
Functions Index
template <class Lhs_T, class Rhs_T> | |
constexpr auto | _and (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic logical and operation. More... | |
template <class Expr_T> | |
constexpr auto | _not (const Expr_T &expr) |
Generic logical not operation. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | _or (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic logical or operation. More... | |
template < ... > | |
constexpr auto | assume (const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current()) |
Check a condition and, if false, abort test execution. More... | |
test_reporter & | endl (test_reporter &stream) |
Output stream manipulator for ending a line in test reports. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | eq (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic equality comparator for non-pointer types. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | eq (Lhs_T *lhs, Rhs_T *rhs) |
Pointer equality comparator for any pointer types. More... | |
int | exit_code (void) |
Complete the test run and return the exit code. More... | |
template < ... > | |
constexpr auto | expect (const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current()) |
Evaluate a generic condition and report the results. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | ge (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic greater than or equal comparator. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | ge (Lhs_T *lhs, Rhs_T *rhs) |
Pointer greater than or equal comparator. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | gt (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic greater than comparator. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | gt (Lhs_T *lhs, Rhs_T *rhs) |
Pointer greater than comparator. More... | |
void | initialize (int argc, char *argv[], const char *name="Main") |
Initialise the µTest++ framework. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | le (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic less than or equal comparator. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | le (Lhs_T *lhs, Rhs_T *rhs) |
Pointer less than or equal comparator. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | lt (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic less than comparator. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | lt (Lhs_T *lhs, Rhs_T *rhs) |
Pointer less than comparator. More... | |
template <class T> | |
constexpr T & | mut (const T &t) noexcept |
Generic mutator to remove const qualification from any type. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | ne (const Lhs_T &lhs, const Rhs_T &rhs) |
Generic non-equality comparator. More... | |
template <class Lhs_T, class Rhs_T> | |
constexpr auto | ne (Lhs_T *lhs, Rhs_T *rhs) |
Pointer non-equality comparator. More... | |
template <class Callable_T> | |
constexpr auto | nothrow (const Callable_T &func) |
Check if a callable does not throw an exception. More... | |
template <typename Callable_T, typename... Args_T> | |
void | test_case (const char *name, Callable_T &&callable, Args_T &&... arguments) |
Define and execute a test case. More... | |
template <class Exception_T, class Callable_T> | |
constexpr auto | throws (const Callable_T &func) |
Check if a callable throws a specific exception. More... | |
template <class Callable_T> | |
constexpr auto | throws (const Callable_T &func) |
Check if a callable throws an exception (any exception). More... | |
Variables Index
test_suite_base * | current_test_suite |
Global pointer references the currently active test suite. More... | |
test_reporter | reporter |
Global instance of | |
test_runner | runner |
Global instance of | |
Deprecated Type Wrappers Index
using | _b = type_traits::value< bool > |
Strongly-typed wrapper for | |
using | _c = type_traits::value< char > |
Strongly-typed wrapper for | |
using | _d = type_traits::value< double > |
Strongly-typed wrapper for | |
using | _f = type_traits::value< float > |
Strongly-typed wrapper for | |
using | _i = type_traits::value< int > |
Strongly-typed wrapper for | |
using | _i16 = type_traits::value< std::int16_t > |
Strongly-typed wrapper for | |
using | _i32 = type_traits::value< std::int32_t > |
Strongly-typed wrapper for | |
using | _i64 = type_traits::value< std::int64_t > |
Strongly-typed wrapper for | |
using | _i8 = type_traits::value< std::int8_t > |
Strongly-typed wrapper for | |
using | _l = type_traits::value< long > |
Strongly-typed wrapper for | |
using | _ld = type_traits::value< long double > |
Strongly-typed wrapper for | |
using | _ll = type_traits::value< long long > |
Strongly-typed wrapper for | |
using | _s = type_traits::value< short > |
Strongly-typed wrapper for | |
using | _sc = type_traits::value< signed char > |
Strongly-typed wrapper for | |
using | _u = type_traits::value< unsigned > |
Strongly-typed wrapper for | |
using | _u16 = type_traits::value< std::uint16_t > |
Strongly-typed wrapper for | |
using | _u32 = type_traits::value< std::uint32_t > |
Strongly-typed wrapper for | |
using | _u64 = type_traits::value< std::uint64_t > |
Strongly-typed wrapper for | |
using | _u8 = type_traits::value< std::uint8_t > |
Strongly-typed wrapper for | |
using | _uc = type_traits::value< unsigned char > |
Strongly-typed wrapper for | |
using | _ul = type_traits::value< unsigned long > |
Strongly-typed wrapper for | |
using | _ull = type_traits::value< unsigned long long > |
Strongly-typed wrapper for | |
using | _us = type_traits::value< unsigned short > |
Strongly-typed wrapper for | |
Type Wrappers Index
using | to_b = type_traits::value< bool > |
Strongly-typed wrapper for | |
using | to_c = type_traits::value< char > |
Strongly-typed wrapper for | |
using | to_d = type_traits::value< double > |
Strongly-typed wrapper for | |
using | to_f = type_traits::value< float > |
Strongly-typed wrapper for | |
using | to_i = type_traits::value< int > |
Strongly-typed wrapper for | |
using | to_i16 = type_traits::value< std::int16_t > |
Strongly-typed wrapper for | |
using | to_i32 = type_traits::value< std::int32_t > |
Strongly-typed wrapper for | |
using | to_i64 = type_traits::value< std::int64_t > |
Strongly-typed wrapper for | |
using | to_i8 = type_traits::value< std::int8_t > |
Strongly-typed wrapper for | |
using | to_l = type_traits::value< long > |
Strongly-typed wrapper for | |
using | to_ld = type_traits::value< long double > |
Strongly-typed wrapper for | |
using | to_ll = type_traits::value< long long > |
Strongly-typed wrapper for | |
using | to_s = type_traits::value< short > |
Strongly-typed wrapper for | |
using | to_sc = type_traits::value< signed char > |
Strongly-typed wrapper for | |
using | to_u = type_traits::value< unsigned > |
Strongly-typed wrapper for | |
using | to_u16 = type_traits::value< std::uint16_t > |
Strongly-typed wrapper for | |
using | to_u32 = type_traits::value< std::uint32_t > |
Strongly-typed wrapper for | |
using | to_u64 = type_traits::value< std::uint64_t > |
Strongly-typed wrapper for | |
using | to_u8 = type_traits::value< std::uint8_t > |
Strongly-typed wrapper for | |
using | to_uc = type_traits::value< unsigned char > |
Strongly-typed wrapper for | |
using | to_ul = type_traits::value< unsigned long > |
Strongly-typed wrapper for | |
using | to_ull = type_traits::value< unsigned long long > |
Strongly-typed wrapper for | |
using | to_us = type_traits::value< unsigned short > |
Strongly-typed wrapper for | |
Description
Primary namespace for the µTest++ testing framework.
The micro_os_plus::micro_test_plus
namespace encapsulates all core components, types, and utilities of the µTest++ testing framework, providing a dedicated scope for its public API.
This namespace is structured into several nested namespaces, each responsible for a specific aspect of the framework, such as mathematical utilities, type traits, literals, test suite and test case management, test runners, test reporters, internal details, operators, and utility functions.
By grouping all definitions within this namespace and its sub-namespaces, the framework achieves clear code organisation, minimises naming conflicts, and enhances maintainability. This modular structure supports robust, scalable, and professional test development for both embedded and general C++ projects.
All public API definitions are implemented in the include/micro-os-plus
folder, ensuring a clear separation from user code and facilitating straightforward integration with the wider µOS++ ecosystem.
Typedefs
verbosity_t
|
Type alias for the verbosity enumeration used in test reporting.
The verbosity_t
type alias provides a convenient shorthand for referring to the verbosity
enumeration, which defines the available levels of detail for test output within the reporting system.
Using this alias improves code readability and consistency throughout the framework, especially when specifying or configuring verbosity levels for test reporters.
Definition at line 148 of file test-reporter.h.
Enumerations
enum class
| strong |
The verbosity levels for test reporting.
The verbosity
enumeration defines the available levels of detail for test output produced by the reporting system. These levels control the amount and type of information displayed during test execution, allowing users to tailor the output to their specific requirements.
Selecting an appropriate verbosity level enhances the usability of test reports, whether for concise summaries or comprehensive diagnostics.
Definition at line 127 of file test-reporter.h.
Functions
endl()
|
Output stream manipulator for ending a line in test reports.
- Parameters
stream Reference to the test_reporter
instance.
- Returns
Reference to the same
test_reporter
instance, enabling chaining of output operations.
The endl
function inserts a newline character into the specified test_reporter
stream and flushes its output buffer. This operation ensures that each test output line is clearly separated and immediately visible, facilitating the readability and clarity of test results across all test cases and folders within the µTest++ framework.
Definition at line 73 of file test-reporter.cpp.
Variables
current_test_suite
|
Global pointer references the currently active test suite.
This global pointer references the currently active test suite within the µTest++ framework. It is used to track and update the state of the test suite during test execution, including recording test results and statistics. By maintaining a pointer to the current test suite, the framework ensures accurate association of test outcomes with their respective suites, supporting clear and organised reporting across all test cases and folders.
Definition at line 306 of file micro-test-plus.cpp.
reporter
|
Global instance of test_reporter
.
This global instance of test_reporter
is responsible for collecting, formatting, and outputting the results of test execution within the µTest++ framework. It manages the reporting of test outcomes, including successes and failures, and ensures that all relevant information is presented clearly to the user. By maintaining a single shared reporter, the framework provides consistent and centralised reporting across all test cases and folders.
Definition at line 292 of file micro-test-plus.cpp.
runner
|
Global instance of test_runner
.
This global instance of test_runner
manages the lifecycle of test suites and test cases within the µTest++ framework. It is responsible for initialising the test environment, registering test suites, executing tests, and collecting results. By maintaining a single shared runner, the framework ensures consistent test execution and reporting across all test cases and folders.
Declaration at line 278 of file micro-test-plus.cpp, definition at line 74 of file test-suite-inlines.h.
The documentation for this namespace was generated from the following files:
Generated via docusaurus-plugin-doxygen by Doxygen 1.14.0.