Skip to main content

micro-test-plus.h File

Main C++ header with the declarations for the µTest++ Testing Framework. More...

Included Headers

Namespaces Index

namespacemicro_test_plus

Primary namespace for the µTest++ testing framework. 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.

File Listing

The file content with the documentation metadata removed is:

1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2021-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can be
9 * obtained from https://opensource.org/licenses/mit.
10 *
11 * Major parts of the code are inspired from v1.1.8 of the Boost UT project,
12 * released under the terms of the Boost Version 1 Software License,
13 * which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
14 */
15
16// ----------------------------------------------------------------------------
17
52
53#ifndef MICRO_TEST_PLUS_MICRO_TEST_PLUS_H_
54#define MICRO_TEST_PLUS_MICRO_TEST_PLUS_H_
55
56// ----------------------------------------------------------------------------
57
58#ifdef __cplusplus
59
60// ----------------------------------------------------------------------------
61
62#if defined(__cplusplus)
63#if !(__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L))
64#error "C++20 or higher is required"
65#endif
66#endif // defined(__cplusplus)
67
68#if __has_include(<micro-os-plus/project-config.h>)
69#include <micro-os-plus/project-config.h>
70#elif __has_include(<micro-os-plus/config.h>)
71#pragma message \
72 "micro-os-plus/config.h is deprecated, rename to micro-os-plus/project-config.h and include it instead of micro-os-plus/config.h"
73#include <micro-os-plus/config.h>
74#endif // __has_include(<micro-os-plus/project-config.h>)
75
76#if __has_include(<micro-os-plus/micro-test-plus-defines.h>)
77#include <micro-os-plus/micro-test-plus-defines.h>
78#endif // __has_include(<micro-os-plus/micro-test-plus-defines.h>)
79
80// No deps.
82
83// Requires math.h.
85
86// No deps.
88
89// Requires type-traits.h, reflection.h.
91
92// Requires type-traits.h, math.h.
94
95// No deps.
97
98// No deps.
100
101// Requires type-traits.h + detail.h,
103
104// Requires type-traits.h, detail.h + reflection.h.
106
107// Requires type-traits.h, detail.h, expression-formatter.h, reflection.h.
109
110// Requires type-traits.h, reflection.h, expression-formatter.h.
112
113// No deps.
115
116// Requires reporter.h, reflection.h.
118
119// Requires reporter.h, reflection.h.
121
122// No deps.
124
125// Requires reporter.h, runner-totals.h, reflection.h, type-traits.h and
126// timings.h + deferred-reporter.h, reporter.h.
128
129// Requires timings.h, test.h (detail::test_node, top_suite), reflection.h.
131
132// ----------------------------------------------------------------------------
133
158
159// ----------------------------------------------------------------------------
160
161#endif // __cplusplus
162
163// ----------------------------------------------------------------------------
164
165#endif // MICRO_TEST_PLUS_MICRO_TEST_PLUS_H_
166
167// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.