The micro-test-plus.h
File Reference
Main C++ header with the declarations for the µTest++ Testing Framework. More...
Included Headers
#include "micro-test-plus/type-traits.h"
#include "micro-test-plus/reflection.h"
#include "micro-test-plus/detail.h"
#include "micro-test-plus/math.h"
#include "micro-test-plus/literals.h"
#include "micro-test-plus/function-comparators.h"
#include "micro-test-plus/operators.h"
#include "micro-test-plus/test-suite.h"
#include "micro-test-plus/test-runner.h"
#include "micro-test-plus/test-reporter.h"
#include "micro-test-plus/inlines/details-inlines.h"
#include "micro-test-plus/inlines/literals-inlines.h"
#include "micro-test-plus/inlines/math-inlines.h"
#include "micro-test-plus/inlines/reflection-inlines.h"
#include "micro-test-plus/inlines/test-reporter-inlines.h"
#include "micro-test-plus/inlines/function-comparators-inlines.h"
#include "micro-test-plus/inlines/test-suite-inlines.h"
#include "micro-test-plus/inlines/micro-test-plus-inlines.h"
Namespaces Index
namespace | micro_os_plus |
The primary namespace for the µOS++ framework. More... | |
namespace | micro_os_plus::micro_test_plus |
Primary namespace for the µTest++ testing framework. More... | |
namespace | micro_os_plus::micro_test_plus::utility |
Utility functions for the µTest++ testing framework. 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 | |
Functions Index
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... | |
int | exit_code (void) |
Complete the test run and return the exit code. More... | |
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... | |
void | initialize (int argc, char *argv[], const char *name="Main") |
Initialise the µTest++ framework. More... | |
bool | is_match (std::string_view input, std::string_view pattern) |
Check if a string matches a pattern. More... | |
constexpr auto | nothrow (const Callable_T &func) |
Check if a callable does not throw an exception. More... | |
auto | split (T input, Delim_T delim) -> std::vector< T > |
Split a string into a vector of sub-strings. More... | |
void | test_case (const char *name, Callable_T &&callable, Args_T &&... arguments) |
Define and execute a test case. More... | |
constexpr auto | throws (const Callable_T &func) |
Check if a callable throws a specific exception. More... | |
constexpr auto | throws (const Callable_T &func) |
Check if a callable throws an exception (any exception). More... | |
Description
Main C++ header with the declarations for the µTest++ Testing Framework.
This header serves as the principal entry point for the µTest++ testing framework, purpose-built for both embedded and general C++ projects.
It provides all essential declarations required to write and manage tests, including test runner and reporter objects, test suite and test case management, expectations, assumptions, comparators, logical operators, exception verification, and utility functions.
The header also incorporates all necessary dependencies and internal headers to ensure the framework operates correctly and efficiently.
All public API definitions reside within the micro_os_plus::micro_test_plus
namespace and its nested namespaces, ensuring clear separation from user code and minimising the risk of naming conflicts.
This file is located in the top-level include/micro-os-plus
directory; all other header files are organised within the include/micro-os-plus/micro-test-plus
directory to maintain a structured and modular codebase.
To access the complete functionality of the µTest++ framework, users should include this header in their test projects.
The implementation is significantly inspired by Boost UT, with adaptations and extensions to address the requirements of embedded development and the µTest++ framework.
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.
File Listing
The file content with the documentation metadata removed is:
Generated via docusaurus-plugin-doxygen by Doxygen 1.14.0.