@micro-os-plus/micro-test-plus 3.1.2 → 3.2.2
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 +195 -10
- package/CMakeLists.txt +3 -4
- package/LICENSE +1 -1
- package/README.md +15 -14
- package/include/micro-os-plus/detail.h +19 -5
- package/include/micro-os-plus/inlines.h +25 -16
- package/include/micro-os-plus/literals.h +113 -15
- package/include/micro-os-plus/math.h +4 -5
- package/include/micro-os-plus/micro-test-plus.h +10 -8
- package/include/micro-os-plus/reflection.h +9 -8
- package/include/micro-os-plus/test-reporter-inlines.h +4 -5
- package/include/micro-os-plus/test-reporter.h +7 -5
- package/include/micro-os-plus/test-runner.h +5 -5
- package/include/micro-os-plus/test-suite.h +6 -5
- package/include/micro-os-plus/type-traits.h +36 -5
- package/meson.build +3 -4
- package/package.json +32 -19
- package/src/micro-test-plus.cpp +19 -12
- package/src/test-reporter.cpp +4 -5
- package/src/test-runner.cpp +10 -11
- package/src/test-suite.cpp +10 -11
- package/xcdl.json +32 -0
- package/LICENSE-Boost +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,191 @@ 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
|
+
## 2025-03-15
|
|
10
|
+
|
|
11
|
+
* v3.2.2 published on npmjs.com
|
|
12
|
+
* v3.2.2 prepared
|
|
13
|
+
* 771e589 re-generate commons
|
|
14
|
+
|
|
15
|
+
## 2025-03-14
|
|
16
|
+
|
|
17
|
+
* 1475002 re-generate top commons
|
|
18
|
+
* 464a485 re-generate top commons
|
|
19
|
+
* 632bcc8 publish-github-pages update
|
|
20
|
+
* d89c851 website: blog post release 3.2.1 published
|
|
21
|
+
* c70d3e0 3.2.1
|
|
22
|
+
* 60103cd prepare v3.2.1
|
|
23
|
+
* 8daa820 website: update post
|
|
24
|
+
* 703dcf9 website: re-generate commons & blog posts
|
|
25
|
+
* 564f37f tests: re-generate commons
|
|
26
|
+
|
|
27
|
+
## 2025-03-12
|
|
28
|
+
|
|
29
|
+
* a7dc192 re-generate commons with long description
|
|
30
|
+
* ae24148 website: re-generate commons
|
|
31
|
+
* 0c97d4e website: re-generate commons
|
|
32
|
+
* 7c01414 website: re-generate commons
|
|
33
|
+
* 31d25ac website: re-generate commons
|
|
34
|
+
|
|
35
|
+
## 2025-03-11
|
|
36
|
+
|
|
37
|
+
* e0db831 website: re-generate commons
|
|
38
|
+
* e31417b website: re-generate commons
|
|
39
|
+
* 0350fa2 website: re-generate with longer descriptiveName
|
|
40
|
+
|
|
41
|
+
## 2025-03-10
|
|
42
|
+
|
|
43
|
+
* f514bf6 website: re-generate commons
|
|
44
|
+
* 3ba95c6 website: re-generate commons major
|
|
45
|
+
|
|
46
|
+
## 2025-03-05
|
|
47
|
+
|
|
48
|
+
* 30197db website: green
|
|
49
|
+
|
|
50
|
+
## 2025-03-04
|
|
51
|
+
|
|
52
|
+
* 57afe72 website: fix pathname:// links
|
|
53
|
+
* 24e28c1 website: getting-started rework
|
|
54
|
+
* 73abd63 config.doxyfile: disable XML for now
|
|
55
|
+
* af1383f docusaurus*: use pathname:///
|
|
56
|
+
* d963f3d docusaurus*: accept broken links
|
|
57
|
+
* ba6a4e9 *redirect.ts remove '/reference'
|
|
58
|
+
* d71fa22 re-generate commons
|
|
59
|
+
* 2cc8dd6 website docusaurus test
|
|
60
|
+
|
|
61
|
+
## 2025-03-03
|
|
62
|
+
|
|
63
|
+
* 17fc2c5 doxygen/.gitignore
|
|
64
|
+
|
|
65
|
+
## 2025-03-02
|
|
66
|
+
|
|
67
|
+
* e233776 website: move doxygen files to separate folder
|
|
68
|
+
* 32ff366 tests/package-lock.json update
|
|
69
|
+
|
|
70
|
+
## 2025-02-28
|
|
71
|
+
|
|
72
|
+
* 435d61f copyright notices cosmetics
|
|
73
|
+
* c228aef tests: re-generate commons
|
|
74
|
+
* d178ebe re-generate workflows
|
|
75
|
+
* 5f78801 test-all: fix clear cache syntax
|
|
76
|
+
|
|
77
|
+
## 2025-02-27
|
|
78
|
+
|
|
79
|
+
* 9a6ecf5 test-all: fix clear cache syntax
|
|
80
|
+
* 5a78a81 test-all: fix clear cache syntax
|
|
81
|
+
* df341b9 test-all: fix clear cache syntax
|
|
82
|
+
* 4c56913 test-all: clean xPack cache
|
|
83
|
+
* 76606cb re-generate workflows
|
|
84
|
+
* 6472bc0 tests/native/meson -rtlib=compiler-rt
|
|
85
|
+
* e5bed09 tests/native/cmake remove duplicate -stdlib=libc++
|
|
86
|
+
* 5425929 tests/package.json: add native-meson-clang to test-ci
|
|
87
|
+
* 9babed3 tests/native meson -stdlib=libc++
|
|
88
|
+
* 1fe540d reflection.h: unsigned int line
|
|
89
|
+
|
|
90
|
+
## 2025-02-26
|
|
91
|
+
|
|
92
|
+
* 4d46b66 package.json fix action test
|
|
93
|
+
* c76db36 package.json add git-pull-helper
|
|
94
|
+
* cac8c46 tests/package.json: bump helper
|
|
95
|
+
* 8274320 tests/package-lock.json update
|
|
96
|
+
* db0f79a re-generate commons
|
|
97
|
+
* 052057d workflows: update
|
|
98
|
+
|
|
99
|
+
## 2025-02-25
|
|
100
|
+
|
|
101
|
+
* 808db36 workflows cosmetics
|
|
102
|
+
* 6531845 meson/common-options: fix link_args
|
|
103
|
+
* 241c368 workflows: npm -C
|
|
104
|
+
* b867523 workflows: &&
|
|
105
|
+
* 2636562 workflows: remove windows 2019
|
|
106
|
+
* 8aca778 tests/package-local.json
|
|
107
|
+
* 9650766 re-generate commons
|
|
108
|
+
* 34695b1 xcdl.json update
|
|
109
|
+
|
|
110
|
+
## 2025-02-24
|
|
111
|
+
|
|
112
|
+
* cca99a3 package.json: update topConfig
|
|
113
|
+
* 6b926ad package.json update
|
|
114
|
+
* 66412e3 package.json: add topConfig
|
|
115
|
+
* eab469f re-generate workflows
|
|
116
|
+
* 5fc7f95 test-ci.yml: fix install-ci
|
|
117
|
+
* de675ce test-ci.yml: fix install-ci
|
|
118
|
+
* cf02869 rename test-ci.yml
|
|
119
|
+
* 8a8431d ci.yml update
|
|
120
|
+
* 94d8603 tests/package*.json: bump deps
|
|
121
|
+
* 05e42b2 platforms/native: update RPATH
|
|
122
|
+
* 00c2a30 publish-github-pages.yml: update from npm helper
|
|
123
|
+
* 5a1770c website: update for node_modules
|
|
124
|
+
* 328857c re-generate commons
|
|
125
|
+
* a8a661e package*.json: use npm & extract xcdl.json
|
|
126
|
+
* d3c7750 silence documentation warnings
|
|
127
|
+
|
|
128
|
+
## 2024-11-21
|
|
129
|
+
|
|
130
|
+
* c3847f1 rename xpack-development
|
|
131
|
+
* e7b1d9b rename MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
132
|
+
* 459143c package.json: add cdlComponents
|
|
133
|
+
* ffaf7b1 tests/package.json CMAKE_MAKE_PROGRAM only on windows
|
|
134
|
+
* 5cf103a update copyright notice
|
|
135
|
+
|
|
136
|
+
## 2024-02-14
|
|
137
|
+
|
|
138
|
+
* a1b201a tests/package.json: add short win path to meson
|
|
139
|
+
* 3269a0e tests/package.json: explicit CMAKE_MAKE_PROGRAM
|
|
140
|
+
|
|
141
|
+
## 2023-12-26
|
|
142
|
+
|
|
143
|
+
* 7c113ee README update
|
|
144
|
+
* b534088 credits.md: remove macstadium.com opensource
|
|
145
|
+
* 11ffc8b website/pages/home.md: cleanup dummy links
|
|
146
|
+
* acefd31 publish-github-pages.yml: bump doxygen 1.10.0
|
|
147
|
+
* b24ad6b cmake cosmetics
|
|
148
|
+
|
|
149
|
+
## 2023-12-06
|
|
150
|
+
|
|
151
|
+
* 7a2ee88 3.2.0
|
|
152
|
+
* 2a6abf2 prepare v3.2.0
|
|
153
|
+
* 90963ce micro-test-plus.h cosmetics
|
|
154
|
+
* c57c46e literals.h: silence clang deprecation warning
|
|
155
|
+
* f776b18 doxygen metadata: add @headerfile
|
|
156
|
+
* 94ff7d7 website: use to_*
|
|
157
|
+
* 9d4f8bb tests/sample-test.cpp: use to_*
|
|
158
|
+
* 24606d7 literals.h: add to_*, deprecate _*
|
|
159
|
+
|
|
160
|
+
## 2023-12-05
|
|
161
|
+
|
|
162
|
+
* 76ddc99 user-guide.md: use mt::
|
|
163
|
+
* 86adedf doxygen metadata: use mt:: in examples
|
|
164
|
+
* 71db099 tests: use explicit mt::
|
|
165
|
+
* c508d4f testing.md: remove reference to test-all.yml
|
|
166
|
+
* 11a1f31 testing.md: update
|
|
167
|
+
* 1ee57a8 testing.md: fix typo
|
|
168
|
+
* 749e2d6 testing.md: add clang 17
|
|
169
|
+
* 221a630 rename xpack-development
|
|
170
|
+
* 06419e5 tests/package.json: enable gcc11
|
|
171
|
+
* 03cb2ed tests/package.json: bump deps
|
|
172
|
+
|
|
173
|
+
## 2023-12-04
|
|
174
|
+
|
|
175
|
+
* ebe7e55 package-lock.json updates
|
|
176
|
+
* 17e8859 tests/package.json: add clang 17
|
|
177
|
+
* 75e585a micro-test-plus.cpp: silence warning for clang 17
|
|
178
|
+
|
|
179
|
+
## 2023-11-30
|
|
180
|
+
|
|
181
|
+
* b4ff766 website/package.json: #v2.3.1
|
|
182
|
+
* 19a43d6 testing.md update
|
|
183
|
+
* 822e464 rework tests with platforms sub-folder
|
|
184
|
+
* 2aef49a website/package.json: explicit #v2.3.0
|
|
185
|
+
* 313fd41 website/package.json: explicit #2.3.0
|
|
186
|
+
* 80d0fe8 testing.md: updates
|
|
187
|
+
|
|
188
|
+
## 2023-11-29
|
|
189
|
+
|
|
190
|
+
* 2227c94 3.1.2
|
|
191
|
+
* 552865e prepare v3.1.2
|
|
192
|
+
* 993d0f7 testing.md: updates
|
|
193
|
+
|
|
9
194
|
## 2023-11-28
|
|
10
195
|
|
|
11
196
|
* 21393a5 ci.yml cosmetics
|
|
@@ -69,16 +254,16 @@ and close existing issues and pull requests.
|
|
|
69
254
|
## 2023-11-25
|
|
70
255
|
|
|
71
256
|
* 509ff38 home.md: add Manual Pages
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
257
|
+
* eed0475 tests/package.json: add install/tes-latest
|
|
258
|
+
* d2a23dd tests/README update
|
|
259
|
+
* a755996 maintainer.md: update
|
|
260
|
+
* 17866f0 tests/package.json: add more selected
|
|
261
|
+
* 593b361 tests/package.json: fix syntax
|
|
262
|
+
* bbe15ab tests/package.json: fix syntax
|
|
263
|
+
* 1456260 tests/package.json: re-enable some tests
|
|
264
|
+
* c8f7c5a tests/package.json: reorder actions
|
|
265
|
+
* 68626be tests/package.json: fix install-selected
|
|
266
|
+
* 079df5c tests/package.json: cleanup actions
|
|
82
267
|
|
|
83
268
|
## 2023-11-24
|
|
84
269
|
|
package/CMakeLists.txt
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# -----------------------------------------------------------------------------
|
|
2
2
|
#
|
|
3
|
-
# This file is part of the µOS++
|
|
4
|
-
# (
|
|
5
|
-
# Copyright (c) 2021 Liviu Ionescu
|
|
3
|
+
# This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
4
|
+
# Copyright (c) 2021 Liviu Ionescu. All rights reserved.
|
|
6
5
|
#
|
|
7
6
|
# Permission to use, copy, modify, and/or distribute this software
|
|
8
7
|
# for any purpose is hereby granted, under the terms of the MIT license.
|
|
9
8
|
#
|
|
10
9
|
# If a copy of the license was not distributed with this file, it can
|
|
11
|
-
# be obtained from https://opensource.org/licenses/
|
|
10
|
+
# be obtained from https://opensource.org/licenses/mit.
|
|
12
11
|
#
|
|
13
12
|
# -----------------------------------------------------------------------------
|
|
14
13
|
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
[](https://github.com/micro-os-plus/micro-test-plus-xpack/blob/xpack/package.json)
|
|
2
|
-
[](https://github.com/micro-os-plus/micro-test-plus-xpack/tags
|
|
3
|
-
[](https://github.com/micro-os-plus/micro-test-plus-xpack/actions/workflows/ci.yml)
|
|
6
|
-
[](https://micro-os-plus.github.io/micro-test-plus-xpack/)
|
|
2
|
+
[](https://github.com/micro-os-plus/micro-test-plus-xpack/tags)
|
|
3
|
+
[](https://www.npmjs.com/package/@micro-os-plus/micro-test-plus/)
|
|
4
|
+
[](https://github.com/micro-os-plus/micro-test-plus-xpack/blob/xpack/LICENSE)
|
|
7
5
|
|
|
8
|
-
#
|
|
6
|
+
# The µTest++ Testing Framework
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
testing framework, intended for running unit tests on embedded
|
|
12
|
-
platforms.
|
|
8
|
+
A source code library with µTest++, a lightweight testing framework for embedded platforms.
|
|
13
9
|
|
|
14
|
-
##
|
|
10
|
+
## Project documentation
|
|
15
11
|
|
|
16
|
-
For information on how to
|
|
17
|
-
[project
|
|
12
|
+
For information on how to install and use this project, please refer to the
|
|
13
|
+
[project website](https://micro-os-plus.github.io/micro-test-plus-xpack/).
|
|
14
|
+
|
|
15
|
+
## Project source
|
|
16
|
+
|
|
17
|
+
The source code of the current release is available on
|
|
18
|
+
[GitHub tag v3.2.2 tree](https://github.com/micro-os-plus/micro-test-plus-xpack/tree/v3.2.2).
|
|
18
19
|
|
|
19
20
|
## License
|
|
20
21
|
|
|
21
|
-
Unless otherwise stated, the content is released under the terms of the
|
|
22
|
-
[MIT License](https://opensource.org/licenses/mit
|
|
22
|
+
Unless otherwise stated, the original content is released under the terms of the
|
|
23
|
+
[MIT License](https://opensource.org/licenses/mit),
|
|
23
24
|
with all rights reserved to
|
|
24
25
|
[Liviu Ionescu](https://github.com/ilg-ul).
|
|
25
26
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2021 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2021 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
5
|
* Permission to use, copy, modify, and/or distribute this software
|
|
7
6
|
* for any purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
8
|
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
* be obtained from
|
|
9
|
+
* be obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*
|
|
12
11
|
* Major parts of the code are inspired from v1.1.8 of the Boost UT project,
|
|
13
12
|
* released under the terms of the Boost Version 1.0 Software License,
|
|
14
|
-
* which can be obtained from
|
|
13
|
+
* which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
16
|
#ifndef MICRO_TEST_PLUS_DETAIL_H_
|
|
@@ -47,6 +46,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
47
46
|
{
|
|
48
47
|
/**
|
|
49
48
|
* @brief An object used to pass assertion parameters to the evaluator.
|
|
49
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
50
50
|
*/
|
|
51
51
|
template <class Expr_T>
|
|
52
52
|
struct assertion
|
|
@@ -95,6 +95,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* @brief Equality comparator.
|
|
98
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
98
99
|
*/
|
|
99
100
|
template <class Lhs_T, class Rhs_T>
|
|
100
101
|
struct eq_ : type_traits::op
|
|
@@ -180,6 +181,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
180
181
|
|
|
181
182
|
/**
|
|
182
183
|
* @brief Non-equality comparator.
|
|
184
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
183
185
|
*/
|
|
184
186
|
template <class Lhs_T, class Rhs_T>
|
|
185
187
|
struct ne_ : type_traits::op
|
|
@@ -254,6 +256,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
254
256
|
|
|
255
257
|
/**
|
|
256
258
|
* @brief Greater than comparator.
|
|
259
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
257
260
|
*/
|
|
258
261
|
template <class Lhs_T, class Rhs_T>
|
|
259
262
|
struct gt_ : type_traits::op
|
|
@@ -311,6 +314,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
311
314
|
|
|
312
315
|
/**
|
|
313
316
|
* @brief Greater than or equal comparator.
|
|
317
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
314
318
|
*/
|
|
315
319
|
template <class Lhs_T, class Rhs_T>
|
|
316
320
|
struct ge_ : type_traits::op
|
|
@@ -368,6 +372,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
368
372
|
|
|
369
373
|
/**
|
|
370
374
|
* @brief Less than comparator.
|
|
375
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
371
376
|
*/
|
|
372
377
|
template <class Lhs_T, class Rhs_T>
|
|
373
378
|
struct lt_ : type_traits::op
|
|
@@ -426,6 +431,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
426
431
|
|
|
427
432
|
/**
|
|
428
433
|
* @brief Less than or equal comparator.
|
|
434
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
429
435
|
*/
|
|
430
436
|
template <class Lhs_T, class Rhs_T>
|
|
431
437
|
struct le_ : type_traits::op
|
|
@@ -485,6 +491,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
485
491
|
|
|
486
492
|
/**
|
|
487
493
|
* @brief Logical and operator.
|
|
494
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
488
495
|
*/
|
|
489
496
|
template <class Lhs_T, class Rhs_T>
|
|
490
497
|
struct and_ : type_traits::op
|
|
@@ -520,6 +527,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
520
527
|
|
|
521
528
|
/**
|
|
522
529
|
* @brief Logical or operator.
|
|
530
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
523
531
|
*/
|
|
524
532
|
template <class Lhs_T, class Rhs_T>
|
|
525
533
|
struct or_ : type_traits::op
|
|
@@ -555,6 +563,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
555
563
|
|
|
556
564
|
/**
|
|
557
565
|
* @brief Logical not operator.
|
|
566
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
558
567
|
*/
|
|
559
568
|
template <class T>
|
|
560
569
|
struct not_ : type_traits::op
|
|
@@ -583,6 +592,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
583
592
|
#if defined(__cpp_exceptions)
|
|
584
593
|
/**
|
|
585
594
|
* @brief Operator to check if the expression throws a specific exception.
|
|
595
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
586
596
|
*/
|
|
587
597
|
template <class Callable_T, class Exception_T = void>
|
|
588
598
|
struct throws_ : type_traits::op
|
|
@@ -617,6 +627,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
617
627
|
|
|
618
628
|
/**
|
|
619
629
|
* @brief Operator to check if the expression throws any exception.
|
|
630
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
620
631
|
*/
|
|
621
632
|
template <class Callable_T>
|
|
622
633
|
struct throws_<Callable_T, void> : type_traits::op
|
|
@@ -647,6 +658,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
647
658
|
|
|
648
659
|
/**
|
|
649
660
|
* @brief Operator to check if the expression does not throw any exception.
|
|
661
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
650
662
|
*/
|
|
651
663
|
template <class Callable_T>
|
|
652
664
|
struct nothrow_ : type_traits::op
|
|
@@ -681,6 +693,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
681
693
|
/**
|
|
682
694
|
* @brief Base class for a deferred reporter, that collects the
|
|
683
695
|
* messages into a string.
|
|
696
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
684
697
|
*/
|
|
685
698
|
class deferred_reporter_base
|
|
686
699
|
{
|
|
@@ -715,6 +728,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
715
728
|
/**
|
|
716
729
|
* @brief Class template for a deferred reporter specific
|
|
717
730
|
* to an expression.
|
|
731
|
+
* @headerfile micro-test-plus.h <micro-os-plus/micro-test-plus.h>
|
|
718
732
|
*/
|
|
719
733
|
template <class Expr_T>
|
|
720
734
|
class deferred_reporter : public deferred_reporter_base
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2021 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2021 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
5
|
* Permission to use, copy, modify, and/or distribute this software
|
|
7
6
|
* for any purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
8
|
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
* be obtained from
|
|
9
|
+
* be obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*
|
|
12
11
|
* Major parts of the code are inspired from v1.1.8 of the Boost UT project,
|
|
13
12
|
* released under the terms of the Boost Version 1.0 Software License,
|
|
14
|
-
* which can be obtained from
|
|
13
|
+
* which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
16
|
#ifndef MICRO_TEST_PLUS_INLINES_H_
|
|
@@ -43,15 +42,19 @@ namespace micro_os_plus::micro_test_plus
|
|
|
43
42
|
: test_suite_base{ name },
|
|
44
43
|
callable_{ std::bind (callable, arguments...) }
|
|
45
44
|
{
|
|
46
|
-
#if defined(
|
|
45
|
+
#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
47
46
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
48
|
-
#endif //
|
|
47
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
49
48
|
|
|
50
49
|
runner.register_test_suite (this);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
// --------------------------------------------------------------------------
|
|
54
53
|
|
|
54
|
+
#if defined(__clang__)
|
|
55
|
+
#pragma clang diagnostic push
|
|
56
|
+
#pragma clang diagnostic ignored "-Wdocumentation"
|
|
57
|
+
#endif
|
|
55
58
|
/**
|
|
56
59
|
* @details
|
|
57
60
|
* A test case is a sequence of test conditions (or simply tests,
|
|
@@ -73,20 +76,24 @@ namespace micro_os_plus::micro_test_plus
|
|
|
73
76
|
* the provided arguments, and reports the results.
|
|
74
77
|
*
|
|
75
78
|
* @par Example
|
|
76
|
-
*
|
|
77
79
|
* ```cpp
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
+
* namespace mt = micro_os_plus::micro_test_plus;
|
|
81
|
+
*
|
|
82
|
+
* mt::test_case ("Check answer with comparator", [] {
|
|
83
|
+
* mt::expect (mt::eq (compute_answer (), 42)) << "answer is 42";
|
|
80
84
|
* });
|
|
81
85
|
* ```
|
|
82
86
|
*/
|
|
87
|
+
#if defined(__clang__)
|
|
88
|
+
#pragma clang diagnostic pop
|
|
89
|
+
#endif
|
|
83
90
|
template <typename Callable_T, typename... Args_T>
|
|
84
91
|
void
|
|
85
92
|
test_case (const char* name, Callable_T&& callable, Args_T&&... arguments)
|
|
86
93
|
{
|
|
87
|
-
#if 0 // defined(
|
|
94
|
+
#if 0 // defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
88
95
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
89
|
-
#endif //
|
|
96
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
90
97
|
|
|
91
98
|
current_test_suite->begin_test_case (name);
|
|
92
99
|
std::invoke (std::forward<Callable_T> (callable),
|
|
@@ -123,9 +130,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
123
130
|
: deferred_reporter_base{ static_cast<bool> (expr), location },
|
|
124
131
|
expr_{ expr }
|
|
125
132
|
{
|
|
126
|
-
#if 0 // defined(
|
|
133
|
+
#if 0 // defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
127
134
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
128
|
-
#endif //
|
|
135
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
129
136
|
abort_ = abort;
|
|
130
137
|
}
|
|
131
138
|
|
|
@@ -155,8 +162,10 @@ namespace micro_os_plus::micro_test_plus
|
|
|
155
162
|
*
|
|
156
163
|
* @par Example
|
|
157
164
|
* ```cpp
|
|
158
|
-
*
|
|
159
|
-
*
|
|
165
|
+
* namespace mt = micro_os_plus::micro_test_plus;
|
|
166
|
+
*
|
|
167
|
+
* mt::expect (std::vector<std::string_view>{ "a", "b" }
|
|
168
|
+
* == mt::utility::split<std::string_view> ("a.b", "."))
|
|
160
169
|
* << "a.b splits into [a,b]";
|
|
161
170
|
* ```
|
|
162
171
|
*/
|