@micro-os-plus/micro-test-plus 3.3.1 → 4.0.0
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 +330 -2
- package/CMakeLists.txt +79 -23
- package/README.md +1 -1
- package/config/xcdl-build.json +11 -4
- package/include/micro-os-plus/micro-test-plus/deferred-reporter.h +292 -0
- package/include/micro-os-plus/micro-test-plus/detail.h +462 -1076
- package/include/micro-os-plus/micro-test-plus/exceptions.h +126 -0
- package/include/micro-os-plus/micro-test-plus/function-comparators.h +10 -7
- package/include/micro-os-plus/micro-test-plus/inlines/{details-inlines.h → deferred-reporter-inlines.h} +49 -22
- package/include/micro-os-plus/micro-test-plus/inlines/function-comparators-inlines.h +67 -4
- package/include/micro-os-plus/micro-test-plus/inlines/literals-inlines.h +3 -6
- package/include/micro-os-plus/micro-test-plus/inlines/math-inlines.h +21 -15
- package/include/micro-os-plus/micro-test-plus/inlines/reflection-inlines.h +35 -17
- package/include/micro-os-plus/micro-test-plus/inlines/{test-reporter-inlines.h → reporter-inlines.h} +176 -106
- package/include/micro-os-plus/micro-test-plus/inlines/{test-suite-inlines.h → runner-inlines.h} +41 -43
- package/include/micro-os-plus/micro-test-plus/inlines/test-inlines.h +369 -0
- package/include/micro-os-plus/micro-test-plus/inlines/utility-inlines.h +126 -0
- package/include/micro-os-plus/micro-test-plus/literals.h +4 -3
- package/include/micro-os-plus/micro-test-plus/math.h +9 -6
- package/include/micro-os-plus/micro-test-plus/operators.h +38 -44
- package/include/micro-os-plus/micro-test-plus/reflection.h +15 -4
- package/include/micro-os-plus/micro-test-plus/{test-reporter-basic.h → reporter-human.h} +72 -72
- package/include/micro-os-plus/micro-test-plus/{test-reporter-tap.h → reporter-tap.h} +69 -69
- package/include/micro-os-plus/micro-test-plus/{test-reporter.h → reporter.h} +296 -200
- package/include/micro-os-plus/micro-test-plus/runner-totals.h +264 -0
- package/include/micro-os-plus/micro-test-plus/runner.h +453 -0
- package/include/micro-os-plus/micro-test-plus/test.h +1069 -0
- package/include/micro-os-plus/micro-test-plus/timings.h +366 -0
- package/include/micro-os-plus/micro-test-plus/type-traits.h +239 -545
- package/include/micro-os-plus/micro-test-plus/utility.h +135 -0
- package/include/micro-os-plus/micro-test-plus.h +25 -228
- package/meson.build +10 -6
- package/package.json +1 -1
- package/src/deferred-reporter.cpp +118 -0
- package/src/reflection.cpp +95 -0
- package/src/reporter-human.cpp +822 -0
- package/src/reporter-tap.cpp +782 -0
- package/src/reporter.cpp +676 -0
- package/src/runner-totals.cpp +95 -0
- package/src/runner.cpp +563 -0
- package/src/test.cpp +496 -0
- package/src/timings.cpp +209 -0
- package/src/utility.cpp +163 -0
- package/.cmake-format.yaml +0 -11
- package/include/micro-os-plus/micro-test-plus/inlines/micro-test-plus-inlines.h +0 -313
- package/include/micro-os-plus/micro-test-plus/test-runner.h +0 -281
- package/include/micro-os-plus/micro-test-plus/test-suite.h +0 -492
- package/src/micro-test-plus.cpp +0 -316
- package/src/test-reporter-basic.cpp +0 -466
- package/src/test-reporter-tap.cpp +0 -530
- package/src/test-reporter.cpp +0 -399
- package/src/test-runner.cpp +0 -311
- package/src/test-suite.cpp +0 -304
|
@@ -64,10 +64,11 @@
|
|
|
64
64
|
#pragma GCC diagnostic ignored "-Waggregate-return"
|
|
65
65
|
#if defined(__clang__)
|
|
66
66
|
#pragma clang diagnostic ignored "-Wc++98-compat"
|
|
67
|
-
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
|
68
67
|
#endif
|
|
69
68
|
#endif
|
|
70
69
|
|
|
70
|
+
// ===========================================================================
|
|
71
|
+
|
|
71
72
|
namespace micro_os_plus::micro_test_plus
|
|
72
73
|
{
|
|
73
74
|
// --------------------------------------------------------------------------
|
|
@@ -155,7 +156,10 @@ namespace micro_os_plus::micro_test_plus
|
|
|
155
156
|
* @ingroup micro-test-plus-container-operators
|
|
156
157
|
* @brief Equality operator for containers.
|
|
157
158
|
*
|
|
158
|
-
* @tparam
|
|
159
|
+
* @tparam Lhs_T The left-hand container type, constrained to recognised
|
|
160
|
+
* container types.
|
|
161
|
+
* @tparam Rhs_T The right-hand container type, constrained to recognised
|
|
162
|
+
* container types.
|
|
159
163
|
*
|
|
160
164
|
* @param [in] lhs The left hand side container operand.
|
|
161
165
|
* @param [in] rhs The right hand side container operand.
|
|
@@ -171,19 +175,23 @@ namespace micro_os_plus::micro_test_plus
|
|
|
171
175
|
* The operator is enabled only for types recognised as containers by the
|
|
172
176
|
* framework's type traits.
|
|
173
177
|
*/
|
|
174
|
-
template <class
|
|
175
|
-
|
|
178
|
+
template <class Lhs_T, class Rhs_T>
|
|
179
|
+
requires (type_traits::container_like<Lhs_T>
|
|
180
|
+
and type_traits::container_like<Rhs_T>)
|
|
176
181
|
[[nodiscard]] constexpr auto
|
|
177
|
-
operator== (
|
|
182
|
+
operator== (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
178
183
|
{
|
|
179
|
-
return detail::eq_{
|
|
184
|
+
return detail::eq_{ lhs, rhs };
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
/**
|
|
183
188
|
* @ingroup micro-test-plus-container-operators
|
|
184
189
|
* @brief Non-equality operator for containers.
|
|
185
190
|
*
|
|
186
|
-
* @tparam
|
|
191
|
+
* @tparam Lhs_T The left-hand container type, constrained to recognised
|
|
192
|
+
* container types.
|
|
193
|
+
* @tparam Rhs_T The right-hand container type, constrained to recognised
|
|
194
|
+
* container types.
|
|
187
195
|
*
|
|
188
196
|
* @param [in] lhs The left hand side container operand.
|
|
189
197
|
* @param [in] rhs The right hand side container operand.
|
|
@@ -199,12 +207,13 @@ namespace micro_os_plus::micro_test_plus
|
|
|
199
207
|
* The operator is enabled only for types recognised as containers by the
|
|
200
208
|
* framework's type traits.
|
|
201
209
|
*/
|
|
202
|
-
template <class
|
|
203
|
-
|
|
210
|
+
template <class Lhs_T, class Rhs_T>
|
|
211
|
+
requires (type_traits::container_like<Lhs_T>
|
|
212
|
+
and type_traits::container_like<Rhs_T>)
|
|
204
213
|
[[nodiscard]] constexpr auto
|
|
205
|
-
operator!= (
|
|
214
|
+
operator!= (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
206
215
|
{
|
|
207
|
-
return detail::ne_{
|
|
216
|
+
return detail::ne_{ lhs, rhs };
|
|
208
217
|
}
|
|
209
218
|
|
|
210
219
|
/**
|
|
@@ -229,10 +238,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
229
238
|
* wrappers, or other custom types, ensuring type-safe and expressive test
|
|
230
239
|
* assertions.
|
|
231
240
|
*/
|
|
232
|
-
template <class Lhs_T, class Rhs_T
|
|
233
|
-
|
|
234
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
235
|
-
= 0>
|
|
241
|
+
template <class Lhs_T, class Rhs_T>
|
|
242
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
236
243
|
[[nodiscard]] constexpr auto
|
|
237
244
|
operator== (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
238
245
|
{
|
|
@@ -261,10 +268,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
261
268
|
* constants, wrappers, or other custom types, ensuring type-safe and
|
|
262
269
|
* expressive test assertions.
|
|
263
270
|
*/
|
|
264
|
-
template <class Lhs_T, class Rhs_T
|
|
265
|
-
|
|
266
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
267
|
-
= 0>
|
|
271
|
+
template <class Lhs_T, class Rhs_T>
|
|
272
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
268
273
|
[[nodiscard]] constexpr auto
|
|
269
274
|
operator!= (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
270
275
|
{
|
|
@@ -293,10 +298,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
293
298
|
* the framework's strongly-typed constants, wrappers, or other custom
|
|
294
299
|
* types, ensuring type-safe and expressive test assertions.
|
|
295
300
|
*/
|
|
296
|
-
template <class Lhs_T, class Rhs_T
|
|
297
|
-
|
|
298
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
299
|
-
= 0>
|
|
301
|
+
template <class Lhs_T, class Rhs_T>
|
|
302
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
300
303
|
[[nodiscard]] constexpr auto
|
|
301
304
|
operator> (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
302
305
|
{
|
|
@@ -326,10 +329,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
326
329
|
* wrappers, or other custom types, ensuring type-safe and expressive test
|
|
327
330
|
* assertions.
|
|
328
331
|
*/
|
|
329
|
-
template <class Lhs_T, class Rhs_T
|
|
330
|
-
|
|
331
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
332
|
-
= 0>
|
|
332
|
+
template <class Lhs_T, class Rhs_T>
|
|
333
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
333
334
|
[[nodiscard]] constexpr auto
|
|
334
335
|
operator>= (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
335
336
|
{
|
|
@@ -358,10 +359,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
358
359
|
* framework's strongly-typed constants, wrappers, or other custom types,
|
|
359
360
|
* ensuring type-safe and expressive test assertions.
|
|
360
361
|
*/
|
|
361
|
-
template <class Lhs_T, class Rhs_T
|
|
362
|
-
|
|
363
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
364
|
-
= 0>
|
|
362
|
+
template <class Lhs_T, class Rhs_T>
|
|
363
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
365
364
|
[[nodiscard]] constexpr auto
|
|
366
365
|
operator< (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
367
366
|
{
|
|
@@ -391,10 +390,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
391
390
|
* wrappers, or other custom types, ensuring type-safe and expressive test
|
|
392
391
|
* assertions.
|
|
393
392
|
*/
|
|
394
|
-
template <class Lhs_T, class Rhs_T
|
|
395
|
-
|
|
396
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
397
|
-
= 0>
|
|
393
|
+
template <class Lhs_T, class Rhs_T>
|
|
394
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
398
395
|
[[nodiscard]] constexpr auto
|
|
399
396
|
operator<= (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
400
397
|
{
|
|
@@ -423,10 +420,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
423
420
|
* strongly-typed constants, wrappers, or other custom types, ensuring
|
|
424
421
|
* type-safe and expressive test assertions.
|
|
425
422
|
*/
|
|
426
|
-
template <class Lhs_T, class Rhs_T
|
|
427
|
-
|
|
428
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
429
|
-
= 0>
|
|
423
|
+
template <class Lhs_T, class Rhs_T>
|
|
424
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
430
425
|
[[nodiscard]] constexpr auto
|
|
431
426
|
operator and (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
432
427
|
{
|
|
@@ -455,10 +450,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
455
450
|
* framework's strongly-typed constants, wrappers, or other custom types,
|
|
456
451
|
* ensuring type-safe and expressive test assertions.
|
|
457
452
|
*/
|
|
458
|
-
template <class Lhs_T, class Rhs_T
|
|
459
|
-
|
|
460
|
-
or type_traits::is_op_v<Rhs_T>>
|
|
461
|
-
= 0>
|
|
453
|
+
template <class Lhs_T, class Rhs_T>
|
|
454
|
+
requires type_traits::any_op<Lhs_T, Rhs_T>
|
|
462
455
|
[[nodiscard]] constexpr auto
|
|
463
456
|
operator or (const Lhs_T& lhs, const Rhs_T& rhs)
|
|
464
457
|
{
|
|
@@ -486,7 +479,8 @@ namespace micro_os_plus::micro_test_plus
|
|
|
486
479
|
* constants, wrappers, or other custom types, ensuring type-safe and
|
|
487
480
|
* expressive test assertions.
|
|
488
481
|
*/
|
|
489
|
-
template <class T
|
|
482
|
+
template <class T>
|
|
483
|
+
requires type_traits::is_op<T>
|
|
490
484
|
[[nodiscard]] constexpr auto
|
|
491
485
|
operator not(const T& t)
|
|
492
486
|
{
|
|
@@ -68,10 +68,11 @@
|
|
|
68
68
|
#pragma GCC diagnostic ignored "-Waggregate-return"
|
|
69
69
|
#if defined(__clang__)
|
|
70
70
|
#pragma clang diagnostic ignored "-Wc++98-compat"
|
|
71
|
-
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
|
72
71
|
#endif
|
|
73
72
|
#endif
|
|
74
73
|
|
|
74
|
+
// =============================================================================
|
|
75
|
+
|
|
75
76
|
namespace micro_os_plus::micro_test_plus
|
|
76
77
|
{
|
|
77
78
|
// --------------------------------------------------------------------------
|
|
@@ -193,11 +194,15 @@ namespace micro_os_plus::micro_test_plus
|
|
|
193
194
|
*
|
|
194
195
|
* @param name The fully qualified name as a C-string.
|
|
195
196
|
* @return A pointer to the short name within the input string.
|
|
197
|
+
*
|
|
198
|
+
* @details
|
|
199
|
+
* Searches @p name for the last `/` separator and returns a pointer to
|
|
200
|
+
* the character immediately following it, effectively stripping the
|
|
201
|
+
* folder path. If no `/` is found, the original pointer is returned
|
|
202
|
+
* unchanged.
|
|
196
203
|
*/
|
|
197
204
|
const char*
|
|
198
|
-
short_name (const char* name);
|
|
199
|
-
|
|
200
|
-
// TODO: update for the new namespaces.
|
|
205
|
+
short_name (const char* name) noexcept;
|
|
201
206
|
|
|
202
207
|
/**
|
|
203
208
|
* @brief Extract the type name from the `__PRETTY_FUNCTION__` macro.
|
|
@@ -207,6 +212,12 @@ namespace micro_os_plus::micro_test_plus
|
|
|
207
212
|
* @par Parameters
|
|
208
213
|
* None.
|
|
209
214
|
* @return A `std::string_view` containing the extracted type name.
|
|
215
|
+
*
|
|
216
|
+
* @details
|
|
217
|
+
* Constructs a `std::string_view` from `__PRETTY_FUNCTION__` and
|
|
218
|
+
* parses out the portion that represents the template argument `T`,
|
|
219
|
+
* using compiler-specific prefix and suffix markers to locate the
|
|
220
|
+
* type-name substring at compile time.
|
|
210
221
|
*/
|
|
211
222
|
template <class T>
|
|
212
223
|
[[nodiscard]] constexpr auto
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @file
|
|
20
|
-
* @brief C++ header file with declarations for the µTest++
|
|
20
|
+
* @brief C++ header file with declarations for the µTest++ human test
|
|
21
21
|
* reporter.
|
|
22
22
|
*
|
|
23
23
|
* @details
|
|
24
|
-
* This header provides the declaration for `
|
|
25
|
-
* concrete implementation of the `
|
|
24
|
+
* This header provides the declaration for `reporter_human`, the default
|
|
25
|
+
* concrete implementation of the `reporter` abstract interface. It
|
|
26
26
|
* formats and presents test results using `printf`-based standard output,
|
|
27
27
|
* accumulating output in an internal string buffer and supporting
|
|
28
28
|
* colour-coded diagnostics and multiple verbosity levels.
|
|
29
29
|
*
|
|
30
30
|
* Users who require custom output behaviour (e.g. redirecting to a serial
|
|
31
|
-
* port on bare-metal targets) may derive a new class from `
|
|
31
|
+
* port on bare-metal targets) may derive a new class from `reporter`
|
|
32
32
|
* instead of using this class.
|
|
33
33
|
*
|
|
34
34
|
* All definitions reside within the `micro_os_plus::micro_test_plus`
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
// ----------------------------------------------------------------------------
|
|
54
54
|
|
|
55
|
-
#include "
|
|
55
|
+
#include "reporter.h"
|
|
56
56
|
|
|
57
57
|
// ----------------------------------------------------------------------------
|
|
58
58
|
|
|
@@ -64,22 +64,24 @@
|
|
|
64
64
|
#endif
|
|
65
65
|
#endif
|
|
66
66
|
|
|
67
|
+
// =============================================================================
|
|
68
|
+
|
|
67
69
|
namespace micro_os_plus::micro_test_plus
|
|
68
70
|
{
|
|
69
71
|
// --------------------------------------------------------------------------
|
|
70
72
|
|
|
71
73
|
/**
|
|
72
|
-
* @brief
|
|
74
|
+
* @brief Human (standard output) implementation of `reporter`.
|
|
73
75
|
*
|
|
74
76
|
* @details
|
|
75
|
-
* `
|
|
76
|
-
* `
|
|
77
|
+
* `reporter_human` provides the default concrete implementation of the
|
|
78
|
+
* `reporter` abstract interface, formatting and presenting test results
|
|
77
79
|
* using `printf`-based output. It accumulates output in an internal string
|
|
78
80
|
* buffer and writes it to the standard output stream, supporting
|
|
79
81
|
* colour-coded diagnostics and multiple verbosity levels.
|
|
80
82
|
*
|
|
81
83
|
* Users who require custom output behaviour (e.g. redirecting to a serial
|
|
82
|
-
* port on bare-metal targets) may derive a new class from `
|
|
84
|
+
* port on bare-metal targets) may derive a new class from `reporter`
|
|
83
85
|
* and supply an instance via the `reporter` global pointer before calling
|
|
84
86
|
* `initialize()`.
|
|
85
87
|
*
|
|
@@ -89,160 +91,155 @@ namespace micro_os_plus::micro_test_plus
|
|
|
89
91
|
*
|
|
90
92
|
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
91
93
|
*/
|
|
92
|
-
class
|
|
94
|
+
class reporter_human final : public reporter
|
|
93
95
|
{
|
|
94
96
|
public:
|
|
95
97
|
/**
|
|
96
|
-
* @brief Constructor for the
|
|
98
|
+
* @brief Constructor for the reporter_human class.
|
|
97
99
|
*
|
|
98
100
|
* @details
|
|
99
101
|
* The rule of five is enforced to prevent accidental copying or moving.
|
|
102
|
+
*
|
|
103
|
+
* @param argvs Owning pointer to the command-line arguments vector;
|
|
104
|
+
* the reporter takes ownership via move.
|
|
100
105
|
*/
|
|
101
|
-
|
|
106
|
+
reporter_human (std::unique_ptr<std::vector<std::string_view>> argvs);
|
|
102
107
|
|
|
103
108
|
/**
|
|
104
109
|
* @brief Deleted copy constructor to prevent copying.
|
|
105
110
|
*/
|
|
106
|
-
|
|
111
|
+
reporter_human (const reporter_human&) = delete;
|
|
107
112
|
|
|
108
113
|
/**
|
|
109
114
|
* @brief Deleted move constructor to prevent moving.
|
|
110
115
|
*/
|
|
111
|
-
|
|
116
|
+
reporter_human (reporter_human&&) = delete;
|
|
112
117
|
|
|
113
118
|
/**
|
|
114
119
|
* @brief Deleted copy assignment operator to prevent copying.
|
|
115
120
|
*/
|
|
116
|
-
|
|
117
|
-
operator= (const
|
|
118
|
-
= delete;
|
|
121
|
+
reporter_human&
|
|
122
|
+
operator= (const reporter_human&) = delete;
|
|
119
123
|
|
|
120
124
|
/**
|
|
121
125
|
* @brief Deleted move assignment operator to prevent moving.
|
|
122
126
|
*/
|
|
123
|
-
|
|
124
|
-
operator= (
|
|
125
|
-
= delete;
|
|
127
|
+
reporter_human&
|
|
128
|
+
operator= (reporter_human&&) = delete;
|
|
126
129
|
|
|
127
130
|
/**
|
|
128
|
-
* @brief Destructor for the
|
|
131
|
+
* @brief Destructor for the reporter_human class.
|
|
129
132
|
*/
|
|
130
|
-
~
|
|
133
|
+
~reporter_human () override;
|
|
131
134
|
|
|
132
|
-
|
|
133
|
-
* @brief Inserts a line ending into the output buffer.
|
|
134
|
-
*
|
|
135
|
-
* @par Parameters
|
|
136
|
-
* None.
|
|
137
|
-
* @par Returns
|
|
138
|
-
* Nothing.
|
|
139
|
-
*/
|
|
140
|
-
void
|
|
141
|
-
endline (void) override;
|
|
135
|
+
// ------------------------------------------------------------------------
|
|
142
136
|
|
|
143
137
|
/**
|
|
144
|
-
* @brief
|
|
138
|
+
* @brief Output operator for the `indent_t` manipulator.
|
|
145
139
|
*
|
|
146
|
-
* @param
|
|
147
|
-
* @
|
|
148
|
-
* Nothing.
|
|
140
|
+
* @param m The indentation manipulator produced by `indent(n)`.
|
|
141
|
+
* @return Reference to the current reporter instance.
|
|
149
142
|
*/
|
|
150
|
-
|
|
151
|
-
|
|
143
|
+
reporter_human&
|
|
144
|
+
operator<< (indent_t m);
|
|
145
|
+
|
|
146
|
+
// Bring base class operator<< overloads into scope to prevent name hiding.
|
|
147
|
+
using reporter::operator<<;
|
|
148
|
+
|
|
149
|
+
// ------------------------------------------------------------------------
|
|
152
150
|
|
|
153
151
|
/**
|
|
154
|
-
* @brief Mark the
|
|
152
|
+
* @brief Mark the beginning of a test suite.
|
|
155
153
|
*
|
|
156
|
-
* @param
|
|
154
|
+
* @param runner Reference to the test runner.
|
|
157
155
|
* @par Returns
|
|
158
156
|
* Nothing.
|
|
159
157
|
*/
|
|
160
158
|
void
|
|
161
|
-
|
|
159
|
+
begin_session (runner& runner) override;
|
|
162
160
|
|
|
163
161
|
/**
|
|
164
|
-
* @brief Mark the
|
|
162
|
+
* @brief Mark the end of a test suite.
|
|
165
163
|
*
|
|
166
|
-
* @param
|
|
164
|
+
* @param runner Reference to the test runner.
|
|
167
165
|
* @par Returns
|
|
168
166
|
* Nothing.
|
|
169
167
|
*/
|
|
170
168
|
void
|
|
171
|
-
|
|
169
|
+
end_session (runner& runner) override;
|
|
172
170
|
|
|
173
171
|
/**
|
|
174
|
-
* @brief Mark the
|
|
172
|
+
* @brief Mark the beginning of a suite.
|
|
175
173
|
*
|
|
176
|
-
* @param suite Reference to the
|
|
174
|
+
* @param suite Reference to the suite.
|
|
177
175
|
* @par Returns
|
|
178
176
|
* Nothing.
|
|
179
177
|
*/
|
|
180
|
-
void
|
|
181
|
-
|
|
178
|
+
virtual void
|
|
179
|
+
begin_suite (suite& suite) override;
|
|
182
180
|
|
|
183
181
|
/**
|
|
184
|
-
* @brief Mark the
|
|
182
|
+
* @brief Mark the end of a test suite.
|
|
185
183
|
*
|
|
186
|
-
* @param
|
|
184
|
+
* @param suite Reference to the test suite.
|
|
187
185
|
* @par Returns
|
|
188
186
|
* Nothing.
|
|
189
187
|
*/
|
|
190
|
-
void
|
|
191
|
-
|
|
188
|
+
virtual void
|
|
189
|
+
end_suite (suite& suite) override;
|
|
192
190
|
|
|
193
191
|
/**
|
|
194
|
-
* @brief Mark the
|
|
192
|
+
* @brief Mark the beginning of a subtest.
|
|
195
193
|
*
|
|
196
|
-
* @param
|
|
194
|
+
* @param subtest Reference to the subtest.
|
|
197
195
|
* @par Returns
|
|
198
196
|
* Nothing.
|
|
199
197
|
*/
|
|
200
|
-
void
|
|
201
|
-
|
|
198
|
+
virtual void
|
|
199
|
+
begin_subtest (subtest& subtest) override;
|
|
202
200
|
|
|
203
201
|
/**
|
|
204
|
-
* @brief
|
|
202
|
+
* @brief Mark the end of a subtest.
|
|
205
203
|
*
|
|
206
|
-
* @
|
|
207
|
-
* None.
|
|
204
|
+
* @param subtest Reference to the subtest.
|
|
208
205
|
* @par Returns
|
|
209
206
|
* Nothing.
|
|
210
207
|
*/
|
|
211
|
-
void
|
|
212
|
-
|
|
208
|
+
virtual void
|
|
209
|
+
end_subtest (subtest& subtest) override;
|
|
213
210
|
|
|
214
211
|
/**
|
|
215
|
-
* @brief
|
|
212
|
+
* @brief Returns an empty comment prefix string.
|
|
216
213
|
*
|
|
217
214
|
* @par Parameters
|
|
218
215
|
* None.
|
|
219
|
-
* @
|
|
220
|
-
*
|
|
216
|
+
* @return An empty string, as the human-readable format does not
|
|
217
|
+
* use a comment prefix.
|
|
221
218
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
virtual const char*
|
|
220
|
+
get_comment_prefix (void) override;
|
|
224
221
|
|
|
225
222
|
protected:
|
|
226
223
|
/**
|
|
227
224
|
* @brief Outputs the prefix for a passing condition.
|
|
228
225
|
*
|
|
229
226
|
* @param message The message to display.
|
|
227
|
+
* @param subtest The subtest that owns this check.
|
|
230
228
|
* @par Returns
|
|
231
229
|
* Nothing.
|
|
232
230
|
*/
|
|
233
231
|
void
|
|
234
|
-
output_pass_prefix_ (std::string& message) override;
|
|
232
|
+
output_pass_prefix_ (std::string& message, subtest& subtest) override;
|
|
235
233
|
|
|
236
234
|
/**
|
|
237
235
|
* @brief Outputs the suffix for a passing condition.
|
|
238
236
|
*
|
|
239
|
-
* @
|
|
240
|
-
* None.
|
|
237
|
+
* @param subtest The subtest that owns this check.
|
|
241
238
|
* @par Returns
|
|
242
239
|
* Nothing.
|
|
243
240
|
*/
|
|
244
241
|
void
|
|
245
|
-
output_pass_suffix_ (
|
|
242
|
+
output_pass_suffix_ (subtest& subtest) override;
|
|
246
243
|
|
|
247
244
|
/**
|
|
248
245
|
* @brief Outputs the prefix for a failing condition.
|
|
@@ -251,24 +248,27 @@ namespace micro_os_plus::micro_test_plus
|
|
|
251
248
|
* @param hasExpression Whether the failure is associated with an
|
|
252
249
|
* expression.
|
|
253
250
|
* @param location The source location of the failure.
|
|
251
|
+
* @param subtest The subtest that owns this check.
|
|
254
252
|
* @par Returns
|
|
255
253
|
* Nothing.
|
|
256
254
|
*/
|
|
257
255
|
void
|
|
258
256
|
output_fail_prefix_ (std::string& message, const bool hasExpression,
|
|
259
|
-
const reflection::source_location& location
|
|
257
|
+
const reflection::source_location& location,
|
|
258
|
+
subtest& subtest) override;
|
|
260
259
|
|
|
261
260
|
/**
|
|
262
261
|
* @brief Outputs the suffix for a failing condition.
|
|
263
262
|
*
|
|
264
263
|
* @param location The source location of the failure.
|
|
265
264
|
* @param abort Whether to abort execution after failure.
|
|
265
|
+
* @param subtest The subtest that owns this check.
|
|
266
266
|
* @par Returns
|
|
267
267
|
* Nothing.
|
|
268
268
|
*/
|
|
269
269
|
void
|
|
270
270
|
output_fail_suffix_ (const reflection::source_location& location,
|
|
271
|
-
bool abort) override;
|
|
271
|
+
bool abort, subtest& subtest) override;
|
|
272
272
|
};
|
|
273
273
|
|
|
274
274
|
// --------------------------------------------------------------------------
|