@micro-os-plus/micro-test-plus 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/CMakeLists.txt +74 -24
- package/README.md +3 -2
- package/include/micro-os-plus/micro-test-plus/README.md +6 -0
- package/include/micro-os-plus/micro-test-plus/deferred-reporter.h +29 -54
- package/include/micro-os-plus/micro-test-plus/detail.h +166 -705
- package/include/micro-os-plus/micro-test-plus/exceptions.h +5 -6
- package/include/micro-os-plus/micro-test-plus/expression-formatter.h +669 -0
- package/include/micro-os-plus/micro-test-plus/function-comparators.h +5 -0
- package/include/micro-os-plus/micro-test-plus/inlines/deferred-reporter-inlines.h +25 -30
- package/include/micro-os-plus/micro-test-plus/inlines/detail-inlines.h +711 -0
- package/include/micro-os-plus/micro-test-plus/inlines/exceptions-inline.h +137 -0
- package/include/micro-os-plus/micro-test-plus/inlines/expression-formatter-inlines.h +510 -0
- package/include/micro-os-plus/micro-test-plus/inlines/function-comparators-inlines.h +17 -76
- package/include/micro-os-plus/micro-test-plus/inlines/literals-inlines.h +47 -25
- package/include/micro-os-plus/micro-test-plus/inlines/math-inlines.h +7 -7
- package/include/micro-os-plus/micro-test-plus/inlines/operators-inlines.h +275 -0
- package/include/micro-os-plus/micro-test-plus/inlines/reflection-inlines.h +4 -4
- package/include/micro-os-plus/micro-test-plus/inlines/reporter-inlines.h +53 -394
- package/include/micro-os-plus/micro-test-plus/inlines/runner-inlines.h +38 -0
- package/include/micro-os-plus/micro-test-plus/inlines/runner-totals-inlines.h +152 -0
- package/include/micro-os-plus/micro-test-plus/inlines/test-inlines.h +231 -45
- package/include/micro-os-plus/micro-test-plus/inlines/timings-inlines.h +120 -0
- package/include/micro-os-plus/micro-test-plus/inlines/type-traits-inlines.h +202 -0
- package/include/micro-os-plus/micro-test-plus/literals.h +8 -14
- package/include/micro-os-plus/micro-test-plus/math.h +5 -0
- package/include/micro-os-plus/micro-test-plus/operators.h +19 -169
- package/include/micro-os-plus/micro-test-plus/reflection.h +5 -12
- package/include/micro-os-plus/micro-test-plus/reporter-human.h +17 -11
- package/include/micro-os-plus/micro-test-plus/reporter-tap.h +14 -8
- package/include/micro-os-plus/micro-test-plus/reporter.h +101 -424
- package/include/micro-os-plus/micro-test-plus/runner-totals.h +162 -176
- package/include/micro-os-plus/micro-test-plus/runner.h +61 -42
- package/include/micro-os-plus/micro-test-plus/test.h +450 -506
- package/include/micro-os-plus/micro-test-plus/timings.h +259 -262
- package/include/micro-os-plus/micro-test-plus/type-traits.h +30 -52
- package/include/micro-os-plus/micro-test-plus/utility.h +5 -4
- package/include/micro-os-plus/micro-test-plus.h +33 -24
- package/meson.build +1 -0
- package/package.json +11 -3
- package/src/deferred-reporter.cpp +21 -2
- package/src/expression-formatter.cpp +289 -0
- package/src/reflection.cpp +3 -1
- package/src/reporter-human.cpp +31 -37
- package/src/reporter-tap.cpp +25 -35
- package/src/reporter.cpp +36 -231
- package/src/runner-totals.cpp +6 -3
- package/src/runner.cpp +131 -25
- package/src/test.cpp +120 -113
- package/src/timings.cpp +6 -5
- package/src/utility.cpp +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,8 +6,103 @@ Please check
|
|
|
6
6
|
[GitHub](https://github.com/micro-os-plus/micro-test-plus-xpack/issues/)
|
|
7
7
|
and close existing issues and pull requests.
|
|
8
8
|
|
|
9
|
+
## 2026-05-12
|
|
10
|
+
|
|
11
|
+
* v4.1.1 published on npmjs.com
|
|
12
|
+
* v4.1.1 prepared
|
|
13
|
+
* 2442265 Revert "fix clang16 linux build"
|
|
14
|
+
* dac3a9e fix clang16 linux build
|
|
15
|
+
|
|
16
|
+
## 2026-05-11
|
|
17
|
+
|
|
18
|
+
* d070711 fix clang16 linux build
|
|
19
|
+
* 1817181 website update
|
|
20
|
+
* 3c10916 website posts fixes
|
|
21
|
+
* bb42b96 website: blog post release 4.1.0 published
|
|
22
|
+
* a836b29 4.1.0
|
|
23
|
+
* 45b61e6 CHANGELOG: publish npm v4.1.0
|
|
24
|
+
* v4.1.0 published on npmjs.com
|
|
25
|
+
* 353d2a1 CmakeLists.txt add CXX
|
|
26
|
+
* 68c840b CMake cosmetics in comments
|
|
27
|
+
* 6ba1ac4 CMakeLists.txt duplicate fix
|
|
28
|
+
* 4ea4a84 website doxygen update
|
|
29
|
+
* 5810287 prepare v4.1.0
|
|
30
|
+
* 496bf98 re-generate website commons
|
|
31
|
+
* 4f3a2b9 use local cmake-format & reformat
|
|
32
|
+
|
|
33
|
+
## 2026-05-10
|
|
34
|
+
|
|
35
|
+
* fe8d5ac use local clang-format & reformat
|
|
36
|
+
* 9239eca #31: move the top default suite name to initialise()
|
|
37
|
+
* 478a667 website/package*.json update
|
|
38
|
+
* d69a6be re-generate website commons
|
|
39
|
+
* 7e0d3f9 config.doxyfile: add EXCLUDE_PATTERNS
|
|
40
|
+
* 86596a2 update .dox files to remove repetitions
|
|
41
|
+
* dded41a copilot-instructions.md update
|
|
42
|
+
* fbe0cd9 detail.h: add @details
|
|
43
|
+
|
|
44
|
+
## 2026-05-09
|
|
45
|
+
|
|
46
|
+
* 597515f website update
|
|
47
|
+
* 88dd73c detail::indent_t
|
|
48
|
+
* a835441 doxygen update
|
|
49
|
+
* a903306 cleanups for includes
|
|
50
|
+
* 8a6ab9f cmake: disable coverage
|
|
51
|
+
* d4216c5 #28: fix circular dependency
|
|
52
|
+
* 8004f37 #28: more includes reworks
|
|
53
|
+
|
|
54
|
+
## 2026-05-08
|
|
55
|
+
|
|
56
|
+
* 5b55e3f #28: more inlines fixed, only test-inlines.h remaining
|
|
57
|
+
* 9dd8012 fix illegal character
|
|
58
|
+
* 26675c5 #30: Move internal classes to details namespace
|
|
59
|
+
* cbf8e4c extract exceptions-inline.h
|
|
60
|
+
* fbca56c remove nodiscard from definitions
|
|
61
|
+
* 4ed019a #29: Extract expression formatting code from reporter
|
|
62
|
+
* 9b1369d Merge branch 'xpack-development' of https://github.com/micro-os-plus/micro-test-plus-xpack into xpack-development
|
|
63
|
+
* 4ef8a04 #29: Extract expression formatting code from reporter
|
|
64
|
+
* c9bf9b1 #29: Extract expression formatting code from reporter
|
|
65
|
+
|
|
66
|
+
## 2026-05-07
|
|
67
|
+
|
|
68
|
+
* d25e887 #28: Re-organise inlines
|
|
69
|
+
|
|
70
|
+
## 2026-05-06
|
|
71
|
+
|
|
72
|
+
* 5c2c832 tests: use add_compile_common_private_options
|
|
73
|
+
* 404fdd2 test-inlines.h: silence warning
|
|
74
|
+
* ee30572 re-generate commons
|
|
75
|
+
* ab9c415 re-generate top commons
|
|
76
|
+
* e8f23ee #27: Split definitions from declarations
|
|
77
|
+
* f6aaa8a tests: use add_compile_common_private_options
|
|
78
|
+
|
|
79
|
+
## 2026-05-04
|
|
80
|
+
|
|
81
|
+
* 536e327 website update
|
|
82
|
+
|
|
83
|
+
## 2026-04-30
|
|
84
|
+
|
|
85
|
+
* aca5767 platforms/native: remove -stdlib=libc++ from non clang
|
|
86
|
+
* 0cef14e more guards & guard cosmetics
|
|
87
|
+
* e15b6d7 guard include diag/trace.h
|
|
88
|
+
* 0ad8f72 tests: include platform.h
|
|
89
|
+
* 8775c7f website user update
|
|
90
|
+
* 953cc21 includes: add guard to prevent direct includes
|
|
91
|
+
|
|
9
92
|
## 2026-04-29
|
|
10
93
|
|
|
94
|
+
* 8f330f5 re-generate tests commons
|
|
95
|
+
* 7c3b63d fix again blog autoformat
|
|
96
|
+
* e2ddd82 website updates
|
|
97
|
+
* f9a1b1a website: update last blog posts
|
|
98
|
+
* 730a42c website: add link to TAP
|
|
99
|
+
* 08aeb97 website: fix blog posts code block
|
|
100
|
+
* 88273bf .vscode/settings.json: do not reformat mdx
|
|
101
|
+
* 88107e3 re-generate website commons
|
|
102
|
+
* 14309a9 website: blog post release 4.0.0 published
|
|
103
|
+
* 07f01d3 blog posts cosmetics
|
|
104
|
+
* 6e72885 4.0.0
|
|
105
|
+
* cfd4b34 CHANGELOG: publish npm v4.0.0
|
|
11
106
|
* v4.0.0 published on npmjs.com
|
|
12
107
|
* 1105af3 re-format
|
|
13
108
|
* ac64933 CHANGELOG update for v4.0.0
|
package/CMakeLists.txt
CHANGED
|
@@ -24,7 +24,11 @@
|
|
|
24
24
|
# https://cmake.org/cmake/help/v3.20/
|
|
25
25
|
cmake_minimum_required (VERSION 3.20)
|
|
26
26
|
|
|
27
|
-
project (
|
|
27
|
+
project (
|
|
28
|
+
micro-os-plus-micro-test-plus
|
|
29
|
+
DESCRIPTION "µTest++"
|
|
30
|
+
LANGUAGES CXX
|
|
31
|
+
)
|
|
28
32
|
|
|
29
33
|
# To access the optional functions, include the
|
|
30
34
|
# `cmake/micro-os-plus-build-helper.cmake` file from the
|
|
@@ -41,11 +45,14 @@ endif ()
|
|
|
41
45
|
|
|
42
46
|
# -----------------------------------------------------------------------------
|
|
43
47
|
|
|
44
|
-
# The
|
|
48
|
+
# The interface library is the main target of this package, which consumers
|
|
49
|
+
# (like embedded applications) link against. It defines the public API and
|
|
50
|
+
# properties of the library, and compiles the sources that are part of the
|
|
51
|
+
# public API.
|
|
45
52
|
|
|
46
53
|
# https://cmake.org/cmake/help/v3.20/command/add_library.html?highlight=interface#normal-libraries
|
|
47
|
-
#
|
|
48
|
-
#
|
|
54
|
+
# Visibility keywords: PRIVATE applies to the target itself; INTERFACE passes
|
|
55
|
+
# properties up to targets that link against it; PUBLIC does both.
|
|
49
56
|
add_library (micro-os-plus-micro-test-plus-interface INTERFACE)
|
|
50
57
|
|
|
51
58
|
target_include_directories (
|
|
@@ -57,6 +64,7 @@ target_sources (
|
|
|
57
64
|
INTERFACE "src/runner.cpp"
|
|
58
65
|
"src/runner-totals.cpp"
|
|
59
66
|
"src/deferred-reporter.cpp"
|
|
67
|
+
"src/expression-formatter.cpp"
|
|
60
68
|
"src/reporter.cpp"
|
|
61
69
|
"src/reporter-human.cpp"
|
|
62
70
|
"src/reporter-tap.cpp"
|
|
@@ -66,13 +74,9 @@ target_sources (
|
|
|
66
74
|
"src/utility.cpp"
|
|
67
75
|
)
|
|
68
76
|
|
|
69
|
-
target_compile_definitions (
|
|
70
|
-
micro-os-plus-micro-test-plus-interface INTERFACE # None.
|
|
71
|
-
)
|
|
77
|
+
target_compile_definitions (micro-os-plus-micro-test-plus-interface INTERFACE)
|
|
72
78
|
|
|
73
|
-
target_compile_options (
|
|
74
|
-
micro-os-plus-micro-test-plus-interface INTERFACE # None.
|
|
75
|
-
)
|
|
79
|
+
target_compile_options (micro-os-plus-micro-test-plus-interface INTERFACE)
|
|
76
80
|
|
|
77
81
|
target_link_libraries (
|
|
78
82
|
micro-os-plus-micro-test-plus-interface INTERFACE micro-os-plus::diag-trace
|
|
@@ -84,37 +88,83 @@ endif ()
|
|
|
84
88
|
|
|
85
89
|
# -----------------------------------------------------------------------------
|
|
86
90
|
|
|
87
|
-
# Optional OBJECT library:
|
|
88
|
-
#
|
|
89
|
-
#
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
#
|
|
91
|
+
# Optional OBJECT library: compiles the library sources once and shares the
|
|
92
|
+
# resulting object files across all test executables, rather than recompiling
|
|
93
|
+
# them per consumer.
|
|
94
|
+
#
|
|
95
|
+
# Include directories are managed explicitly instead of using PRIVATE linkage to
|
|
96
|
+
# the interface library. PRIVATE linkage would cause diag-trace's
|
|
97
|
+
# INTERFACE_SOURCES (trace.cpp) to be compiled into this OBJECT library via
|
|
98
|
+
# transitive propagation, which conflicts with the separate diag-trace
|
|
99
|
+
# compilation in each test executable. Consumers of this OBJECT library are
|
|
100
|
+
# expected to link separately to micro-os-plus::diag-trace and to the
|
|
101
|
+
# platform-specific trace backend.
|
|
93
102
|
add_library (micro-os-plus-micro-test-plus-objects OBJECT)
|
|
94
103
|
|
|
95
|
-
|
|
104
|
+
get_property (
|
|
96
105
|
micro-os-plus-micro-test-plus-includes
|
|
97
|
-
micro-os-plus-micro-test-plus-interface
|
|
106
|
+
TARGET micro-os-plus-micro-test-plus-interface
|
|
107
|
+
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
|
98
108
|
)
|
|
109
|
+
# Use PUBLIC so that the include directories are available both for the OBJECT
|
|
110
|
+
# library's own sources and for consumers of the library.
|
|
99
111
|
target_include_directories (
|
|
100
112
|
micro-os-plus-micro-test-plus-objects
|
|
101
|
-
|
|
113
|
+
PUBLIC ${micro-os-plus-micro-test-plus-includes}
|
|
102
114
|
)
|
|
103
115
|
|
|
104
|
-
|
|
105
|
-
micro-os-plus-micro-test-plus-sources
|
|
106
|
-
|
|
116
|
+
get_property (
|
|
117
|
+
micro-os-plus-micro-test-plus-sources
|
|
118
|
+
TARGET micro-os-plus-micro-test-plus-interface
|
|
119
|
+
PROPERTY INTERFACE_SOURCES
|
|
107
120
|
)
|
|
121
|
+
# Use PRIVATE to avoid propagating the sources to consumers of the OBJECT
|
|
122
|
+
# library, which would cause duplicate symbol errors at link time.
|
|
108
123
|
target_sources (
|
|
109
124
|
micro-os-plus-micro-test-plus-objects
|
|
110
125
|
PRIVATE ${micro-os-plus-micro-test-plus-sources}
|
|
111
126
|
)
|
|
112
127
|
|
|
113
|
-
|
|
128
|
+
get_property (
|
|
129
|
+
micro-os-plus-micro-test-plus-compile-definitions
|
|
130
|
+
TARGET micro-os-plus-micro-test-plus-interface
|
|
131
|
+
PROPERTY INTERFACE_COMPILE_DEFINITIONS
|
|
132
|
+
)
|
|
133
|
+
# Use PRIVATE to avoid propagating compile definitions to consumers of the
|
|
134
|
+
# OBJECT library.
|
|
135
|
+
target_compile_definitions (
|
|
114
136
|
micro-os-plus-micro-test-plus-objects
|
|
115
|
-
PRIVATE micro-os-plus-micro-test-plus-
|
|
137
|
+
PRIVATE ${micro-os-plus-micro-test-plus-compile-definitions}
|
|
116
138
|
)
|
|
117
139
|
|
|
140
|
+
get_property (
|
|
141
|
+
micro-os-plus-micro-test-plus-compile-options
|
|
142
|
+
TARGET micro-os-plus-micro-test-plus-interface
|
|
143
|
+
PROPERTY INTERFACE_COMPILE_OPTIONS
|
|
144
|
+
)
|
|
145
|
+
# Use PRIVATE to avoid propagating the compile options to consumers of the
|
|
146
|
+
# OBJECT library, which may cause conflicts with consumer-specific compile
|
|
147
|
+
# options.
|
|
148
|
+
target_compile_options (
|
|
149
|
+
micro-os-plus-micro-test-plus-objects
|
|
150
|
+
PRIVATE ${micro-os-plus-micro-test-plus-compile-options}
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
# Add the diag-trace include path in Debug without linking the diag-trace
|
|
154
|
+
# target: linking it would add trace.cpp as an INTERFACE_SOURCE and compile it
|
|
155
|
+
# into the OBJECT library, causing duplicate symbols at link time.
|
|
156
|
+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
157
|
+
get_property (
|
|
158
|
+
micro-os-plus-diag-trace-includes
|
|
159
|
+
TARGET micro-os-plus::diag-trace
|
|
160
|
+
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
|
161
|
+
)
|
|
162
|
+
target_include_directories (
|
|
163
|
+
micro-os-plus-micro-test-plus-objects
|
|
164
|
+
PRIVATE ${micro-os-plus-diag-trace-includes}
|
|
165
|
+
)
|
|
166
|
+
endif ()
|
|
167
|
+
|
|
118
168
|
if (COMMAND xpack_display_target_lists)
|
|
119
169
|
xpack_display_target_lists (micro-os-plus-micro-test-plus-objects)
|
|
120
170
|
endif ()
|
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@ For information on how to install and use this project, please refer to the
|
|
|
15
15
|
## Project source
|
|
16
16
|
|
|
17
17
|
The source code of the current release is available on
|
|
18
|
-
|
|
18
|
+
GitHub as [micro-os-plus/micro-test-plus-xpack](https://github.com/micro-os-plus/micro-test-plus-xpack),
|
|
19
|
+
the [v4.1.1](https://github.com/micro-os-plus/micro-test-plus-xpack/tree/v4.1.1) tree.
|
|
19
20
|
|
|
20
21
|
## License
|
|
21
22
|
|
|
@@ -25,4 +26,4 @@ with all rights reserved to
|
|
|
25
26
|
[Liviu Ionescu](https://github.com/ilg-ul).
|
|
26
27
|
|
|
27
28
|
The code from Boost UT is released under the terms of the
|
|
28
|
-
[Boost Version 1.0
|
|
29
|
+
[Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt).
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
#include <cstdio>
|
|
53
53
|
#include <string>
|
|
54
54
|
|
|
55
|
+
#include "type-traits.h"
|
|
56
|
+
#include "reflection.h"
|
|
57
|
+
#include "expression-formatter.h"
|
|
58
|
+
|
|
55
59
|
// ----------------------------------------------------------------------------
|
|
56
60
|
|
|
57
61
|
#if defined(__GNUC__)
|
|
@@ -71,33 +75,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
71
75
|
|
|
72
76
|
// --------------------------------------------------------------------------
|
|
73
77
|
|
|
74
|
-
/**
|
|
75
|
-
* @namespace micro_os_plus::micro_test_plus::detail
|
|
76
|
-
* @brief Internal implementation details for the µTest++ framework.
|
|
77
|
-
*
|
|
78
|
-
* @details
|
|
79
|
-
* The `detail` namespace encapsulates the internal mechanisms, helper
|
|
80
|
-
* structures, and implementation utilities employed by the µTest++ testing
|
|
81
|
-
* framework. These components do not form part of the public API and may be
|
|
82
|
-
* modified without prior notice.
|
|
83
|
-
*
|
|
84
|
-
* Within this namespace, one will find assertion handling, generic getter
|
|
85
|
-
* utilities, comparator structures for logical and relational operations,
|
|
86
|
-
* mechanisms for exception checking, and base classes for deferred reporting
|
|
87
|
-
* of test results.
|
|
88
|
-
*
|
|
89
|
-
* All definitions within `detail` are intended exclusively for internal use,
|
|
90
|
-
* ensuring a clear distinction between user-facing and internal components.
|
|
91
|
-
* This approach enhances maintainability, mitigates the risk of naming
|
|
92
|
-
* conflicts, and keeps the public API succinct.
|
|
93
|
-
*
|
|
94
|
-
* The relevant header files are organised within the `include/micro-os-plus`
|
|
95
|
-
* folder to maintain a structured and modular codebase.
|
|
96
|
-
*/
|
|
97
78
|
namespace detail
|
|
98
79
|
{
|
|
99
|
-
|
|
100
|
-
// ------------------------------------------------------------------------
|
|
80
|
+
// ========================================================================
|
|
101
81
|
|
|
102
82
|
/**
|
|
103
83
|
* @brief Base class for a deferred reporter that collects messages into a
|
|
@@ -145,13 +125,15 @@ namespace micro_os_plus::micro_test_plus
|
|
|
145
125
|
* @brief Deleted copy assignment operator to prevent copying.
|
|
146
126
|
*/
|
|
147
127
|
deferred_reporter_base&
|
|
148
|
-
operator= (const deferred_reporter_base&)
|
|
128
|
+
operator= (const deferred_reporter_base&)
|
|
129
|
+
= delete;
|
|
149
130
|
|
|
150
131
|
/**
|
|
151
132
|
* @brief Deleted move assignment operator to prevent moving.
|
|
152
133
|
*/
|
|
153
134
|
deferred_reporter_base&
|
|
154
|
-
operator= (deferred_reporter_base&&)
|
|
135
|
+
operator= (deferred_reporter_base&&)
|
|
136
|
+
= delete;
|
|
155
137
|
|
|
156
138
|
/**
|
|
157
139
|
* @brief Destructor for the deferred reporter base.
|
|
@@ -174,20 +156,13 @@ namespace micro_os_plus::micro_test_plus
|
|
|
174
156
|
/**
|
|
175
157
|
* @brief Retrieves the result value.
|
|
176
158
|
*
|
|
177
|
-
*
|
|
178
159
|
* @par Parameters
|
|
179
160
|
* None.
|
|
180
161
|
* @retval true The reported condition was met.
|
|
181
162
|
* @retval false The reported condition was not met.
|
|
182
|
-
*
|
|
183
|
-
* @details
|
|
184
|
-
* Returns the result value associated with the report.
|
|
185
163
|
*/
|
|
186
164
|
[[nodiscard]] bool
|
|
187
|
-
value () const
|
|
188
|
-
{
|
|
189
|
-
return value_;
|
|
190
|
-
}
|
|
165
|
+
value () const;
|
|
191
166
|
|
|
192
167
|
protected:
|
|
193
168
|
/**
|
|
@@ -201,6 +176,11 @@ namespace micro_os_plus::micro_test_plus
|
|
|
201
176
|
*/
|
|
202
177
|
bool abort_ = false;
|
|
203
178
|
|
|
179
|
+
/**
|
|
180
|
+
* @brief Indicates whether the reporter has an associated expression.
|
|
181
|
+
*/
|
|
182
|
+
bool has_expression_ = false;
|
|
183
|
+
|
|
204
184
|
/**
|
|
205
185
|
* @brief Stores the source location associated with the report.
|
|
206
186
|
*/
|
|
@@ -218,19 +198,17 @@ namespace micro_os_plus::micro_test_plus
|
|
|
218
198
|
subtest& subtest_;
|
|
219
199
|
};
|
|
220
200
|
|
|
221
|
-
//
|
|
201
|
+
// ========================================================================
|
|
222
202
|
|
|
223
203
|
/**
|
|
224
|
-
* @brief Deferred reporter class
|
|
225
|
-
*
|
|
226
|
-
* @tparam Expr_T The type of the expression being reported.
|
|
204
|
+
* @brief Deferred reporter class for a specific expression.
|
|
227
205
|
*
|
|
228
206
|
* @details
|
|
229
|
-
* The `deferred_reporter` class
|
|
207
|
+
* The `deferred_reporter` class extends `deferred_reporter_base`
|
|
230
208
|
* to provide deferred reporting functionality for a specific test
|
|
231
209
|
* expression within the framework.
|
|
232
210
|
*
|
|
233
|
-
* This class
|
|
211
|
+
* This class is responsible for capturing the expression under
|
|
234
212
|
* evaluation, the abort status, and the source location. It is intended
|
|
235
213
|
* exclusively for internal use and is implemented in the
|
|
236
214
|
* `include/micro-os-plus/micro-test-plus` folder to ensure a structured
|
|
@@ -238,7 +216,6 @@ namespace micro_os_plus::micro_test_plus
|
|
|
238
216
|
*
|
|
239
217
|
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
240
218
|
*/
|
|
241
|
-
template <class Expr_T>
|
|
242
219
|
class deferred_reporter : public deferred_reporter_base
|
|
243
220
|
{
|
|
244
221
|
public:
|
|
@@ -250,25 +227,18 @@ namespace micro_os_plus::micro_test_plus
|
|
|
250
227
|
* processing.
|
|
251
228
|
* @param location The source location relevant to the report.
|
|
252
229
|
* @param subtest The subtest that owns this deferred report.
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
* Initialises the reporter with the given expression, abort status, and
|
|
256
|
-
* source location.
|
|
230
|
+
* @param expression The expression formatter to format the expression
|
|
231
|
+
* text.
|
|
257
232
|
*/
|
|
233
|
+
template <class Expr_T>
|
|
258
234
|
deferred_reporter (const Expr_T& expr, bool abort,
|
|
259
235
|
const reflection::source_location& location,
|
|
260
|
-
subtest& subtest);
|
|
236
|
+
subtest& subtest, expression_formatter& expression);
|
|
261
237
|
|
|
262
238
|
/**
|
|
263
239
|
* @brief Destructor for the deferred reporter.
|
|
264
240
|
*/
|
|
265
|
-
~deferred_reporter ();
|
|
266
|
-
|
|
267
|
-
protected:
|
|
268
|
-
/**
|
|
269
|
-
* @brief Stores the expression under evaluation.
|
|
270
|
-
*/
|
|
271
|
-
const Expr_T expr_{};
|
|
241
|
+
~deferred_reporter () = default;
|
|
272
242
|
};
|
|
273
243
|
|
|
274
244
|
// ------------------------------------------------------------------------
|
|
@@ -285,6 +255,11 @@ namespace micro_os_plus::micro_test_plus
|
|
|
285
255
|
|
|
286
256
|
#endif // __cplusplus
|
|
287
257
|
|
|
258
|
+
// ============================================================================
|
|
259
|
+
// Templates & constexpr implementations.
|
|
260
|
+
|
|
261
|
+
#include "inlines/deferred-reporter-inlines.h"
|
|
262
|
+
|
|
288
263
|
// ----------------------------------------------------------------------------
|
|
289
264
|
|
|
290
265
|
#endif // MICRO_TEST_PLUS_DEFERRED_REPORTER_H_
|