micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro-test-plus-inlines.h File Reference

C++ header file with inline implementations for the µTest++ Testing Framework. More...

Go to the source code of this file.

Namespaces

namespace  micro_os_plus
 The primary namespace for the µOS++ framework.
namespace  micro_os_plus::micro_test_plus
 Primary namespace for the µTest++ testing framework.
namespace  micro_os_plus::micro_test_plus::utility
 Utility functions for the µTest++ testing framework.

Functions

template<class Expr_T, type_traits::requires_t< type_traits::is_op_v< Expr_T > or type_traits::is_convertible_v< Expr_T, bool > > = 0>
constexpr auto micro_os_plus::micro_test_plus::assume (const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current())
 Check a condition and, if false, abort test execution.
template<class Expr_T, type_traits::requires_t< type_traits::is_op_v< Expr_T > or type_traits::is_convertible_v< Expr_T, bool > > = 0>
constexpr auto micro_os_plus::micro_test_plus::expect (const Expr_T &expr, const reflection::source_location &sl=reflection::source_location::current())
 Evaluate a generic condition and report the results.
template<class Callable_T>
constexpr auto micro_os_plus::micro_test_plus::nothrow (const Callable_T &func)
 Check if a callable does not throw an exception.
template<class T, class Delim_T>
auto micro_os_plus::micro_test_plus::utility::split (T input, Delim_T delim) -> std::vector< T >
 Split a string into a vector of sub-strings.
template<typename Callable_T, typename... Args_T>
void micro_os_plus::micro_test_plus::test_case (const char *name, Callable_T &&callable, Args_T &&... arguments)
 Define and execute a test case.
template<class Exception_T, class Callable_T>
constexpr auto micro_os_plus::micro_test_plus::throws (const Callable_T &func)
 Check if a callable throws a specific exception.
template<class Callable_T>
constexpr auto micro_os_plus::micro_test_plus::throws (const Callable_T &func)
 Check if a callable throws an exception (any exception).

Detailed Description

This header provides the inline implementations for the principal public API functions and utilities of the µTest++ framework, including test case registration, expectation and assumption evaluation, exception verification, and utility helpers for string processing in tests.

It defines the logic for registering and executing test cases, evaluating logical conditions and custom comparators, and reporting test results with detailed diagnostics. The exception verification functions enable robust testing of error handling and exception safety, while utility functions such as string splitting support flexible validation of string processing logic.

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.

Definition in file micro-test-plus-inlines.h.