@micro-os-plus/micro-test-plus 3.3.1 → 4.1.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 +412 -2
- package/CMakeLists.txt +134 -28
- package/README.md +3 -2
- package/config/xcdl-build.json +11 -4
- package/include/micro-os-plus/micro-test-plus/README.md +6 -0
- package/include/micro-os-plus/micro-test-plus/deferred-reporter.h +267 -0
- package/include/micro-os-plus/micro-test-plus/detail.h +272 -1425
- package/include/micro-os-plus/micro-test-plus/exceptions.h +125 -0
- package/include/micro-os-plus/micro-test-plus/expression-formatter.h +669 -0
- package/include/micro-os-plus/micro-test-plus/function-comparators.h +15 -7
- package/include/micro-os-plus/micro-test-plus/inlines/{details-inlines.h → deferred-reporter-inlines.h} +66 -44
- 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/{test-reporter-inlines.h → expression-formatter-inlines.h} +232 -198
- package/include/micro-os-plus/micro-test-plus/inlines/function-comparators-inlines.h +24 -20
- package/include/micro-os-plus/micro-test-plus/inlines/literals-inlines.h +50 -31
- package/include/micro-os-plus/micro-test-plus/inlines/math-inlines.h +25 -19
- 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 +39 -21
- package/include/micro-os-plus/micro-test-plus/inlines/reporter-inlines.h +205 -0
- package/include/micro-os-plus/micro-test-plus/inlines/runner-inlines.h +151 -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 +555 -0
- 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 +231 -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 +12 -17
- package/include/micro-os-plus/micro-test-plus/math.h +14 -6
- package/include/micro-os-plus/micro-test-plus/operators.h +53 -209
- package/include/micro-os-plus/micro-test-plus/reflection.h +8 -4
- package/include/micro-os-plus/micro-test-plus/{test-reporter-basic.h → reporter-human.h} +80 -74
- package/include/micro-os-plus/micro-test-plus/{test-reporter-tap.h → reporter-tap.h} +77 -71
- package/include/micro-os-plus/micro-test-plus/reporter.h +619 -0
- package/include/micro-os-plus/micro-test-plus/runner-totals.h +250 -0
- package/include/micro-os-plus/micro-test-plus/runner.h +472 -0
- package/include/micro-os-plus/micro-test-plus/test.h +1013 -0
- package/include/micro-os-plus/micro-test-plus/timings.h +363 -0
- package/include/micro-os-plus/micro-test-plus/type-traits.h +223 -577
- package/include/micro-os-plus/micro-test-plus/utility.h +136 -0
- package/include/micro-os-plus/micro-test-plus.h +42 -236
- package/meson.build +11 -6
- package/package.json +11 -3
- package/src/deferred-reporter.cpp +137 -0
- package/src/expression-formatter.cpp +289 -0
- package/src/reflection.cpp +97 -0
- package/src/reporter-human.cpp +816 -0
- package/src/reporter-tap.cpp +772 -0
- package/src/reporter.cpp +481 -0
- package/src/runner-totals.cpp +98 -0
- package/src/runner.cpp +669 -0
- package/src/test.cpp +503 -0
- package/src/timings.cpp +210 -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/inlines/test-suite-inlines.h +0 -115
- package/include/micro-os-plus/micro-test-plus/test-reporter.h +0 -846
- 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
|
@@ -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,8 @@
|
|
|
52
52
|
|
|
53
53
|
// ----------------------------------------------------------------------------
|
|
54
54
|
|
|
55
|
-
#include "
|
|
55
|
+
#include "reporter.h"
|
|
56
|
+
#include "reflection.h"
|
|
56
57
|
|
|
57
58
|
// ----------------------------------------------------------------------------
|
|
58
59
|
|
|
@@ -64,22 +65,30 @@
|
|
|
64
65
|
#endif
|
|
65
66
|
#endif
|
|
66
67
|
|
|
68
|
+
// ============================================================================
|
|
69
|
+
|
|
67
70
|
namespace micro_os_plus::micro_test_plus
|
|
68
71
|
{
|
|
69
72
|
// --------------------------------------------------------------------------
|
|
70
73
|
|
|
74
|
+
class runner;
|
|
75
|
+
class suite;
|
|
76
|
+
class subtest;
|
|
77
|
+
|
|
78
|
+
// ==========================================================================
|
|
79
|
+
|
|
71
80
|
/**
|
|
72
|
-
* @brief
|
|
81
|
+
* @brief Human (standard output) implementation of `reporter`.
|
|
73
82
|
*
|
|
74
83
|
* @details
|
|
75
|
-
* `
|
|
76
|
-
* `
|
|
84
|
+
* `reporter_human` provides the default concrete implementation of the
|
|
85
|
+
* `reporter` abstract interface, formatting and presenting test results
|
|
77
86
|
* using `printf`-based output. It accumulates output in an internal string
|
|
78
87
|
* buffer and writes it to the standard output stream, supporting
|
|
79
88
|
* colour-coded diagnostics and multiple verbosity levels.
|
|
80
89
|
*
|
|
81
90
|
* Users who require custom output behaviour (e.g. redirecting to a serial
|
|
82
|
-
* port on bare-metal targets) may derive a new class from `
|
|
91
|
+
* port on bare-metal targets) may derive a new class from `reporter`
|
|
83
92
|
* and supply an instance via the `reporter` global pointer before calling
|
|
84
93
|
* `initialize()`.
|
|
85
94
|
*
|
|
@@ -89,186 +98,183 @@ namespace micro_os_plus::micro_test_plus
|
|
|
89
98
|
*
|
|
90
99
|
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
91
100
|
*/
|
|
92
|
-
class
|
|
101
|
+
class reporter_human final : public reporter
|
|
93
102
|
{
|
|
94
103
|
public:
|
|
95
104
|
/**
|
|
96
|
-
* @brief Constructor for the
|
|
105
|
+
* @brief Constructor for the reporter_human class.
|
|
97
106
|
*
|
|
98
|
-
* @
|
|
99
|
-
*
|
|
107
|
+
* @param argvs Owning pointer to the command-line arguments vector;
|
|
108
|
+
* the reporter takes ownership via move.
|
|
100
109
|
*/
|
|
101
|
-
|
|
110
|
+
reporter_human (std::unique_ptr<std::vector<std::string_view>> argvs);
|
|
102
111
|
|
|
103
112
|
/**
|
|
104
113
|
* @brief Deleted copy constructor to prevent copying.
|
|
105
114
|
*/
|
|
106
|
-
|
|
115
|
+
reporter_human (const reporter_human&) = delete;
|
|
107
116
|
|
|
108
117
|
/**
|
|
109
118
|
* @brief Deleted move constructor to prevent moving.
|
|
110
119
|
*/
|
|
111
|
-
|
|
120
|
+
reporter_human (reporter_human&&) = delete;
|
|
112
121
|
|
|
113
122
|
/**
|
|
114
123
|
* @brief Deleted copy assignment operator to prevent copying.
|
|
115
124
|
*/
|
|
116
|
-
|
|
117
|
-
operator= (const
|
|
125
|
+
reporter_human&
|
|
126
|
+
operator= (const reporter_human&)
|
|
118
127
|
= delete;
|
|
119
128
|
|
|
120
129
|
/**
|
|
121
130
|
* @brief Deleted move assignment operator to prevent moving.
|
|
122
131
|
*/
|
|
123
|
-
|
|
124
|
-
operator= (
|
|
132
|
+
reporter_human&
|
|
133
|
+
operator= (reporter_human&&)
|
|
125
134
|
= delete;
|
|
126
135
|
|
|
127
136
|
/**
|
|
128
|
-
* @brief Destructor for the
|
|
137
|
+
* @brief Destructor for the reporter_human class.
|
|
129
138
|
*/
|
|
130
|
-
~
|
|
139
|
+
~reporter_human () override;
|
|
131
140
|
|
|
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;
|
|
141
|
+
// ------------------------------------------------------------------------
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* @brief
|
|
144
|
+
* @brief Output operator for the `indent_t` manipulator.
|
|
145
145
|
*
|
|
146
|
-
* @param
|
|
147
|
-
* @
|
|
148
|
-
* Nothing.
|
|
146
|
+
* @param m The indentation manipulator produced by `indent(n)`.
|
|
147
|
+
* @return Reference to the current reporter instance.
|
|
149
148
|
*/
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
reporter_human&
|
|
150
|
+
operator<< (detail::indent_t m);
|
|
151
|
+
|
|
152
|
+
// Bring base class operator<< overloads into scope to prevent name hiding.
|
|
153
|
+
using reporter::operator<<;
|
|
154
|
+
|
|
155
|
+
// ------------------------------------------------------------------------
|
|
152
156
|
|
|
153
157
|
/**
|
|
154
|
-
* @brief Mark the
|
|
158
|
+
* @brief Mark the beginning of a test session.
|
|
155
159
|
*
|
|
156
|
-
* @param
|
|
160
|
+
* @param runner Reference to the test runner.
|
|
157
161
|
* @par Returns
|
|
158
162
|
* Nothing.
|
|
159
163
|
*/
|
|
160
164
|
void
|
|
161
|
-
|
|
165
|
+
begin_session (runner& runner) override;
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
|
-
* @brief Mark the
|
|
168
|
+
* @brief Mark the end of a test session.
|
|
165
169
|
*
|
|
166
|
-
* @param
|
|
170
|
+
* @param runner Reference to the test runner.
|
|
167
171
|
* @par Returns
|
|
168
172
|
* Nothing.
|
|
169
173
|
*/
|
|
170
174
|
void
|
|
171
|
-
|
|
175
|
+
end_session (runner& runner) override;
|
|
172
176
|
|
|
173
177
|
/**
|
|
174
|
-
* @brief Mark the
|
|
178
|
+
* @brief Mark the beginning of a suite.
|
|
175
179
|
*
|
|
176
|
-
* @param suite Reference to the
|
|
180
|
+
* @param suite Reference to the suite.
|
|
177
181
|
* @par Returns
|
|
178
182
|
* Nothing.
|
|
179
183
|
*/
|
|
180
|
-
void
|
|
181
|
-
|
|
184
|
+
virtual void
|
|
185
|
+
begin_suite (suite& suite) override;
|
|
182
186
|
|
|
183
187
|
/**
|
|
184
|
-
* @brief Mark the
|
|
188
|
+
* @brief Mark the end of a test suite.
|
|
185
189
|
*
|
|
186
|
-
* @param
|
|
190
|
+
* @param suite Reference to the test suite.
|
|
187
191
|
* @par Returns
|
|
188
192
|
* Nothing.
|
|
189
193
|
*/
|
|
190
|
-
void
|
|
191
|
-
|
|
194
|
+
virtual void
|
|
195
|
+
end_suite (suite& suite) override;
|
|
192
196
|
|
|
193
197
|
/**
|
|
194
|
-
* @brief Mark the
|
|
198
|
+
* @brief Mark the beginning of a subtest.
|
|
195
199
|
*
|
|
196
|
-
* @param
|
|
200
|
+
* @param subtest Reference to the subtest.
|
|
197
201
|
* @par Returns
|
|
198
202
|
* Nothing.
|
|
199
203
|
*/
|
|
200
|
-
void
|
|
201
|
-
|
|
204
|
+
virtual void
|
|
205
|
+
begin_subtest (subtest& subtest) override;
|
|
202
206
|
|
|
203
207
|
/**
|
|
204
|
-
* @brief
|
|
208
|
+
* @brief Mark the end of a subtest.
|
|
205
209
|
*
|
|
206
|
-
* @
|
|
207
|
-
* None.
|
|
210
|
+
* @param subtest Reference to the subtest.
|
|
208
211
|
* @par Returns
|
|
209
212
|
* Nothing.
|
|
210
213
|
*/
|
|
211
|
-
void
|
|
212
|
-
|
|
214
|
+
virtual void
|
|
215
|
+
end_subtest (subtest& subtest) override;
|
|
213
216
|
|
|
214
217
|
/**
|
|
215
|
-
* @brief
|
|
218
|
+
* @brief Returns an empty comment prefix string.
|
|
216
219
|
*
|
|
217
220
|
* @par Parameters
|
|
218
221
|
* None.
|
|
219
|
-
* @
|
|
220
|
-
*
|
|
222
|
+
* @return An empty string, as the human-readable format does not
|
|
223
|
+
* use a comment prefix.
|
|
221
224
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
virtual const char*
|
|
226
|
+
get_comment_prefix (void) override;
|
|
224
227
|
|
|
225
228
|
protected:
|
|
226
229
|
/**
|
|
227
230
|
* @brief Outputs the prefix for a passing condition.
|
|
228
231
|
*
|
|
229
232
|
* @param message The message to display.
|
|
233
|
+
* @param subtest The subtest that owns this check.
|
|
230
234
|
* @par Returns
|
|
231
235
|
* Nothing.
|
|
232
236
|
*/
|
|
233
237
|
void
|
|
234
|
-
output_pass_prefix_ (std::string& message) override;
|
|
238
|
+
output_pass_prefix_ (std::string& message, subtest& subtest) override;
|
|
235
239
|
|
|
236
240
|
/**
|
|
237
241
|
* @brief Outputs the suffix for a passing condition.
|
|
238
242
|
*
|
|
239
|
-
* @
|
|
240
|
-
* None.
|
|
243
|
+
* @param subtest The subtest that owns this check.
|
|
241
244
|
* @par Returns
|
|
242
245
|
* Nothing.
|
|
243
246
|
*/
|
|
244
247
|
void
|
|
245
|
-
output_pass_suffix_ (
|
|
248
|
+
output_pass_suffix_ (subtest& subtest) override;
|
|
246
249
|
|
|
247
250
|
/**
|
|
248
251
|
* @brief Outputs the prefix for a failing condition.
|
|
249
252
|
*
|
|
250
253
|
* @param message The message to display.
|
|
251
|
-
* @param
|
|
254
|
+
* @param has_expression Whether the failure is associated with an
|
|
252
255
|
* expression.
|
|
253
256
|
* @param location The source location of the failure.
|
|
257
|
+
* @param subtest The subtest that owns this check.
|
|
254
258
|
* @par Returns
|
|
255
259
|
* Nothing.
|
|
256
260
|
*/
|
|
257
261
|
void
|
|
258
|
-
output_fail_prefix_ (std::string& message, const bool
|
|
259
|
-
const reflection::source_location& location
|
|
262
|
+
output_fail_prefix_ (std::string& message, const bool has_expression,
|
|
263
|
+
const reflection::source_location& location,
|
|
264
|
+
subtest& subtest) override;
|
|
260
265
|
|
|
261
266
|
/**
|
|
262
267
|
* @brief Outputs the suffix for a failing condition.
|
|
263
268
|
*
|
|
264
269
|
* @param location The source location of the failure.
|
|
265
270
|
* @param abort Whether to abort execution after failure.
|
|
271
|
+
* @param subtest The subtest that owns this check.
|
|
266
272
|
* @par Returns
|
|
267
273
|
* Nothing.
|
|
268
274
|
*/
|
|
269
275
|
void
|
|
270
276
|
output_fail_suffix_ (const reflection::source_location& location,
|
|
271
|
-
bool abort) override;
|
|
277
|
+
bool abort, subtest& subtest) override;
|
|
272
278
|
};
|
|
273
279
|
|
|
274
280
|
// --------------------------------------------------------------------------
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* @brief C++ header file with declarations for the µTest++ TAP test reporter.
|
|
21
21
|
*
|
|
22
22
|
* @details
|
|
23
|
-
* This header provides the declaration for `
|
|
24
|
-
* implementation of the `
|
|
23
|
+
* This header provides the declaration for `reporter_tap`, a concrete
|
|
24
|
+
* implementation of the `reporter` abstract interface that formats test
|
|
25
25
|
* results according to the Test Anything Protocol (TAP).
|
|
26
26
|
*
|
|
27
27
|
* All definitions reside within the `micro_os_plus::micro_test_plus`
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
|
|
46
46
|
// ----------------------------------------------------------------------------
|
|
47
47
|
|
|
48
|
-
#include "
|
|
48
|
+
#include "reporter.h"
|
|
49
|
+
#include "reflection.h"
|
|
49
50
|
|
|
50
51
|
// ----------------------------------------------------------------------------
|
|
51
52
|
|
|
@@ -57,21 +58,29 @@
|
|
|
57
58
|
#endif
|
|
58
59
|
#endif
|
|
59
60
|
|
|
61
|
+
// ============================================================================
|
|
62
|
+
|
|
60
63
|
namespace micro_os_plus::micro_test_plus
|
|
61
64
|
{
|
|
62
65
|
// --------------------------------------------------------------------------
|
|
63
66
|
|
|
67
|
+
class runner;
|
|
68
|
+
class suite;
|
|
69
|
+
class subtest;
|
|
70
|
+
|
|
71
|
+
// ==========================================================================
|
|
72
|
+
|
|
64
73
|
/**
|
|
65
|
-
* @brief TAP (Test Anything Protocol) implementation of `
|
|
74
|
+
* @brief TAP (Test Anything Protocol) implementation of `reporter`.
|
|
66
75
|
*
|
|
67
76
|
* @details
|
|
68
|
-
* `
|
|
69
|
-
* `
|
|
77
|
+
* `reporter_tap` provides a concrete implementation of the
|
|
78
|
+
* `reporter` abstract interface that formats test results according to
|
|
70
79
|
* the Test Anything Protocol (TAP). It accumulates output in an internal
|
|
71
80
|
* string buffer and writes it to the standard output stream.
|
|
72
81
|
*
|
|
73
82
|
* Users who require custom output behaviour (e.g. redirecting to a serial
|
|
74
|
-
* port on bare-metal targets) may derive a new class from `
|
|
83
|
+
* port on bare-metal targets) may derive a new class from `reporter`
|
|
75
84
|
* and supply an instance via the `reporter` global pointer before calling
|
|
76
85
|
* `initialize()`.
|
|
77
86
|
*
|
|
@@ -81,186 +90,183 @@ namespace micro_os_plus::micro_test_plus
|
|
|
81
90
|
*
|
|
82
91
|
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
83
92
|
*/
|
|
84
|
-
class
|
|
93
|
+
class reporter_tap final : public reporter
|
|
85
94
|
{
|
|
86
95
|
public:
|
|
87
96
|
/**
|
|
88
|
-
* @brief
|
|
97
|
+
* @brief Constructor for the reporter_tap class.
|
|
89
98
|
*
|
|
90
|
-
* @
|
|
91
|
-
*
|
|
99
|
+
* @param argvs Owning pointer to the command-line arguments vector;
|
|
100
|
+
* the reporter takes ownership via move.
|
|
92
101
|
*/
|
|
93
|
-
|
|
102
|
+
reporter_tap (std::unique_ptr<std::vector<std::string_view>> argvs);
|
|
94
103
|
|
|
95
104
|
/**
|
|
96
105
|
* @brief Deleted copy constructor to prevent copying.
|
|
97
106
|
*/
|
|
98
|
-
|
|
107
|
+
reporter_tap (const reporter_tap&) = delete;
|
|
99
108
|
|
|
100
109
|
/**
|
|
101
110
|
* @brief Deleted move constructor to prevent moving.
|
|
102
111
|
*/
|
|
103
|
-
|
|
112
|
+
reporter_tap (reporter_tap&&) = delete;
|
|
104
113
|
|
|
105
114
|
/**
|
|
106
115
|
* @brief Deleted copy assignment operator to prevent copying.
|
|
107
116
|
*/
|
|
108
|
-
|
|
109
|
-
operator= (const
|
|
117
|
+
reporter_tap&
|
|
118
|
+
operator= (const reporter_tap&)
|
|
110
119
|
= delete;
|
|
111
120
|
|
|
112
121
|
/**
|
|
113
122
|
* @brief Deleted move assignment operator to prevent moving.
|
|
114
123
|
*/
|
|
115
|
-
|
|
116
|
-
operator= (
|
|
124
|
+
reporter_tap&
|
|
125
|
+
operator= (reporter_tap&&)
|
|
117
126
|
= delete;
|
|
118
127
|
|
|
119
128
|
/**
|
|
120
|
-
* @brief Destructor for the
|
|
129
|
+
* @brief Destructor for the reporter_tap class.
|
|
121
130
|
*/
|
|
122
|
-
~
|
|
131
|
+
~reporter_tap () override;
|
|
132
|
+
|
|
133
|
+
// ------------------------------------------------------------------------
|
|
123
134
|
|
|
124
135
|
/**
|
|
125
|
-
* @brief
|
|
136
|
+
* @brief Output operator for the `indent_t` manipulator.
|
|
126
137
|
*
|
|
127
|
-
* @
|
|
128
|
-
*
|
|
129
|
-
* @par Returns
|
|
130
|
-
* Nothing.
|
|
138
|
+
* @param m The indentation manipulator produced by `indent(n)`.
|
|
139
|
+
* @return Reference to the current reporter instance.
|
|
131
140
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
reporter_tap&
|
|
142
|
+
operator<< (detail::indent_t m);
|
|
143
|
+
|
|
144
|
+
// Bring base class operator<< overloads into scope to prevent name hiding.
|
|
145
|
+
using reporter::operator<<;
|
|
146
|
+
|
|
147
|
+
// ------------------------------------------------------------------------
|
|
134
148
|
|
|
135
149
|
/**
|
|
136
|
-
* @brief Mark the beginning of a test
|
|
150
|
+
* @brief Mark the beginning of a test session.
|
|
137
151
|
*
|
|
138
|
-
* @param
|
|
152
|
+
* @param runner Reference to the test runner.
|
|
139
153
|
* @par Returns
|
|
140
154
|
* Nothing.
|
|
141
155
|
*/
|
|
142
156
|
void
|
|
143
|
-
|
|
157
|
+
begin_session (runner& runner) override;
|
|
144
158
|
|
|
145
159
|
/**
|
|
146
|
-
* @brief Mark the end of a test
|
|
160
|
+
* @brief Mark the end of a test session.
|
|
147
161
|
*
|
|
148
|
-
* @param
|
|
162
|
+
* @param runner Reference to the test runner.
|
|
149
163
|
* @par Returns
|
|
150
164
|
* Nothing.
|
|
151
165
|
*/
|
|
152
166
|
void
|
|
153
|
-
|
|
167
|
+
end_session (runner& runner) override;
|
|
154
168
|
|
|
155
169
|
/**
|
|
156
170
|
* @brief Mark the beginning of a test suite.
|
|
157
171
|
*
|
|
158
|
-
* @param
|
|
172
|
+
* @param suite Reference to the test suite.
|
|
159
173
|
* @par Returns
|
|
160
174
|
* Nothing.
|
|
161
175
|
*/
|
|
162
|
-
void
|
|
163
|
-
|
|
176
|
+
virtual void
|
|
177
|
+
begin_suite (suite& suite) override;
|
|
164
178
|
|
|
165
179
|
/**
|
|
166
180
|
* @brief Mark the end of a test suite.
|
|
167
181
|
*
|
|
168
|
-
* @param suite Reference to the test suite
|
|
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.
|
|
182
|
+
* @param suite Reference to the test suite.
|
|
179
183
|
* @par Returns
|
|
180
184
|
* Nothing.
|
|
181
185
|
*/
|
|
182
|
-
void
|
|
183
|
-
|
|
186
|
+
virtual void
|
|
187
|
+
end_suite (suite& suite) override;
|
|
184
188
|
|
|
185
189
|
/**
|
|
186
|
-
* @brief Mark the
|
|
190
|
+
* @brief Mark the beginning of a subtest.
|
|
187
191
|
*
|
|
188
|
-
* @param
|
|
192
|
+
* @param subtest Reference to the subtest.
|
|
189
193
|
* @par Returns
|
|
190
194
|
* Nothing.
|
|
191
195
|
*/
|
|
192
|
-
void
|
|
193
|
-
|
|
196
|
+
virtual void
|
|
197
|
+
begin_subtest (subtest& subtest) override;
|
|
194
198
|
|
|
195
199
|
/**
|
|
196
|
-
* @brief
|
|
200
|
+
* @brief Mark the end of a subtest.
|
|
197
201
|
*
|
|
198
|
-
* @
|
|
199
|
-
* None.
|
|
202
|
+
* @param subtest Reference to the subtest.
|
|
200
203
|
* @par Returns
|
|
201
204
|
* Nothing.
|
|
202
205
|
*/
|
|
203
|
-
void
|
|
204
|
-
|
|
206
|
+
virtual void
|
|
207
|
+
end_subtest (subtest& subtest) override;
|
|
205
208
|
|
|
206
209
|
/**
|
|
207
|
-
* @brief
|
|
210
|
+
* @brief Returns the TAP comment prefix string `"# "`.
|
|
208
211
|
*
|
|
209
212
|
* @par Parameters
|
|
210
213
|
* None.
|
|
211
|
-
* @
|
|
212
|
-
*
|
|
214
|
+
* @return The string `"# "`, used to prefix comment lines in TAP
|
|
215
|
+
* output.
|
|
213
216
|
*/
|
|
214
|
-
|
|
215
|
-
|
|
217
|
+
virtual const char*
|
|
218
|
+
get_comment_prefix (void) override;
|
|
216
219
|
|
|
217
220
|
protected:
|
|
218
221
|
/**
|
|
219
222
|
* @brief Outputs the prefix for a passing condition.
|
|
220
223
|
*
|
|
221
224
|
* @param message The message to display.
|
|
225
|
+
* @param subtest The subtest that owns this check.
|
|
222
226
|
* @par Returns
|
|
223
227
|
* Nothing.
|
|
224
228
|
*/
|
|
225
229
|
void
|
|
226
|
-
output_pass_prefix_ (std::string& message) override;
|
|
230
|
+
output_pass_prefix_ (std::string& message, subtest& subtest) override;
|
|
227
231
|
|
|
228
232
|
/**
|
|
229
233
|
* @brief Outputs the suffix for a passing condition.
|
|
230
234
|
*
|
|
231
|
-
* @
|
|
232
|
-
* None.
|
|
235
|
+
* @param subtest The subtest that owns this check.
|
|
233
236
|
* @par Returns
|
|
234
237
|
* Nothing.
|
|
235
238
|
*/
|
|
236
239
|
void
|
|
237
|
-
output_pass_suffix_ (
|
|
240
|
+
output_pass_suffix_ (subtest& subtest) override;
|
|
238
241
|
|
|
239
242
|
/**
|
|
240
243
|
* @brief Outputs the prefix for a failing condition.
|
|
241
244
|
*
|
|
242
245
|
* @param message The message to display.
|
|
243
|
-
* @param
|
|
246
|
+
* @param has_expression Whether the failure is associated with an
|
|
244
247
|
* expression.
|
|
245
248
|
* @param location The source location of the failure.
|
|
249
|
+
* @param subtest The subtest that owns this check.
|
|
246
250
|
* @par Returns
|
|
247
251
|
* Nothing.
|
|
248
252
|
*/
|
|
249
253
|
void
|
|
250
|
-
output_fail_prefix_ (std::string& message, const bool
|
|
251
|
-
const reflection::source_location& location
|
|
254
|
+
output_fail_prefix_ (std::string& message, const bool has_expression,
|
|
255
|
+
const reflection::source_location& location,
|
|
256
|
+
subtest& subtest) override;
|
|
252
257
|
|
|
253
258
|
/**
|
|
254
259
|
* @brief Outputs the suffix for a failing condition.
|
|
255
260
|
*
|
|
256
261
|
* @param location The source location of the failure.
|
|
257
262
|
* @param abort Whether to abort execution after failure.
|
|
263
|
+
* @param subtest The subtest that owns this check.
|
|
258
264
|
* @par Returns
|
|
259
265
|
* Nothing.
|
|
260
266
|
*/
|
|
261
267
|
void
|
|
262
268
|
output_fail_suffix_ (const reflection::source_location& location,
|
|
263
|
-
bool abort) override;
|
|
269
|
+
bool abort, subtest& subtest) override;
|
|
264
270
|
};
|
|
265
271
|
|
|
266
272
|
// --------------------------------------------------------------------------
|