@micro-os-plus/micro-test-plus 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,182 +6,404 @@ Please check
6
6
  [GitHub](https://github.com/micro-os-plus/micro-test-plus-xpack/issues/)
7
7
  and close existing issues and pull requests.
8
8
 
9
+ ## 2022-04-05
10
+
11
+ * 3.0.1
12
+ * d8f24e6 #5 add parametrised test suites
13
+
14
+ ## 2022-04-03
15
+
16
+ * c3053d5 3.0.0
17
+
18
+ ## 2022-04-01
19
+
20
+ * a944962 test-reporter.cpp: use check marks for suites
21
+ * de8065f add support for unused main test suite
22
+
23
+ ## 2022-03-31
24
+
25
+ * ab6a3d5 try parametrized test suites; not ready
26
+ * 3eb96f7 sample-test: explicit namespaces
27
+
28
+ ## 2022-03-28
29
+
30
+ * 0b8ab47 launch.json: --verbose unit-test
31
+ * aa405f5 test-reporter minor rework
32
+ * c5a6e54 implement assume() with the same deferred_reporter
33
+ * 4906cd5 test-reporter: add output() method
34
+ * db00b7f add reported_ and run()
35
+
36
+ ## 2022-03-27
37
+
38
+ * 11bcfd1 bump build-helper 2.6.3
39
+ * 5afa470 CI: bump clang13
40
+ * 3020ffe optimise deferred reporters
41
+
42
+ ## 2022-03-26
43
+
44
+ * d8b9071 revert to build-helper 2.6.1
45
+ * 602d5d8 implement expect() << "message"
46
+ * 14ce153 package.json: meson platform toolchain files
47
+ * 367b706 unit-test.cpp: fix __xx warning
48
+ * 3ec0a21 add clang13
49
+ * 356f2f9 package.json: bump cmake & meson
50
+
51
+ ## 2022-03-23
52
+
53
+ * 255d4e5 README updates
54
+ * c837032 package.json: bump buld-helper 2.6.2
55
+ * 49a3129 package.json: bump gcc 11.2.0-3.3
56
+ * 568d799 revert to interface library
57
+
58
+ ## 2022-03-21
59
+
60
+ * c3729b8 process_deferred_begin
61
+ * 601c428 unit-tests fix messages
62
+ * 7340d7b printf string_view content
63
+ * 0a5bb6b test-reporter cosmetics (.)
64
+ * 4871095 colors as const char*
65
+ * f9c25c8 meson: update for static library
66
+
67
+ ## 2022-03-20
68
+
69
+ * 79d72b2 README add Getting Started
70
+ * 8bb653f constexpr evaluate_and_report_
71
+ * c993275 reorder initialize()
72
+ * ebfb155 remove redundant pass()/fail()
73
+ * 03cc86d test-runner: argv[] cosmetics
74
+ * 3904bcb #pragma cleanups
75
+ * 7fe3bfd group several small *-inlines.h together
76
+ * 11fe6e8 add utility namespace
77
+ * 065824a unit-test: add static checks
78
+ * 48faa97 unit-test: add reflection::type_name() test
79
+ * 85aec05 unit-test: silence warning
80
+ * 7342f2c math.h: silence warning
81
+ * 4aeaa0d reflection: fix type_name()
82
+ * 7d6bd77 reflection.h: fix clang non apple
83
+ * 02eda65 reflection.h: warning/error in type_name()
84
+ * c5ab1d2 launch: add (gdb) native-cmake-clang12-debug
85
+
86
+ ## 2022-03-17
87
+
88
+ * 01e6a21 unit-test.cpp: rename tests
89
+ * 327441d implement different verbosity
90
+ * 904e3ff remove trace in eq_
91
+
92
+ ## 2022-03-16
93
+
94
+ * 116571d bump build-helper 2.6.1
95
+
96
+ ## 2022-03-15
97
+
98
+ * d15b203 change to static library
99
+ * ad94a46 remove dependency from diag-trace, use printf()
100
+ * 9d387c8 reporter: disable unused generic <<
101
+ * eebde5f reporter: rework constant suffixes
102
+ * b43d2b0 reporter.fail print value only if is_op_v
103
+ * dca5409 literals.h: add comments
104
+ * d9021c4 sample-test update for new README examples
105
+ * df5d8b5 update README and docs
106
+ * cd3f97d split detail-inlines.h
107
+
108
+ ## 2022-03-14
109
+
110
+ * f64083c revert from operators to functions
111
+ * 3ec0454 unit-test: add logical & operators
112
+ * d0d689a unit-test silence -Wdouble-promotion
113
+ * a635d1a docs & cosmetics
114
+ * f346a7a rename Callable_T
115
+ * ed9d0f2 .vscode/launch: add unit-test
116
+ * dc6ccca remove unused pointer _and(), _or(), _not()
117
+ * 67e2c43 fix meson -Wno-used-but-marked-unused
118
+ * 120c675 -Wno-used-but-marked-unused for clang on windows
119
+ * a6fee32 CI install --quiet
120
+ * 7e67230 add -Wno-missing-include-dirs to build
121
+ * b059c71 silence -Wmissing-include-dirs for GCC too
122
+ * 263b87e silence clang -Wmissing-include-dirs
123
+ * 1e8fc05 cosmetics
124
+ * 285a86a rework #includes
125
+ * 52fc562 split test-reporter & detail
126
+ * 17b0e3e split test-runner.h
127
+ * 62c7539 split inlines
128
+ * 2256fbf rename type-traits.h
129
+ * adc648e enable -Werror for native
130
+ * 037c767 split test-suite.cpp
131
+ * a80ea1a test-suite invokes reporter
132
+ * ce4c241 split test-suite.h
133
+ * a4a262a cleanup print_expr declaration
134
+ * 4b1984c split test-reporter.cpp
135
+ * e74786e split test-runner.cpp
136
+ * e4c7ed4 literals add docu
137
+ * 2f5efdd move casts to literals.h
138
+ * b1a0b55 move struct value to type_traits
139
+ * a9ec726 split literals.h
140
+ * bd64244 more type_triats moves
141
+ * 5a98f64 remove unused struct type_
142
+ * 8176edc move op & _constants to type_traits.h
143
+ * 658bf72 silence warnings
144
+ * 8407e38 fix type_traits guard
145
+
146
+ ## 2022-03-13
147
+
148
+ * 1d5e4a9 docs
149
+ * 00e26c1 separate test_reporter implementation & inlines
150
+ * 7700eee rename Other_T
151
+ * 1c760ba split type_traits.h
152
+ * 2d7d4e8 split math.h
153
+ * c6b33c0 include source_location in reflection.h
154
+ * 149bbf5 rename Xxx_T
155
+ * ccd6482 split reflection.h
156
+ * 33390a4 remove deprecated expect_equal()
157
+ * cf4831a remove unused operators
158
+ * 33e84e9 add operators
159
+ * 63714b9 unit-test cleanup
160
+ * 51bb43c use evaluate_and_report_()
161
+ * 35a1ad1 unit-test: expect() without message
162
+ * 4cbe008 add explicit _not _and _or
163
+ * b36dfa6 move to detail::assertion
164
+ * 6dac36c README: mention string comparisons
165
+ * 8d04508 unit-test: cleanups & comments
166
+ * 5b2153d unit-test: check default messages
167
+ * eef5709 sample test pass() message
168
+ * cfd924d sample-test: include string_view
169
+ * 3968eef add @brief and comments
170
+ * 48ea51e reorder and cleanup operator <<
171
+ * 52e2fbc simplify trace eq_ messages
172
+ * 1d63119 provide a default for the message
173
+ * db9ae66 add type suffixes when displaying scalar values
174
+ * 406d48e add genuine_integral_value{}
175
+ * 8fb68ae cosmetics
176
+ * 18163a0 unit_test major rewrite
177
+ * e9e3fa2 sample-test: use string_view
178
+ * ddcd2a2 cmake cleanup
179
+ * 86996ed cmake xpack_create_hex
180
+ * ff53277 cmake add SIZE
181
+ * a34a283 cmake add report SIZE
182
+
183
+ ## 2022-03-12
184
+
185
+ * f657ba0 add literals & more types
186
+ * f1676c1 more flush
187
+ * 357aefb rework operator<<
188
+ * 9250199 add more trace::printf
189
+ * fd7cf12 silence warnings
190
+ * ee30f22 more flush()
191
+ * d8e8900 add assume() with abort
192
+ * 646d374 add runner.name()
193
+
194
+ ## 2022-03-03
195
+
196
+ * 3f84859 consistent copyright notices
197
+ * 278aff5 Add reference to boost license in copyright notice
198
+ * 28b5887 README: update for v3.x
199
+ * 2419718 add boost license
200
+ * 4e02d9d meson cosmetics
201
+ * 6ed18d2 package.json: native only on darwin
202
+ * d416cb3 quiet installs
203
+ * f93be58 package.json: remove gcc8
204
+ * 8d468c5 rework cmake & meson
205
+ * 687072c silence warnings
206
+ * b2bf818 sample-test: fix check args
207
+ * 2cf994c sample-test: silence warnings
208
+ * 6aed55a unit-test: temporarily disabled
209
+
210
+ ## 2022-03-02
211
+
212
+ * 7117f36 launch.json: update
213
+ * b9bdb0f sample-test: rework with new comparators
214
+ * 8f0bc1f rework based on boost ut
215
+ * 58c0ba8 native/config.h comment _STDERR
216
+
217
+ ## 2022-03-01
218
+
219
+ * db86cd1 add test_suite
220
+
221
+ ## 2022-02-28
222
+
223
+ * 1120ed7 migrate to non-class functions
224
+
225
+ ## 2022-02-27
226
+
227
+ * b3c12ab C++20
228
+ * c694f49 MICRO_OS_PLUS_TRACE
229
+ * f43a1ab platform-native/config.h: TRACE buffer 500
230
+
9
231
  ## 2022-02-19
10
232
 
11
- - v2.3.0
12
- - 94b340c use nested namespaces
13
- - f921bf0 sample-test: cleanup globals
14
- - 66df97e add support for test-all
15
- - f6c19d2 cmake globals add -fdiagnostics-color=always
16
- - 28efe4b add parameterised tests and combinatorials
17
- - 560b678 add run_test_case variadic template
18
- - 436a1ae deprecate run_test_case(func, name)
19
- - 0a6a46b add start_test_case()
233
+ * v2.3.0
234
+ * 94b340c use nested namespaces
235
+ * f921bf0 sample-test: cleanup globals
236
+ * 66df97e add support for test-all
237
+ * f6c19d2 cmake globals add -fdiagnostics-color=always
238
+ * 28efe4b add parameterised tests and combinatorials
239
+ * 560b678 add run_test_case variadic template
240
+ * 436a1ae deprecate run_test_case(func, name)
241
+ * 0a6a46b add start_test_case()
20
242
 
21
243
  ## 2022-02-18
22
244
 
23
- - 5d0e9be package.json bump helper
24
- - 69d6dec rework expect_equal with templates
245
+ * 5d0e9be package.json bump helper
246
+ * 69d6dec rework expect_equal with templates
25
247
 
26
248
  ## 2022-02-16
27
249
 
28
- - 9d97cb1 meson: remove utf-8 chars
250
+ * 9d97cb1 meson: remove utf-8 chars
29
251
 
30
252
  ## 2022-02-10
31
253
 
32
- - 776845a .c* include <micro-os-plus/config.h>
33
- - 8f3e441 meson.build cosmetics
254
+ * 776845a .c* include <micro-os-plus/config.h>
255
+ * 8f3e441 meson.build cosmetics
34
256
 
35
257
  ## 2022-02-09
36
258
 
37
- - 4fcb75d MICRO_OS_PLUS_INCLUDE_CONFIG_H
38
- - 81186d0 rename MICRO_OS_PLUS_DEBUG
259
+ * 4fcb75d MICRO_OS_PLUS_INCLUDE_CONFIG_H
260
+ * 81186d0 rename MICRO_OS_PLUS_DEBUG
39
261
 
40
262
  ## 2022-02-08
41
263
 
42
- - 9c23c7d package.json: disable stm32f4 on Apple Silicon
43
- - 3969095 package.json: bump clang
44
- - 623e72d rename MICRO_OS_PLUS_TRACE
264
+ * 9c23c7d package.json: disable stm32f4 on Apple Silicon
265
+ * 3969095 package.json: bump clang
266
+ * 623e72d rename MICRO_OS_PLUS_TRACE
45
267
 
46
268
  ## 2022-02-06
47
269
 
48
- - f1a8f80 MICRO_OS_PLUS_HAS_CONFIG_H
49
- - 4d46a63 disable -flto on armv7l
270
+ * f1a8f80 MICRO_OS_PLUS_HAS_CONFIG_H
271
+ * 4d46a63 disable -flto on armv7l
50
272
 
51
273
  ## 2022-02-05
52
274
 
53
- - v2.2.1
54
- - 473d3f3 package.json: use npmjs.com deps
55
- - b88b767 CI.yml try to enable qemu-cmake on Windows
56
- - 518645c package.json: enable cortexm builds on windows
57
- - e342558 meson create symbolic link at build time
58
- - 00ff79d cmake revert to .. instead of top symlink
59
- - 68053a5 package.json: bump build-helper
60
- - 65918f6 cmake notice that -flto fails on embedded
61
- - 868c55d meson native with_linux_clang_lto
62
- - a223600 meson: notice that -flto fails on embedded
63
- - bb3628a meson always include warnings
64
- - 1d1e612 meson revert to warning_level = 0
65
- - cc41eac meson native without -flto
66
- - d562a5e cmake native add --gc-sections
67
- 4bee003 cmake globals -flto for release
68
- - c2c7972 package.json: bump devices-stm32f4-extras
69
- - 6139edb meson: disable -flto for clang on linux
275
+ * v2.2.1
276
+ * 473d3f3 package.json: use npmjs.com deps
277
+ * b88b767 CI.yml try to enable qemu-cmake on Windows
278
+ * 518645c package.json: enable cortexm builds on windows
279
+ * e342558 meson create symbolic link at build time
280
+ * 00ff79d cmake revert to .. instead of top symlink
281
+ * 68053a5 package.json: bump build-helper
282
+ * 65918f6 cmake notice that -flto fails on embedded
283
+ * 868c55d meson native with_linux_clang_lto
284
+ * a223600 meson: notice that -flto fails on embedded
285
+ * bb3628a meson always include warnings
286
+ * 1d1e612 meson revert to warning_level = 0
287
+ * cc41eac meson native without -flto
288
+ * d562a5e cmake native add --gc-sections
289
+ * 4bee003 cmake globals -flto for release
290
+ * c2c7972 package.json: bump devices-stm32f4-extras
291
+ * 6139edb meson: disable -flto for clang on linux
70
292
 
71
293
  ## 2022-02-04
72
294
 
73
- - v2.2.0
74
- - 18219ef package.json: bump deps
75
- - d30ea7d updates for device-*cortexm
76
- - 33e2244 cmake: add xpack_display_target_lists
77
- - 4f7324b package.json: add stm32f4discovery meson
295
+ * v2.2.0
296
+ * 18219ef package.json: bump deps
297
+ * d30ea7d updates for device-*cortexm
298
+ * 33e2244 cmake: add xpack_display_target_lists
299
+ * 4f7324b package.json: add stm32f4discovery meson
78
300
 
79
301
  ## 2022-02-03
80
302
 
81
- - d64bd80 cmake update qemu-mps2
82
- - 18955fa cmake update stm32f4discovery
83
- - e4541e9 cmake update for interface
303
+ * d64bd80 cmake update qemu-mps2
304
+ * 18955fa cmake update stm32f4discovery
305
+ * e4541e9 cmake update for interface
84
306
 
85
307
  ## 2022-02-02
86
308
 
87
- - e703fa9 .vscode/launch.json: add qemu launchers
88
- - 3055967 cmake: rework test commands
309
+ * e703fa9 .vscode/launch.json: add qemu launchers
310
+ * 3055967 cmake: rework test commands
89
311
 
90
312
  ## 2022-02-01
91
313
 
92
- - 90e894f add meson qemu
93
- - 6f55a37 package.json: rename dependencies to device-*
94
- - fde47e6 package.json: move toolchain files to folder
95
- - 041c252 cmake: rename platform-qemu-mps2-an386
96
- - 1230c9b cmake: update for device-qemu-cortexm
97
- - 10304ab rename platform-qemu-mps2-an386
314
+ * 90e894f add meson qemu
315
+ * 6f55a37 package.json: rename dependencies to device-*
316
+ * fde47e6 package.json: move toolchain files to folder
317
+ * 041c252 cmake: rename platform-qemu-mps2-an386
318
+ * 1230c9b cmake: update for device-qemu-cortexm
319
+ * 10304ab rename platform-qemu-mps2-an386
98
320
 
99
321
  ## 2022-01-28
100
322
 
101
- - 829ffbd separate top CMake config for tests
102
- - 920a928 add top symbolic link
103
- - 9a5987e sample-test.cpp: static variables
104
- - 82c83d8 sample-test.cpp: test args
323
+ * 829ffbd separate top CMake config for tests
324
+ * 920a928 add top symbolic link
325
+ * 9a5987e sample-test.cpp: static variables
326
+ * 82c83d8 sample-test.cpp: test args
105
327
 
106
328
  ## 2022-01-26
107
329
 
108
- - 15d6fe9 package.json: skip qemu tests on windows
109
- - v2.1.0
110
- - rework CMake
330
+ * 15d6fe9 package.json: skip qemu tests on windows
331
+ * v2.1.0
332
+ * rework CMake
111
333
 
112
334
  ## 2022-01-03
113
335
 
114
- - v2.0.5
336
+ * v2.0.5
115
337
 
116
338
  ## 2022-01-02
117
339
 
118
- - CI.yml: remove native-cmake
119
- - package.json: add meson gcc/clang
120
- - PLATFORM_STM32F4DISCOVERY_WITHOUT_HAL
340
+ * CI.yml: remove native-cmake
341
+ * package.json: add meson gcc/clang
342
+ * PLATFORM_STM32F4DISCOVERY_WITHOUT_HAL
121
343
 
122
344
  ## 2022-01-01
123
345
 
124
- - meson.build: add /utf-8 to msvc options
125
- - [#4] add support for MSVC
126
- - package.json: use posix paths on windows
346
+ * meson.build: add /utf-8 to msvc options
347
+ * [#4] add support for MSVC
348
+ * package.json: use posix paths on windows
127
349
 
128
350
  ## 2021-12-29
129
351
 
130
- - stm32f4discovery test functional
131
- - add native meson tests
132
- - package.json: add clang12 test
133
- - add explicit CMakeLists.txt
352
+ * stm32f4discovery test functional
353
+ * add native meson tests
354
+ * package.json: add clang12 test
355
+ * add explicit CMakeLists.txt
134
356
 
135
357
  ## 2021-12-26
136
358
 
137
- - package.json: move devDeps to configs
138
- - CI.yml: test-native
139
- - package.json: migrate native to xpack actions
359
+ * package.json: move devDeps to configs
360
+ * CI.yml: test-native
361
+ * package.json: migrate native to xpack actions
140
362
 
141
363
  ## 2021-03-13
142
364
 
143
- - v2.0.4
144
- - remove -pedantic-errors, use -Werror only on bare-metal
365
+ * v2.0.4
366
+ * remove -pedantic-errors, use -Werror only on bare-metal
145
367
 
146
368
  ## 2021-03-10
147
369
 
148
- - v2.0.3
149
- - bump devDeps
370
+ * v2.0.3
371
+ * bump devDeps
150
372
 
151
373
  ## 2021-03-09
152
374
 
153
- - v2.0.2
154
- - fix/silence warnings
155
- - remove warning flags from cmake
375
+ * v2.0.2
376
+ * fix/silence warnings
377
+ * remove warning flags from cmake
156
378
 
157
379
  ## 2021-03-02
158
380
 
159
- - v2.0.1
160
- - fix warnings, add -Wall..., -Werrror
381
+ * v2.0.1
382
+ * fix warnings, add -Wall..., -Werrror
161
383
 
162
384
  ## 2021-03-01
163
385
 
164
- - v2.0.0
386
+ * v2.0.0
165
387
 
166
388
  ## 2021-02-28
167
389
 
168
- - rename micro_os_plus
390
+ * rename micro_os_plus
169
391
 
170
392
  ## 2021-02-12
171
393
 
172
- - add support for CMake find_package()
394
+ * add support for CMake find_package()
173
395
 
174
396
  ## 2021-02-07
175
397
 
176
- - prepare v2.0.0-pre
177
- - [#1] - rename micro_test_plus::session
178
- - [#2] - sample-test: conditional exceptions
179
- - [#3] - add stm32f4discovery tests
398
+ * prepare v2.0.0-pre
399
+ * [#1] - rename micro_test_plus::session
400
+ * [#2] - sample-test: conditional exceptions
401
+ * [#3] - add stm32f4discovery tests
180
402
 
181
403
  ## 2021-02-05
182
404
 
183
- - prepare v1.1.1-pre
405
+ * prepare v1.1.1-pre
184
406
 
185
407
  ## 2021-02-04
186
408
 
187
- - release preliminary v1.1.0
409
+ * release preliminary v1.1.0
package/README.md CHANGED
@@ -550,7 +550,7 @@ test_case ("Operators", [] {
550
550
  });
551
551
  ```
552
552
 
553
- ### Logical operators
553
+ #### Logical operators
554
554
 
555
555
  Similarly, logical operators are defined:
556
556
 
@@ -813,21 +813,23 @@ For complex applications there can be multiple test
813
813
  suites, usually in separate source files.
814
814
 
815
815
  In order to make self-registration possible, test suites are classes,
816
- constructed with a name and a callable (usually a lambda),
817
- which chains the execution of the test cases:
816
+ constructed with a name, a callable (usually a lambda
817
+ which chains the execution of the test cases) and optional
818
+ arguments:
818
819
 
819
820
  ```C++
821
+ class test_suite : public test_suite_base
822
+ {
823
+ public:
820
824
  template <typename Callable_T, typename... Args_T>
821
- class test_suite : public test_suite_base
822
- {
823
- public:
824
- test_suite (const char* name, Callable_T&& callable,
825
- Args_T&&... arguments);
826
- // ...
827
- }
825
+ test_suite (const char* name, Callable_T&& callable,
826
+ Args_T&&... arguments);
827
+ // ...
828
+ }
828
829
  ```
829
830
 
830
831
  It is recommended to instantiate the test suites as static objects.
832
+
831
833
  The self-registration is done in the constructor.
832
834
  Test suites defined in different compilation units can be executed in any
833
835
  order (since the order in which the
@@ -839,19 +841,29 @@ Test suites are executed when the function `exit_code()` is invoked.
839
841
  Examples:
840
842
 
841
843
  ```c++
842
- using namespace micro_os_plus::micro_test_plus;
844
+ static void
845
+ test_suite_args (int ic, int iv, int& ir, int* ip1, int* ip2)
846
+ {
847
+ using namespace micro_os_plus::micro_test_plus;
843
848
 
844
- static test_suite ts_1
845
- = { "Separate", [] {
849
+ test_case ("args", [&] {
850
+ expect (eq (ic, 42)) << "ic is 42";
851
+ expect (eq (iv, 43)) << "iv is 43";
852
+ expect (eq (ir, 44)) << "ir is 44";
853
+ expect (eq (*ip1, 45)) << "*ip1 is 45";
854
+ expect (eq (*ip2, 46)) << "*ip2 is 46";
855
+ });
856
+ }
846
857
 
847
- test_case ("Check one", [] {
848
- expect (true) << "Passed";
849
- });
858
+ static int in = 43;
859
+ static int in44 = 44;
860
+ static int& ir = in44;
861
+ static int in45 = 45;
862
+ static int in46 = 46;
863
+ static int* ip2 = &in46;
850
864
 
851
- test_case ("Check two", [] {
852
- expect (true) << "Passed";
853
- });
854
- }};
865
+ static micro_os_plus::micro_test_plus::test_suite ts_args
866
+ = { "Args", test_suite_args, 42, in, ir, &in45, ip2 };
855
867
  ```
856
868
 
857
869
  #### Utility functions
@@ -962,7 +974,7 @@ The header file to be included is:
962
974
  #include <micro-os-plus/micro-test-plus.h>
963
975
  ```
964
976
 
965
- #### Source folders
977
+ #### Source files
966
978
 
967
979
  The source files to be added are:
968
980
 
@@ -973,8 +985,9 @@ The source files to be added are:
973
985
 
974
986
  #### Preprocessor definitions
975
987
 
976
- - `MICRO_OS_PLUS_TRACE` - to include the trace
977
- - `MICRO_TEST_PLUS_TRACE` to enable some tracing messages
988
+ - `MICRO_OS_PLUS_INCLUDE_CONFIG_H` - to include `<micro-os-plus/config.h>`
989
+ - `MICRO_OS_PLUS_TRACE` - to include the trace calls
990
+ - `MICRO_TEST_PLUS_TRACE` - to enable some tracing messages
978
991
 
979
992
  #### Compiler options
980
993
 
@@ -38,12 +38,10 @@ namespace micro_os_plus::micro_test_plus
38
38
  // --------------------------------------------------------------------------
39
39
 
40
40
  template <typename Callable_T, typename... Args_T>
41
- test_suite<Callable_T, Args_T...>::test_suite (const char* name,
42
- Callable_T&& callable,
43
- Args_T&&... arguments)
44
- : test_suite_base{ name }, callable_{ std::forward<Callable_T> (
45
- callable) },
46
- arguments_{ std::forward<Args_T> (arguments)... }
41
+ test_suite::test_suite (const char* name, Callable_T&& callable,
42
+ Args_T&&... arguments)
43
+ : test_suite_base{ name }, callable_{ std::bind (callable,
44
+ arguments...) }
47
45
  {
48
46
  #if defined(MICRO_TEST_PLUS_TRACE)
49
47
  printf ("%s\n", __PRETTY_FUNCTION__);
@@ -52,25 +50,6 @@ namespace micro_os_plus::micro_test_plus
52
50
  runner.register_test_suite (this);
53
51
  }
54
52
 
55
- template <typename Callable_T, typename... Args_T>
56
- test_suite<Callable_T, Args_T...>::~test_suite ()
57
- {
58
- #if defined(MICRO_TEST_PLUS_TRACE)
59
- printf ("%s\n", __PRETTY_FUNCTION__);
60
- #endif // MICRO_TEST_PLUS_TRACE
61
- }
62
-
63
- template <typename Callable_T, typename... Args_T>
64
- void
65
- test_suite<Callable_T, Args_T...>::run (void)
66
- {
67
- current_test_suite = this;
68
-
69
- begin_test_suite ();
70
- std::apply (callable_, arguments_);
71
- end_test_suite ();
72
- }
73
-
74
53
  // --------------------------------------------------------------------------
75
54
 
76
55
  template <typename Callable_T, typename... Args_T>
@@ -40,6 +40,7 @@
40
40
 
41
41
  #if defined(__GNUC__)
42
42
  #pragma GCC diagnostic push
43
+
43
44
  #pragma GCC diagnostic ignored "-Wpadded"
44
45
  #pragma GCC diagnostic ignored "-Waggregate-return"
45
46
  #if defined(__clang__)
@@ -520,6 +521,10 @@ namespace micro_os_plus::micro_test_plus
520
521
  #pragma GCC diagnostic pop
521
522
  #endif
522
523
 
524
+ // ----------------------------------------------------------------------------
525
+
526
+ #endif // __cplusplus
527
+
523
528
  // ===== Inline & template implementations ====================================
524
529
 
525
530
  #include "test-reporter-inlines.h"
@@ -529,10 +534,6 @@ namespace micro_os_plus::micro_test_plus
529
534
 
530
535
  // ----------------------------------------------------------------------------
531
536
 
532
- #endif // __cplusplus
533
-
534
- // ----------------------------------------------------------------------------
535
-
536
537
  #endif // MICRO_TEST_PLUS_MICRO_TEST_PLUS_H_
537
538
 
538
539
  // ----------------------------------------------------------------------------
@@ -197,10 +197,10 @@ namespace micro_os_plus::micro_test_plus
197
197
  } current_test_case{};
198
198
  };
199
199
 
200
- template <typename Callable_T, typename... Args_T>
201
200
  class test_suite : public test_suite_base
202
201
  {
203
202
  public:
203
+ template <typename Callable_T, typename... Args_T>
204
204
  test_suite (const char* name, Callable_T&& callable,
205
205
  Args_T&&... arguments);
206
206
 
@@ -220,8 +220,7 @@ namespace micro_os_plus::micro_test_plus
220
220
  run (void) override;
221
221
 
222
222
  protected:
223
- Callable_T&& callable_;
224
- std::tuple<Args_T...> arguments_;
223
+ std::function<void (void)> callable_;
225
224
  };
226
225
 
227
226
  // --------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micro-os-plus/micro-test-plus",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "A source library xPack with µTest++, a testing framework for embedded platforms",
5
5
  "main": "",
6
6
  "scripts": {
@@ -144,9 +144,12 @@ namespace micro_os_plus::micro_test_plus
144
144
  {
145
145
  for (auto suite : *suites_)
146
146
  {
147
- default_test_suite_ = suite;
148
- suite->run ();
147
+ current_test_suite = suite;
149
148
 
149
+ suite->begin_test_suite ();
150
+ suite->run ();
151
+ suite->end_test_suite();
152
+
150
153
  was_successful &= suite->was_successful ();
151
154
  }
152
155
  if (reporter.verbosity != verbosity::silent)
@@ -111,6 +111,22 @@ namespace micro_os_plus::micro_test_plus
111
111
  ++current_test_case.failed_checks;
112
112
  }
113
113
 
114
+ // ==========================================================================
115
+
116
+ void
117
+ test_suite::run (void)
118
+ {
119
+ // Run the test suite function prepared with std::bin();
120
+ callable_ ();
121
+ }
122
+
123
+ test_suite::~test_suite ()
124
+ {
125
+ #if defined(MICRO_TEST_PLUS_TRACE)
126
+ printf ("%s\n", __PRETTY_FUNCTION__);
127
+ #endif // MICRO_TEST_PLUS_TRACE
128
+ }
129
+
114
130
  // --------------------------------------------------------------------------
115
131
  } // namespace micro_os_plus::micro_test_plus
116
132
 
package/docs/NOTES.md DELETED
@@ -1,7 +0,0 @@
1
- # Notes
2
-
3
- ## Inspiration
4
-
5
- - <https://github.com/boost-ext/ut>
6
- - <https://google.github.io/googletest/>
7
- - <https://github.com/catchorg/Catch2>