Skip to main content

micro-test-plus.h File

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

Included Headers​

Macro Definitions Index​

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED

Enables the deprecated definitions of the µTest++ Testing Framework. More...

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED

Enables the µTest++ Testing Framework. More...

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED

Enables the trace messages of the µTest++ constructors and destructors. More...

#defineMICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED

Enables the trace messages of the µTest++ member functions. More...

Description​

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

This header is the entry point of the µTest++ testing framework, 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 and requirements, function comparators, logical functions, exception verification, and utility functions.

The header also includes all the other headers of the framework.

All public API definitions reside within the micro_os_plus::micro_test_plus namespace and its nested namespaces.

This file is located in the top-level include/micro-os-plus folder; all the other header files are in the include/micro-os-plus/micro-test-plus folder.

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
12// ----------------------------------------------------------------------------
13
44
45#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_H_
46#define MICRO_OS_PLUS_MICRO_TEST_PLUS_H_
47
48// ----------------------------------------------------------------------------
49
50#if defined(__cplusplus)
51
52// ----------------------------------------------------------------------------
53
54#if defined(__cplusplus)
55#if !(__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L))
56#error "C++20 or higher is required"
57#endif // C++20 check
58#endif // defined(__cplusplus)
59
60#if __has_include("micro-os-plus/project-config.h")
61#include "micro-os-plus/project-config.h"
62#endif // __has_include("micro-os-plus/project-config.h")
63
64#if __has_include("micro-os-plus/micro-test-plus-defines.h")
65#include "micro-os-plus/micro-test-plus-defines.h"
66#endif // __has_include("micro-os-plus/micro-test-plus-defines.h")
67
68// ----------------------------------------------------------------------------
69
70#if defined(__DOXYGEN__)
71// Present here solely for Doxygen, to document the macros.
72#define MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED
73#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_ENABLED
74#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED
75#define MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED
76#endif // defined(__DOXYGEN__)
77
78// ----------------------------------------------------------------------------
79
80#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
81
82// ----------------------------------------------------------------------------
83
84// No deps.
86
87// No deps.
89
90// No deps.
92
93// Requires extension.h, reflection.h.
95
96// No deps.
98
99// No deps.
101
102// Requires extension.h, detail.h + reflection.h.
104
105// No deps.
107
108// Requires extension.h, detail.h, expression-formatter.h, reflection.h,
109// runner-options.h.
111
112// Requires extension.h, reflection.h, expression-formatter.h.
114
115// No deps.
117
118// Requires reporter.h, reflection.h.
120
121// Requires reporter.h, reflection.h.
123
124// No deps.
126
127// Requires reporter.h, counters.h, reflection.h, extension.h and
128// stopwatch.h + check-result.h, reporter.h.
130
131// Requires stopwatch.h, test.h (top_suite), counters.h, reflection.h,
132// runner-options.h.
134
135// Requires counters.h, extension.h, function-comparators.h, math.h,
136// reflection.h, runner.h, stopwatch.h, test.h.
138
139// Defined in detail.h for the library formats only; the templates above
140// have already been parsed, so keep it out of the application code.
141#undef MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
142
143// ----------------------------------------------------------------------------
144
145#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_ENABLED)
146
147// ----------------------------------------------------------------------------
148
149#endif // defined(__cplusplus)
150
151// ----------------------------------------------------------------------------
152
153#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_H_
154
155// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.