@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/package.json
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micro-os-plus/micro-test-plus",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "A source code library with µTest++, a lightweight testing framework for embedded platforms",
|
|
5
5
|
"main": "",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"generate-top-commons": "bash node_modules/@xpack/npm-packages-helper/maintenance-scripts/generate-top-commons.sh --micro-os-plus",
|
|
8
|
+
"npm-install": "npm install",
|
|
9
|
+
"npm-link-helpers": "npm link @xpack/npm-packages-helper @xpack/docusaurus-template-liquid",
|
|
10
|
+
"npm-outdated": "npm outdated",
|
|
11
|
+
"npm-pack": "npm pack",
|
|
12
|
+
"npm-link": "npm link",
|
|
13
|
+
"npm-version-patch": "npm version patch",
|
|
14
|
+
"npm-version-minor": "npm version minor",
|
|
15
|
+
"git-log": "git log --pretty='%cd * %h %s' --date=short",
|
|
16
|
+
"git-pull-helper": "git -C ${HOME}/Work/micro-os-plus/build-helper-xpack.git pull",
|
|
17
|
+
"deep-clean": "del-cli node_modules package-lock.json *.tgz",
|
|
7
18
|
"postversion": "git push origin --all && git push origin --tags"
|
|
8
19
|
},
|
|
9
20
|
"repository": {
|
|
10
21
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/micro-os-plus/micro-test-plus-xpack.git"
|
|
22
|
+
"url": "git+https://github.com/micro-os-plus/micro-test-plus-xpack.git"
|
|
12
23
|
},
|
|
13
|
-
"homepage": "https://micro-os-plus.github.io/micro-test-plus-xpack",
|
|
14
24
|
"bugs": {
|
|
15
25
|
"url": "https://github.com/micro-os-plus/micro-test-plus-xpack/issues"
|
|
16
26
|
},
|
|
27
|
+
"homepage": "https://micro-os-plus.github.io/micro-test-plus-xpack/",
|
|
28
|
+
"homepagePreview": "https://micro-os-plus.github.io/micro-test-plus-xpack-webpreview/",
|
|
17
29
|
"keywords": [
|
|
18
30
|
"xpack",
|
|
31
|
+
"micro-os-plus",
|
|
19
32
|
"c++",
|
|
20
33
|
"testing",
|
|
21
|
-
"framework"
|
|
22
|
-
"micro-os-plus"
|
|
34
|
+
"framework"
|
|
23
35
|
],
|
|
24
36
|
"author": {
|
|
25
37
|
"name": "Liviu Ionescu",
|
|
@@ -27,29 +39,30 @@
|
|
|
27
39
|
"url": "https://github.com/ilg-ul"
|
|
28
40
|
},
|
|
29
41
|
"license": "MIT",
|
|
30
|
-
"config": {},
|
|
31
42
|
"dependencies": {},
|
|
32
|
-
"bundleDependencies": [],
|
|
33
43
|
"$devDependenciesUrls": [
|
|
34
|
-
"https://www.npmjs.com/package/del-cli"
|
|
44
|
+
"https://www.npmjs.com/package/del-cli",
|
|
45
|
+
"https://www.npmjs.com/package/json",
|
|
46
|
+
"https://www.npmjs.com/package/liquidjs"
|
|
35
47
|
],
|
|
36
48
|
"devDependencies": {
|
|
37
|
-
"del-cli": "^
|
|
49
|
+
"del-cli": "^6.0.0",
|
|
50
|
+
"json": "^11.0.0",
|
|
51
|
+
"liquidjs": "^10.19.1"
|
|
38
52
|
},
|
|
39
53
|
"xpack": {
|
|
40
|
-
"minimumXpmRequired": "0.
|
|
41
|
-
"actions": {
|
|
42
|
-
"deep-clean": "del-cli node_modules package-lock.json",
|
|
43
|
-
"npm-install": "npm install",
|
|
44
|
-
"git-log": "git log --pretty='%cd * %h %s' --date=short",
|
|
45
|
-
"npm-pack": "npm pack",
|
|
46
|
-
"npm-version-patch": "npm version patch",
|
|
47
|
-
"npm-version-minor": "npm version minor",
|
|
48
|
-
"npm-version": "echo $(which node) $(node --version) && echo $(which npm) $(npm --version)"
|
|
49
|
-
},
|
|
54
|
+
"minimumXpmRequired": "0.20.8",
|
|
50
55
|
"dependencies": {},
|
|
51
56
|
"devDependencies": {},
|
|
52
57
|
"properties": {},
|
|
53
58
|
"buildConfigurations": {}
|
|
59
|
+
},
|
|
60
|
+
"topConfig": {
|
|
61
|
+
"descriptiveName": "µTest++ Testing Framework",
|
|
62
|
+
"permalinkName": "micro-test-plus",
|
|
63
|
+
"useDoxygen": "true"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": " >=18.0.0"
|
|
54
67
|
}
|
|
55
68
|
}
|
package/src/micro-test-plus.cpp
CHANGED
|
@@ -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
|
// ----------------------------------------------------------------------------
|
|
@@ -56,7 +55,7 @@ namespace micro_os_plus::micro_test_plus
|
|
|
56
55
|
void
|
|
57
56
|
initialize (int argc, char* argv[], const char* name)
|
|
58
57
|
{
|
|
59
|
-
#if defined(
|
|
58
|
+
#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
60
59
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
61
60
|
#endif
|
|
62
61
|
runner.initialize (argc, argv, name);
|
|
@@ -93,17 +92,21 @@ namespace micro_os_plus::micro_test_plus
|
|
|
93
92
|
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
|
94
93
|
#endif
|
|
95
94
|
const char* p = strrchr (name, '/');
|
|
96
|
-
#pragma GCC diagnostic pop
|
|
97
95
|
if (p != nullptr)
|
|
98
96
|
return p + 1;
|
|
99
97
|
else
|
|
100
98
|
return name;
|
|
99
|
+
#pragma GCC diagnostic pop
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
} // namespace reflection
|
|
104
103
|
|
|
105
104
|
namespace utility
|
|
106
105
|
{
|
|
106
|
+
#if defined(__clang__)
|
|
107
|
+
#pragma clang diagnostic push
|
|
108
|
+
#pragma clang diagnostic ignored "-Wdocumentation"
|
|
109
|
+
#endif
|
|
107
110
|
/**
|
|
108
111
|
* @details
|
|
109
112
|
* For tests comparing strings, in addition to exact matches,
|
|
@@ -111,12 +114,16 @@ namespace micro_os_plus::micro_test_plus
|
|
|
111
114
|
* (for any characters) and `?` (for a single character)
|
|
112
115
|
*
|
|
113
116
|
* @par Examples
|
|
114
|
-
*
|
|
115
117
|
* ```cpp
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
+
* namespace mt = micro_os_plus::micro_test_plus;
|
|
119
|
+
*
|
|
120
|
+
* mt::expect (mt::utility::is_match ("abc", "a?c")) << "abc matches a?c";
|
|
121
|
+
* mt::expect (mt::utility::is_match ("abc", "a*c")) << "abc matches a*c";
|
|
118
122
|
* ```
|
|
119
123
|
*/
|
|
124
|
+
#if defined(__clang__)
|
|
125
|
+
#pragma clang diagnostic pop
|
|
126
|
+
#endif
|
|
120
127
|
[[nodiscard]] bool
|
|
121
128
|
is_match (std::string_view input, std::string_view pattern)
|
|
122
129
|
{
|
|
@@ -172,9 +179,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
172
179
|
|
|
173
180
|
deferred_reporter_base::~deferred_reporter_base ()
|
|
174
181
|
{
|
|
175
|
-
#if 0 // defined(
|
|
182
|
+
#if 0 // defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
176
183
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
177
|
-
#endif //
|
|
184
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
178
185
|
|
|
179
186
|
if (abort_ && !value_)
|
|
180
187
|
{
|
package/src/test-reporter.cpp
CHANGED
|
@@ -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
|
// ----------------------------------------------------------------------------
|
package/src/test-runner.cpp
CHANGED
|
@@ -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
|
// ----------------------------------------------------------------------------
|
|
@@ -40,9 +39,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
40
39
|
|
|
41
40
|
test_runner::test_runner ()
|
|
42
41
|
{
|
|
43
|
-
#if defined(
|
|
42
|
+
#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
44
43
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
45
|
-
#endif //
|
|
44
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
#pragma GCC diagnostic push
|
|
@@ -52,9 +51,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
52
51
|
void
|
|
53
52
|
test_runner::initialize (int argc, char* argv[], const char* name)
|
|
54
53
|
{
|
|
55
|
-
#if defined(
|
|
54
|
+
#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
56
55
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
57
|
-
#endif //
|
|
56
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
58
57
|
|
|
59
58
|
argc_ = argc;
|
|
60
59
|
argv_ = argv;
|
|
@@ -177,9 +176,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
177
176
|
void
|
|
178
177
|
test_runner::register_test_suite (test_suite_base* suite)
|
|
179
178
|
{
|
|
180
|
-
#if 0 // defined(
|
|
179
|
+
#if 0 // defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
181
180
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
182
|
-
#endif //
|
|
181
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
183
182
|
|
|
184
183
|
if (suites_ == nullptr)
|
|
185
184
|
{
|
package/src/test-suite.cpp
CHANGED
|
@@ -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
|
// ----------------------------------------------------------------------------
|
|
@@ -37,9 +36,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
37
36
|
|
|
38
37
|
test_suite_base::test_suite_base (const char* name)
|
|
39
38
|
{
|
|
40
|
-
#if defined(
|
|
39
|
+
#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
41
40
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
42
|
-
#endif //
|
|
41
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
43
42
|
|
|
44
43
|
name_ = name;
|
|
45
44
|
// The default test suite needs no registration.
|
|
@@ -52,9 +51,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
52
51
|
void
|
|
53
52
|
test_suite_base::run ()
|
|
54
53
|
{
|
|
55
|
-
#if defined(
|
|
54
|
+
#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
56
55
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
57
|
-
#endif //
|
|
56
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
void
|
|
@@ -122,9 +121,9 @@ namespace micro_os_plus::micro_test_plus
|
|
|
122
121
|
|
|
123
122
|
test_suite::~test_suite ()
|
|
124
123
|
{
|
|
125
|
-
#if defined(
|
|
124
|
+
#if defined(MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS)
|
|
126
125
|
printf ("%s\n", __PRETTY_FUNCTION__);
|
|
127
|
-
#endif //
|
|
126
|
+
#endif // MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
// --------------------------------------------------------------------------
|
package/xcdl.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"minimumXcdlRequired": "2.0.0",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"copyright": "Copyright (c) 2022 Liviu Ionescu. All rights reserved.",
|
|
5
|
+
"cdlPackage": {
|
|
6
|
+
"name": "micro-test-plus",
|
|
7
|
+
"description": "µTest++, a lightweight testing framework for embedded platforms",
|
|
8
|
+
"parent": "micro-os-plus",
|
|
9
|
+
"compilerIncludeFolders": [
|
|
10
|
+
"include"
|
|
11
|
+
],
|
|
12
|
+
"compilerSourceFiles": [
|
|
13
|
+
"src/micro-test-plus.cpp",
|
|
14
|
+
"src/test-runner.cpp",
|
|
15
|
+
"src/test-reporter.cpp",
|
|
16
|
+
"src/test-suite.cpp"
|
|
17
|
+
],
|
|
18
|
+
"compilerDefinitions": [],
|
|
19
|
+
"compilerOptions": [],
|
|
20
|
+
"dependencies": [],
|
|
21
|
+
"generatedDefinition": "MICRO_OS_PLUS_HAS_MICRO_TEST_PLUS",
|
|
22
|
+
"cdlOptions": {
|
|
23
|
+
"trace": {
|
|
24
|
+
"display": "Enable trace in µTest++",
|
|
25
|
+
"description": "Log trace diagnostics in the µTest++ testing framework when TRACE is enabled",
|
|
26
|
+
"valueType": "bool",
|
|
27
|
+
"requires": "isEnabled('diag-trace')",
|
|
28
|
+
"generatedDefinition": "MICRO_OS_PLUS_TRACE_MICRO_TEST_PLUS"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
package/LICENSE-Boost
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Boost Software License - Version 1.0 - August 17th, 2003
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person or organization
|
|
4
|
-
obtaining a copy of the software and accompanying documentation covered by
|
|
5
|
-
this license (the "Software") to use, reproduce, display, distribute,
|
|
6
|
-
execute, and transmit the Software, and to prepare derivative works of the
|
|
7
|
-
Software, and to permit third-parties to whom the Software is furnished to
|
|
8
|
-
do so, all subject to the following:
|
|
9
|
-
|
|
10
|
-
The copyright notices in the Software and this entire statement, including
|
|
11
|
-
the above license grant, this restriction and the following disclaimer,
|
|
12
|
-
must be included in all copies of the Software, in whole or in part, and
|
|
13
|
-
all derivative works of the Software, unless such copies or derivative
|
|
14
|
-
works are solely in the form of machine-executable object code generated by
|
|
15
|
-
a source language processor.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
20
|
-
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
21
|
-
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
22
|
-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
23
|
-
DEALINGS IN THE SOFTWARE.
|