@micro-os-plus/micro-test-plus 3.2.3 → 3.3.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 +67 -2
- package/CMakeLists.txt +2 -1
- package/README.md +1 -1
- package/include/micro-os-plus/micro-test-plus/detail.h +173 -150
- package/include/micro-os-plus/micro-test-plus/inlines/details-inlines.h +2 -2
- package/include/micro-os-plus/micro-test-plus/inlines/test-reporter-inlines.h +8 -3
- package/include/micro-os-plus/micro-test-plus/test-reporter-basic.h +289 -0
- package/include/micro-os-plus/micro-test-plus/test-reporter-tap.h +281 -0
- package/include/micro-os-plus/micro-test-plus/test-reporter.h +72 -27
- package/include/micro-os-plus/micro-test-plus/test-runner.h +55 -15
- package/include/micro-os-plus/micro-test-plus/test-suite.h +47 -11
- package/include/micro-os-plus/micro-test-plus.h +4 -2
- package/meson.build +2 -0
- package/package.json +1 -1
- package/src/micro-test-plus.cpp +6 -5
- package/src/test-reporter-basic.cpp +466 -0
- package/src/test-reporter-tap.cpp +530 -0
- package/src/test-reporter.cpp +5 -380
- package/src/test-runner.cpp +66 -18
- package/src/test-suite.cpp +58 -5
|
@@ -0,0 +1,289 @@
|
|
|
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.0 Software License,
|
|
13
|
+
* which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// ----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @file
|
|
20
|
+
* @brief C++ header file with declarations for the µTest++ basic test
|
|
21
|
+
* reporter.
|
|
22
|
+
*
|
|
23
|
+
* @details
|
|
24
|
+
* This header provides the declaration for `test_reporter_basic`, the default
|
|
25
|
+
* concrete implementation of the `test_reporter` abstract interface. It
|
|
26
|
+
* formats and presents test results using `printf`-based standard output,
|
|
27
|
+
* accumulating output in an internal string buffer and supporting
|
|
28
|
+
* colour-coded diagnostics and multiple verbosity levels.
|
|
29
|
+
*
|
|
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 `test_reporter`
|
|
32
|
+
* instead of using this class.
|
|
33
|
+
*
|
|
34
|
+
* All definitions reside within the `micro_os_plus::micro_test_plus`
|
|
35
|
+
* namespace, ensuring clear separation from user code and minimising the risk
|
|
36
|
+
* of naming conflicts.
|
|
37
|
+
*
|
|
38
|
+
* The header files are organised within the
|
|
39
|
+
* `include/micro-os-plus/micro-test-plus` folder to maintain a structured and
|
|
40
|
+
* modular codebase.
|
|
41
|
+
*
|
|
42
|
+
* This file is intended solely for internal use within the framework and
|
|
43
|
+
* should not be included directly by user code.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
#ifndef MICRO_TEST_PLUS_TEST_REPORTER_BASIC_H_
|
|
47
|
+
#define MICRO_TEST_PLUS_TEST_REPORTER_BASIC_H_
|
|
48
|
+
|
|
49
|
+
// ----------------------------------------------------------------------------
|
|
50
|
+
|
|
51
|
+
#ifdef __cplusplus
|
|
52
|
+
|
|
53
|
+
// ----------------------------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
#include "test-reporter.h"
|
|
56
|
+
|
|
57
|
+
// ----------------------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
#if defined(__GNUC__)
|
|
60
|
+
#pragma GCC diagnostic push
|
|
61
|
+
#pragma GCC diagnostic ignored "-Wpadded"
|
|
62
|
+
#if defined(__clang__)
|
|
63
|
+
#pragma clang diagnostic ignored "-Wc++98-compat"
|
|
64
|
+
#endif
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
namespace micro_os_plus::micro_test_plus
|
|
68
|
+
{
|
|
69
|
+
// --------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @brief Basic (standard output) implementation of `test_reporter`.
|
|
73
|
+
*
|
|
74
|
+
* @details
|
|
75
|
+
* `test_reporter_basic` provides the default concrete implementation of the
|
|
76
|
+
* `test_reporter` abstract interface, formatting and presenting test results
|
|
77
|
+
* using `printf`-based output. It accumulates output in an internal string
|
|
78
|
+
* buffer and writes it to the standard output stream, supporting
|
|
79
|
+
* colour-coded diagnostics and multiple verbosity levels.
|
|
80
|
+
*
|
|
81
|
+
* Users who require custom output behaviour (e.g. redirecting to a serial
|
|
82
|
+
* port on bare-metal targets) may derive a new class from `test_reporter`
|
|
83
|
+
* and supply an instance via the `reporter` global pointer before calling
|
|
84
|
+
* `initialize()`.
|
|
85
|
+
*
|
|
86
|
+
* All members and methods are defined within the
|
|
87
|
+
* `micro_os_plus::micro_test_plus` namespace, ensuring clear separation from
|
|
88
|
+
* user code and minimising the risk of naming conflicts.
|
|
89
|
+
*
|
|
90
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
91
|
+
*/
|
|
92
|
+
class test_reporter_basic final : public test_reporter
|
|
93
|
+
{
|
|
94
|
+
public:
|
|
95
|
+
/**
|
|
96
|
+
* @brief Constructor for the test_reporter_basic class.
|
|
97
|
+
*
|
|
98
|
+
* @details
|
|
99
|
+
* The rule of five is enforced to prevent accidental copying or moving.
|
|
100
|
+
*/
|
|
101
|
+
test_reporter_basic ();
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @brief Deleted copy constructor to prevent copying.
|
|
105
|
+
*/
|
|
106
|
+
test_reporter_basic (const test_reporter_basic&) = delete;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @brief Deleted move constructor to prevent moving.
|
|
110
|
+
*/
|
|
111
|
+
test_reporter_basic (test_reporter_basic&&) = delete;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @brief Deleted copy assignment operator to prevent copying.
|
|
115
|
+
*/
|
|
116
|
+
test_reporter_basic&
|
|
117
|
+
operator= (const test_reporter_basic&)
|
|
118
|
+
= delete;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @brief Deleted move assignment operator to prevent moving.
|
|
122
|
+
*/
|
|
123
|
+
test_reporter_basic&
|
|
124
|
+
operator= (test_reporter_basic&&)
|
|
125
|
+
= delete;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @brief Destructor for the test_reporter_basic class.
|
|
129
|
+
*/
|
|
130
|
+
~test_reporter_basic () override = default;
|
|
131
|
+
|
|
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;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @brief Mark the beginning of a test case.
|
|
145
|
+
*
|
|
146
|
+
* @param name The name of the test case.
|
|
147
|
+
* @par Returns
|
|
148
|
+
* Nothing.
|
|
149
|
+
*/
|
|
150
|
+
void
|
|
151
|
+
begin_test_case (const char* name) override;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @brief Mark the end of a test case.
|
|
155
|
+
*
|
|
156
|
+
* @param name The name of the test case.
|
|
157
|
+
* @par Returns
|
|
158
|
+
* Nothing.
|
|
159
|
+
*/
|
|
160
|
+
void
|
|
161
|
+
end_test_case (const char* name) override;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @brief Mark the beginning of a test suite.
|
|
165
|
+
*
|
|
166
|
+
* @param name The name of the test suite.
|
|
167
|
+
* @par Returns
|
|
168
|
+
* Nothing.
|
|
169
|
+
*/
|
|
170
|
+
void
|
|
171
|
+
begin_test_suite (const char* name) override;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @brief Mark the end of a test suite.
|
|
175
|
+
*
|
|
176
|
+
* @param suite Reference to the test suite base.
|
|
177
|
+
* @par Returns
|
|
178
|
+
* Nothing.
|
|
179
|
+
*/
|
|
180
|
+
void
|
|
181
|
+
end_test_suite (test_suite_base& suite) override;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @brief Mark the beginning of a test.
|
|
185
|
+
*
|
|
186
|
+
* @param test_suites_count The number of test suites, or zero if unknown.
|
|
187
|
+
* @par Returns
|
|
188
|
+
* Nothing.
|
|
189
|
+
*/
|
|
190
|
+
void
|
|
191
|
+
begin_test (size_t test_suites_count) override;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @brief Mark the end of a test.
|
|
195
|
+
*
|
|
196
|
+
* @param runner Reference to the test runner.
|
|
197
|
+
* @par Returns
|
|
198
|
+
* Nothing.
|
|
199
|
+
*/
|
|
200
|
+
void
|
|
201
|
+
end_test (test_runner& runner) override;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @brief Flush the current buffered content.
|
|
205
|
+
*
|
|
206
|
+
* @par Parameters
|
|
207
|
+
* None.
|
|
208
|
+
* @par Returns
|
|
209
|
+
* Nothing.
|
|
210
|
+
*/
|
|
211
|
+
void
|
|
212
|
+
flush (void) override;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @brief Output the current buffered content.
|
|
216
|
+
*
|
|
217
|
+
* @par Parameters
|
|
218
|
+
* None.
|
|
219
|
+
* @par Returns
|
|
220
|
+
* Nothing.
|
|
221
|
+
*/
|
|
222
|
+
void
|
|
223
|
+
output (void) override;
|
|
224
|
+
|
|
225
|
+
protected:
|
|
226
|
+
/**
|
|
227
|
+
* @brief Outputs the prefix for a passing condition.
|
|
228
|
+
*
|
|
229
|
+
* @param message The message to display.
|
|
230
|
+
* @par Returns
|
|
231
|
+
* Nothing.
|
|
232
|
+
*/
|
|
233
|
+
void
|
|
234
|
+
output_pass_prefix_ (std::string& message) override;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @brief Outputs the suffix for a passing condition.
|
|
238
|
+
*
|
|
239
|
+
* @par Parameters
|
|
240
|
+
* None.
|
|
241
|
+
* @par Returns
|
|
242
|
+
* Nothing.
|
|
243
|
+
*/
|
|
244
|
+
void
|
|
245
|
+
output_pass_suffix_ (void) override;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @brief Outputs the prefix for a failing condition.
|
|
249
|
+
*
|
|
250
|
+
* @param message The message to display.
|
|
251
|
+
* @param hasExpression Whether the failure is associated with an
|
|
252
|
+
* expression.
|
|
253
|
+
* @param location The source location of the failure.
|
|
254
|
+
* @par Returns
|
|
255
|
+
* Nothing.
|
|
256
|
+
*/
|
|
257
|
+
void
|
|
258
|
+
output_fail_prefix_ (std::string& message, const bool hasExpression,
|
|
259
|
+
const reflection::source_location& location) override;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @brief Outputs the suffix for a failing condition.
|
|
263
|
+
*
|
|
264
|
+
* @param location The source location of the failure.
|
|
265
|
+
* @param abort Whether to abort execution after failure.
|
|
266
|
+
* @par Returns
|
|
267
|
+
* Nothing.
|
|
268
|
+
*/
|
|
269
|
+
void
|
|
270
|
+
output_fail_suffix_ (const reflection::source_location& location,
|
|
271
|
+
bool abort) override;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
// --------------------------------------------------------------------------
|
|
275
|
+
} // namespace micro_os_plus::micro_test_plus
|
|
276
|
+
|
|
277
|
+
#if defined(__GNUC__)
|
|
278
|
+
#pragma GCC diagnostic pop
|
|
279
|
+
#endif
|
|
280
|
+
|
|
281
|
+
// ----------------------------------------------------------------------------
|
|
282
|
+
|
|
283
|
+
#endif // __cplusplus
|
|
284
|
+
|
|
285
|
+
// ----------------------------------------------------------------------------
|
|
286
|
+
|
|
287
|
+
#endif // MICRO_TEST_PLUS_TEST_REPORTER_BASIC_H_
|
|
288
|
+
|
|
289
|
+
// ----------------------------------------------------------------------------
|
|
@@ -0,0 +1,281 @@
|
|
|
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.0 Software License,
|
|
13
|
+
* which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// ----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @file
|
|
20
|
+
* @brief C++ header file with declarations for the µTest++ TAP test reporter.
|
|
21
|
+
*
|
|
22
|
+
* @details
|
|
23
|
+
* This header provides the declaration for `test_reporter_tap`, a concrete
|
|
24
|
+
* implementation of the `test_reporter` abstract interface that formats test
|
|
25
|
+
* results according to the Test Anything Protocol (TAP).
|
|
26
|
+
*
|
|
27
|
+
* All definitions reside within the `micro_os_plus::micro_test_plus`
|
|
28
|
+
* namespace, ensuring clear separation from user code and minimising the risk
|
|
29
|
+
* of naming conflicts.
|
|
30
|
+
*
|
|
31
|
+
* The header files are organised within the
|
|
32
|
+
* `include/micro-os-plus/micro-test-plus` folder to maintain a structured and
|
|
33
|
+
* modular codebase.
|
|
34
|
+
*
|
|
35
|
+
* This file is intended solely for internal use within the framework and
|
|
36
|
+
* should not be included directly by user code.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
#ifndef MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
|
|
40
|
+
#define MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
|
|
41
|
+
|
|
42
|
+
// ----------------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
#ifdef __cplusplus
|
|
45
|
+
|
|
46
|
+
// ----------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
#include "test-reporter.h"
|
|
49
|
+
|
|
50
|
+
// ----------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
#if defined(__GNUC__)
|
|
53
|
+
#pragma GCC diagnostic push
|
|
54
|
+
#pragma GCC diagnostic ignored "-Wpadded"
|
|
55
|
+
#if defined(__clang__)
|
|
56
|
+
#pragma clang diagnostic ignored "-Wc++98-compat"
|
|
57
|
+
#endif
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
namespace micro_os_plus::micro_test_plus
|
|
61
|
+
{
|
|
62
|
+
// --------------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @brief TAP (Test Anything Protocol) implementation of `test_reporter`.
|
|
66
|
+
*
|
|
67
|
+
* @details
|
|
68
|
+
* `test_reporter_tap` provides a concrete implementation of the
|
|
69
|
+
* `test_reporter` abstract interface that formats test results according to
|
|
70
|
+
* the Test Anything Protocol (TAP). It accumulates output in an internal
|
|
71
|
+
* string buffer and writes it to the standard output stream.
|
|
72
|
+
*
|
|
73
|
+
* Users who require custom output behaviour (e.g. redirecting to a serial
|
|
74
|
+
* port on bare-metal targets) may derive a new class from `test_reporter`
|
|
75
|
+
* and supply an instance via the `reporter` global pointer before calling
|
|
76
|
+
* `initialize()`.
|
|
77
|
+
*
|
|
78
|
+
* All members and methods are defined within the
|
|
79
|
+
* `micro_os_plus::micro_test_plus` namespace, ensuring clear separation from
|
|
80
|
+
* user code and minimising the risk of naming conflicts.
|
|
81
|
+
*
|
|
82
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
83
|
+
*/
|
|
84
|
+
class test_reporter_tap final : public test_reporter
|
|
85
|
+
{
|
|
86
|
+
public:
|
|
87
|
+
/**
|
|
88
|
+
* @brief Default constructor for the test_reporter_tap class.
|
|
89
|
+
*
|
|
90
|
+
* @details
|
|
91
|
+
* The rule of five is enforced to prevent accidental copying or moving.
|
|
92
|
+
*/
|
|
93
|
+
test_reporter_tap () = default;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @brief Deleted copy constructor to prevent copying.
|
|
97
|
+
*/
|
|
98
|
+
test_reporter_tap (const test_reporter_tap&) = delete;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @brief Deleted move constructor to prevent moving.
|
|
102
|
+
*/
|
|
103
|
+
test_reporter_tap (test_reporter_tap&&) = delete;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @brief Deleted copy assignment operator to prevent copying.
|
|
107
|
+
*/
|
|
108
|
+
test_reporter_tap&
|
|
109
|
+
operator= (const test_reporter_tap&)
|
|
110
|
+
= delete;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @brief Deleted move assignment operator to prevent moving.
|
|
114
|
+
*/
|
|
115
|
+
test_reporter_tap&
|
|
116
|
+
operator= (test_reporter_tap&&)
|
|
117
|
+
= delete;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @brief Destructor for the test_reporter_tap class.
|
|
121
|
+
*/
|
|
122
|
+
~test_reporter_tap () override = default;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @brief Inserts a line ending into the output buffer.
|
|
126
|
+
*
|
|
127
|
+
* @par Parameters
|
|
128
|
+
* None.
|
|
129
|
+
* @par Returns
|
|
130
|
+
* Nothing.
|
|
131
|
+
*/
|
|
132
|
+
void
|
|
133
|
+
endline (void) override;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @brief Mark the beginning of a test case.
|
|
137
|
+
*
|
|
138
|
+
* @param name The name of the test case.
|
|
139
|
+
* @par Returns
|
|
140
|
+
* Nothing.
|
|
141
|
+
*/
|
|
142
|
+
void
|
|
143
|
+
begin_test_case (const char* name) override;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @brief Mark the end of a test case.
|
|
147
|
+
*
|
|
148
|
+
* @param name The name of the test case.
|
|
149
|
+
* @par Returns
|
|
150
|
+
* Nothing.
|
|
151
|
+
*/
|
|
152
|
+
void
|
|
153
|
+
end_test_case (const char* name) override;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @brief Mark the beginning of a test suite.
|
|
157
|
+
*
|
|
158
|
+
* @param name The name of the test suite.
|
|
159
|
+
* @par Returns
|
|
160
|
+
* Nothing.
|
|
161
|
+
*/
|
|
162
|
+
void
|
|
163
|
+
begin_test_suite (const char* name) override;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @brief Mark the end of a test suite.
|
|
167
|
+
*
|
|
168
|
+
* @param suite Reference to the test suite base.
|
|
169
|
+
* @par Returns
|
|
170
|
+
* Nothing.
|
|
171
|
+
*/
|
|
172
|
+
void
|
|
173
|
+
end_test_suite (test_suite_base& suite) override;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @brief Mark the beginning of a test.
|
|
177
|
+
*
|
|
178
|
+
* @param test_suites_count The number of test suites, or zero if unknown.
|
|
179
|
+
* @par Returns
|
|
180
|
+
* Nothing.
|
|
181
|
+
*/
|
|
182
|
+
void
|
|
183
|
+
begin_test (size_t test_suites_count) override;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @brief Mark the end of a test.
|
|
187
|
+
*
|
|
188
|
+
* @param runner Reference to the test runner.
|
|
189
|
+
* @par Returns
|
|
190
|
+
* Nothing.
|
|
191
|
+
*/
|
|
192
|
+
void
|
|
193
|
+
end_test (test_runner& runner) override;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @brief Flush the current buffered content.
|
|
197
|
+
*
|
|
198
|
+
* @par Parameters
|
|
199
|
+
* None.
|
|
200
|
+
* @par Returns
|
|
201
|
+
* Nothing.
|
|
202
|
+
*/
|
|
203
|
+
void
|
|
204
|
+
flush (void) override;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @brief Output the current buffered content.
|
|
208
|
+
*
|
|
209
|
+
* @par Parameters
|
|
210
|
+
* None.
|
|
211
|
+
* @par Returns
|
|
212
|
+
* Nothing.
|
|
213
|
+
*/
|
|
214
|
+
void
|
|
215
|
+
output (void) override;
|
|
216
|
+
|
|
217
|
+
protected:
|
|
218
|
+
/**
|
|
219
|
+
* @brief Outputs the prefix for a passing condition.
|
|
220
|
+
*
|
|
221
|
+
* @param message The message to display.
|
|
222
|
+
* @par Returns
|
|
223
|
+
* Nothing.
|
|
224
|
+
*/
|
|
225
|
+
void
|
|
226
|
+
output_pass_prefix_ (std::string& message) override;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @brief Outputs the suffix for a passing condition.
|
|
230
|
+
*
|
|
231
|
+
* @par Parameters
|
|
232
|
+
* None.
|
|
233
|
+
* @par Returns
|
|
234
|
+
* Nothing.
|
|
235
|
+
*/
|
|
236
|
+
void
|
|
237
|
+
output_pass_suffix_ (void) override;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @brief Outputs the prefix for a failing condition.
|
|
241
|
+
*
|
|
242
|
+
* @param message The message to display.
|
|
243
|
+
* @param hasExpression Whether the failure is associated with an
|
|
244
|
+
* expression.
|
|
245
|
+
* @param location The source location of the failure.
|
|
246
|
+
* @par Returns
|
|
247
|
+
* Nothing.
|
|
248
|
+
*/
|
|
249
|
+
void
|
|
250
|
+
output_fail_prefix_ (std::string& message, const bool hasExpression,
|
|
251
|
+
const reflection::source_location& location) override;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @brief Outputs the suffix for a failing condition.
|
|
255
|
+
*
|
|
256
|
+
* @param location The source location of the failure.
|
|
257
|
+
* @param abort Whether to abort execution after failure.
|
|
258
|
+
* @par Returns
|
|
259
|
+
* Nothing.
|
|
260
|
+
*/
|
|
261
|
+
void
|
|
262
|
+
output_fail_suffix_ (const reflection::source_location& location,
|
|
263
|
+
bool abort) override;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// --------------------------------------------------------------------------
|
|
267
|
+
} // namespace micro_os_plus::micro_test_plus
|
|
268
|
+
|
|
269
|
+
#if defined(__GNUC__)
|
|
270
|
+
#pragma GCC diagnostic pop
|
|
271
|
+
#endif
|
|
272
|
+
|
|
273
|
+
// ----------------------------------------------------------------------------
|
|
274
|
+
|
|
275
|
+
#endif // __cplusplus
|
|
276
|
+
|
|
277
|
+
// ----------------------------------------------------------------------------
|
|
278
|
+
|
|
279
|
+
#endif // MICRO_TEST_PLUS_TEST_REPORTER_TAP_H_
|
|
280
|
+
|
|
281
|
+
// ----------------------------------------------------------------------------
|