@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
|
@@ -1,492 +0,0 @@
|
|
|
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++ test suite.
|
|
21
|
-
*
|
|
22
|
-
* @details
|
|
23
|
-
* This header provides the declarations for the test suite facilities used
|
|
24
|
-
* within the µTest++ framework. It defines the interfaces for constructing,
|
|
25
|
-
* registering, and managing test suites and their associated test cases. The
|
|
26
|
-
* core classes, `test_suite_base` and `test_suite`, offer mechanisms for
|
|
27
|
-
* tracking test case execution, managing counters for successful and failed
|
|
28
|
-
* checks, and supporting automated registration and discovery of test suites.
|
|
29
|
-
*
|
|
30
|
-
* The design ensures that test suites are non-copyable and non-movable,
|
|
31
|
-
* maintaining unique ownership and consistent state. Flexible support for
|
|
32
|
-
* callable objects enables a wide range of test suite definitions,
|
|
33
|
-
* facilitating expressive and maintainable test organisation across embedded
|
|
34
|
-
* and general C++ projects.
|
|
35
|
-
*
|
|
36
|
-
* All definitions reside within the `micro_os_plus::micro_test_plus`
|
|
37
|
-
* namespace, ensuring clear separation from user code and minimising the risk
|
|
38
|
-
* of naming conflicts.
|
|
39
|
-
*
|
|
40
|
-
* The header files are organised within the
|
|
41
|
-
* `include/micro-os-plus/micro-test-plus` folder to maintain a structured and
|
|
42
|
-
* modular codebase.
|
|
43
|
-
*
|
|
44
|
-
* This file is intended solely for internal use within the framework and
|
|
45
|
-
* should not be included directly by user code.
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
#ifndef MICRO_TEST_PLUS_TEST_SUITE_H_
|
|
49
|
-
#define MICRO_TEST_PLUS_TEST_SUITE_H_
|
|
50
|
-
|
|
51
|
-
// ----------------------------------------------------------------------------
|
|
52
|
-
|
|
53
|
-
#include <time.h>
|
|
54
|
-
|
|
55
|
-
#ifdef __cplusplus
|
|
56
|
-
|
|
57
|
-
// ----------------------------------------------------------------------------
|
|
58
|
-
|
|
59
|
-
#include <functional>
|
|
60
|
-
|
|
61
|
-
// ----------------------------------------------------------------------------
|
|
62
|
-
|
|
63
|
-
#if defined(__GNUC__)
|
|
64
|
-
#pragma GCC diagnostic push
|
|
65
|
-
#pragma GCC diagnostic ignored "-Wpadded"
|
|
66
|
-
#if !defined(__clang__) // GCC only
|
|
67
|
-
#pragma GCC diagnostic ignored "-Wsuggest-final-types"
|
|
68
|
-
#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
|
|
69
|
-
#endif
|
|
70
|
-
#if defined(__clang__)
|
|
71
|
-
#pragma clang diagnostic ignored "-Wc++98-compat"
|
|
72
|
-
#endif
|
|
73
|
-
#endif
|
|
74
|
-
|
|
75
|
-
namespace micro_os_plus::micro_test_plus
|
|
76
|
-
{
|
|
77
|
-
// --------------------------------------------------------------------------
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @brief Base class for all test suites.
|
|
81
|
-
*
|
|
82
|
-
* @details
|
|
83
|
-
* The `test_suite_base` class provides the foundational interface for
|
|
84
|
-
* managing test suites within the µTest++ framework. It maintains counters
|
|
85
|
-
* for successful and failed checks, tracks test cases, and offers methods
|
|
86
|
-
* for marking the commencement and completion of test cases and suites.
|
|
87
|
-
*
|
|
88
|
-
* This class ensures consistent state management and reporting for all
|
|
89
|
-
* derived test suites. It also provides utility methods for querying the
|
|
90
|
-
* suite's name, the number of successful and failed checks, the number of
|
|
91
|
-
* test cases, and the overall result of the suite.
|
|
92
|
-
*
|
|
93
|
-
* All members and methods are defined within the
|
|
94
|
-
* `micro_os_plus::micro_test_plus` namespace, ensuring clear separation from
|
|
95
|
-
* user code and minimising the risk of naming conflicts.
|
|
96
|
-
*
|
|
97
|
-
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
98
|
-
*/
|
|
99
|
-
class test_suite_base
|
|
100
|
-
{
|
|
101
|
-
public:
|
|
102
|
-
/**
|
|
103
|
-
* @brief Constructs a test suite.
|
|
104
|
-
*
|
|
105
|
-
* @param [in] name The test suite name.
|
|
106
|
-
*
|
|
107
|
-
* @details
|
|
108
|
-
* The rule of five is enforced to prevent accidental copying or moving.
|
|
109
|
-
*/
|
|
110
|
-
test_suite_base (const char* name);
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @brief Deleted copy constructor to prevent copying.
|
|
114
|
-
*/
|
|
115
|
-
test_suite_base (const test_suite_base&) = delete;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* @brief Deleted move constructor to prevent moving.
|
|
119
|
-
*/
|
|
120
|
-
test_suite_base (test_suite_base&&) = delete;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* @brief Deleted copy assignment operator to prevent copying.
|
|
124
|
-
*/
|
|
125
|
-
test_suite_base&
|
|
126
|
-
operator= (const test_suite_base&)
|
|
127
|
-
= delete;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @brief Deleted move assignment operator to prevent moving.
|
|
131
|
-
*/
|
|
132
|
-
test_suite_base&
|
|
133
|
-
operator= (test_suite_base&&)
|
|
134
|
-
= delete;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* @brief Virtual destructor for the test_suite_base class.
|
|
138
|
-
*/
|
|
139
|
-
virtual ~test_suite_base ();
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @brief Runs the sequence of test cases in the suite.
|
|
143
|
-
*
|
|
144
|
-
* @par Parameters
|
|
145
|
-
* None.
|
|
146
|
-
* @par Returns
|
|
147
|
-
* Nothing.
|
|
148
|
-
*/
|
|
149
|
-
virtual void
|
|
150
|
-
run (void);
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @brief Marks the beginning of a named test case.
|
|
154
|
-
*
|
|
155
|
-
* @param [in] name The test case name.
|
|
156
|
-
* @par Returns
|
|
157
|
-
* Nothing.
|
|
158
|
-
*/
|
|
159
|
-
void
|
|
160
|
-
begin_test_case (const char* name);
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* @brief Marks the end of a test case.
|
|
164
|
-
*
|
|
165
|
-
* @par Parameters
|
|
166
|
-
* None.
|
|
167
|
-
* @par Returns
|
|
168
|
-
* Nothing. */
|
|
169
|
-
void
|
|
170
|
-
end_test_case (void);
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @brief Gets the suite name.
|
|
174
|
-
*
|
|
175
|
-
* @par Parameters
|
|
176
|
-
* None.
|
|
177
|
-
* @return A pointer to the null-terminated test suite name.
|
|
178
|
-
*/
|
|
179
|
-
[[nodiscard]] constexpr const char*
|
|
180
|
-
name (void)
|
|
181
|
-
{
|
|
182
|
-
return name_;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @brief Increments the count of passed test conditions.
|
|
187
|
-
*
|
|
188
|
-
* @par Parameters
|
|
189
|
-
* None.
|
|
190
|
-
* @par Returns
|
|
191
|
-
* Nothing.
|
|
192
|
-
*/
|
|
193
|
-
void
|
|
194
|
-
increment_successful (void);
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* @brief Increments the count of failed test conditions.
|
|
198
|
-
*
|
|
199
|
-
* @par Parameters
|
|
200
|
-
* None.
|
|
201
|
-
* @par Returns
|
|
202
|
-
* Nothing.
|
|
203
|
-
*/
|
|
204
|
-
void
|
|
205
|
-
increment_failed (void);
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* @brief Gets the number of conditions that passed.
|
|
209
|
-
*
|
|
210
|
-
* @par Parameters
|
|
211
|
-
* None.
|
|
212
|
-
* @return An integer with the number of checks that passed.
|
|
213
|
-
*/
|
|
214
|
-
[[nodiscard]] constexpr size_t
|
|
215
|
-
successful_checks (void)
|
|
216
|
-
{
|
|
217
|
-
return successful_checks_;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @brief Gets the number of test conditions that failed.
|
|
222
|
-
*
|
|
223
|
-
* @par Parameters
|
|
224
|
-
* None.
|
|
225
|
-
* @return An integer with the number of checks that failed.
|
|
226
|
-
*/
|
|
227
|
-
[[nodiscard]] constexpr size_t
|
|
228
|
-
failed_checks (void)
|
|
229
|
-
{
|
|
230
|
-
return failed_checks_;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @brief Gets the number of test cases.
|
|
235
|
-
*
|
|
236
|
-
* @par Parameters
|
|
237
|
-
* None.
|
|
238
|
-
* @return An integer with the number of test cases.
|
|
239
|
-
*/
|
|
240
|
-
[[nodiscard]] constexpr size_t
|
|
241
|
-
test_cases_count (void)
|
|
242
|
-
{
|
|
243
|
-
return test_cases_count_;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* @brief Begins the execution of the test suite.
|
|
248
|
-
*
|
|
249
|
-
* @par Parameters
|
|
250
|
-
* None.
|
|
251
|
-
* @par Returns
|
|
252
|
-
* Nothing.
|
|
253
|
-
*/
|
|
254
|
-
void
|
|
255
|
-
begin_test_suite (void);
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @brief Marks the end of the test suite.
|
|
259
|
-
*
|
|
260
|
-
* @par Parameters
|
|
261
|
-
* None.
|
|
262
|
-
* @par Returns
|
|
263
|
-
* Nothing.
|
|
264
|
-
*/
|
|
265
|
-
void
|
|
266
|
-
end_test_suite (void);
|
|
267
|
-
|
|
268
|
-
#if defined(_WIN32) || defined(CLOCK_MONOTONIC)
|
|
269
|
-
/**
|
|
270
|
-
* @brief Computes the elapsed time between `begin_time` and `end_time`.
|
|
271
|
-
*
|
|
272
|
-
* @param [out] milliseconds The elapsed time in whole milliseconds.
|
|
273
|
-
* @param [out] microseconds The sub-millisecond remainder in microseconds
|
|
274
|
-
* (0–999).
|
|
275
|
-
* @par Returns
|
|
276
|
-
* Nothing.
|
|
277
|
-
*/
|
|
278
|
-
void
|
|
279
|
-
compute_elapsed_time (timespec& begin_time, timespec& end_time,
|
|
280
|
-
long& milliseconds, long& microseconds);
|
|
281
|
-
#endif
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* @brief Gets the test suite result.
|
|
285
|
-
*
|
|
286
|
-
* @par Parameters
|
|
287
|
-
* None.
|
|
288
|
-
* @return True if the test suite was successful.
|
|
289
|
-
*/
|
|
290
|
-
[[nodiscard]] constexpr bool
|
|
291
|
-
was_successful (void)
|
|
292
|
-
{
|
|
293
|
-
// Also fail if none passed.
|
|
294
|
-
return (failed_checks_ == 0 && successful_checks_ != 0);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* @brief Checks if the test suite was not used.
|
|
299
|
-
*
|
|
300
|
-
* @par Parameters
|
|
301
|
-
* None.
|
|
302
|
-
* @return True if the test suite is not used.
|
|
303
|
-
*/
|
|
304
|
-
[[nodiscard]] constexpr bool
|
|
305
|
-
unused (void)
|
|
306
|
-
{
|
|
307
|
-
return (failed_checks_ == 0 && successful_checks_ == 0
|
|
308
|
-
&& test_cases_count_ == 0);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
protected:
|
|
312
|
-
/**
|
|
313
|
-
* @brief The test suite name.
|
|
314
|
-
*/
|
|
315
|
-
const char* name_;
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* @brief The current test case name.
|
|
319
|
-
*/
|
|
320
|
-
const char* test_case_name_;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* @brief Count of test conditions that passed.
|
|
324
|
-
*/
|
|
325
|
-
size_t successful_checks_ = 0;
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* @brief Count of test conditions that failed.
|
|
329
|
-
*/
|
|
330
|
-
size_t failed_checks_ = 0;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* @brief Count of test cases in the test suite.
|
|
334
|
-
*/
|
|
335
|
-
size_t test_cases_count_ = 0;
|
|
336
|
-
|
|
337
|
-
public:
|
|
338
|
-
/**
|
|
339
|
-
* @brief The test suite index, counting from 1.
|
|
340
|
-
*/
|
|
341
|
-
size_t index = 1;
|
|
342
|
-
|
|
343
|
-
#if defined(_WIN32) || defined(CLOCK_MONOTONIC)
|
|
344
|
-
/**
|
|
345
|
-
* @brief The timestamp recorded at the beginning of the test suite.
|
|
346
|
-
*/
|
|
347
|
-
timespec begin_time{};
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* @brief The timestamp recorded at the end of the test suite.
|
|
351
|
-
*/
|
|
352
|
-
timespec end_time{};
|
|
353
|
-
#endif
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* @brief Indicates whether to process deferred begin for test cases.
|
|
357
|
-
*/
|
|
358
|
-
bool process_deferred_begin = true;
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* @brief Structure holding the current test case's check counters.
|
|
362
|
-
*
|
|
363
|
-
* @details
|
|
364
|
-
* Tracks the number of successful and failed checks for the currently
|
|
365
|
-
* running test case.
|
|
366
|
-
*/
|
|
367
|
-
struct
|
|
368
|
-
{
|
|
369
|
-
/**
|
|
370
|
-
* @brief Number of successful checks in the current test case.
|
|
371
|
-
*/
|
|
372
|
-
size_t successful_checks = 0;
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* @brief Number of failed checks in the current test case.
|
|
376
|
-
*/
|
|
377
|
-
size_t failed_checks = 0;
|
|
378
|
-
|
|
379
|
-
size_t index = 0;
|
|
380
|
-
} current_test_case{};
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* @ingroup micro-test-plus-test-suites
|
|
385
|
-
* @brief Represents a named group of test cases that self-register to the
|
|
386
|
-
* runner.
|
|
387
|
-
*
|
|
388
|
-
* @details
|
|
389
|
-
* The `test_suite` class extends `test_suite_base` and enables the
|
|
390
|
-
* registration and execution of callable objects (such as lambdas or
|
|
391
|
-
* function pointers) as test suites. Upon construction, each test suite
|
|
392
|
-
* automatically registers itself with the test runner, facilitating
|
|
393
|
-
* automated test discovery and execution across different components and
|
|
394
|
-
* folders of a project.
|
|
395
|
-
*
|
|
396
|
-
* This class template provides a flexible mechanism for grouping related
|
|
397
|
-
* test cases and managing their execution within the µTest++ framework. It
|
|
398
|
-
* ensures that test suites are non-copyable and non-movable, maintaining
|
|
399
|
-
* unique ownership and consistent state.
|
|
400
|
-
*
|
|
401
|
-
* All members and methods are defined within the
|
|
402
|
-
* `micro_os_plus::micro_test_plus` namespace, ensuring clear separation from
|
|
403
|
-
* user code and minimising the risk of naming conflicts.
|
|
404
|
-
*
|
|
405
|
-
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
406
|
-
*/
|
|
407
|
-
class test_suite : public test_suite_base
|
|
408
|
-
{
|
|
409
|
-
public:
|
|
410
|
-
/**
|
|
411
|
-
* @brief Class template constructor for test_suite.
|
|
412
|
-
*
|
|
413
|
-
* @tparam Callable_T The type of a callable object.
|
|
414
|
-
* @tparam Args_T The types of the callable arguments.
|
|
415
|
-
*
|
|
416
|
-
* @param [in] name The test case name or description, used in reports.
|
|
417
|
-
* @param [in] callable A generic callable object, usually a lambda,
|
|
418
|
-
* invoked to perform the test.
|
|
419
|
-
* @param [in] arguments A possibly empty list of arguments to be passed to
|
|
420
|
-
* the callable.
|
|
421
|
-
*
|
|
422
|
-
* @details
|
|
423
|
-
* The rule of five is enforced to prevent accidental copying or moving.
|
|
424
|
-
*/
|
|
425
|
-
template <typename Callable_T, typename... Args_T>
|
|
426
|
-
test_suite (const char* name, Callable_T&& callable,
|
|
427
|
-
Args_T&&... arguments);
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* @brief Deleted copy constructor to prevent copying.
|
|
431
|
-
*/
|
|
432
|
-
test_suite (const test_suite&) = delete;
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* @brief Deleted move constructor to prevent moving.
|
|
436
|
-
*/
|
|
437
|
-
test_suite (test_suite&&) = delete;
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* @brief Deleted copy assignment operator to prevent copying.
|
|
441
|
-
*/
|
|
442
|
-
test_suite&
|
|
443
|
-
operator= (const test_suite&)
|
|
444
|
-
= delete;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* @brief Deleted move assignment operator to prevent moving.
|
|
448
|
-
*/
|
|
449
|
-
test_suite&
|
|
450
|
-
operator= (test_suite&&)
|
|
451
|
-
= delete;
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* @brief Virtual destructor for the test_suite class.
|
|
455
|
-
*/
|
|
456
|
-
virtual ~test_suite () override;
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* @brief Runs the sequence of test cases in the suite by invoking the
|
|
460
|
-
* stored callable.
|
|
461
|
-
*
|
|
462
|
-
* @par Parameters
|
|
463
|
-
* None.
|
|
464
|
-
* @par Returns
|
|
465
|
-
* Nothing.
|
|
466
|
-
*/
|
|
467
|
-
virtual void
|
|
468
|
-
run (void) override;
|
|
469
|
-
|
|
470
|
-
protected:
|
|
471
|
-
/**
|
|
472
|
-
* @brief Callable object representing the test suite's execution logic.
|
|
473
|
-
*/
|
|
474
|
-
std::function<void (void)> callable_;
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
// --------------------------------------------------------------------------
|
|
478
|
-
} // namespace micro_os_plus::micro_test_plus
|
|
479
|
-
|
|
480
|
-
#if defined(__GNUC__)
|
|
481
|
-
#pragma GCC diagnostic pop
|
|
482
|
-
#endif
|
|
483
|
-
|
|
484
|
-
// ----------------------------------------------------------------------------
|
|
485
|
-
|
|
486
|
-
#endif // __cplusplus
|
|
487
|
-
|
|
488
|
-
// ----------------------------------------------------------------------------
|
|
489
|
-
|
|
490
|
-
#endif // MICRO_TEST_PLUS_TEST_SUITE_H_
|
|
491
|
-
|
|
492
|
-
// ----------------------------------------------------------------------------
|