@micro-os-plus/micro-test-plus 3.0.0 → 3.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.
@@ -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/meson.build CHANGED
@@ -16,7 +16,7 @@
16
16
  #
17
17
  # `subdir('xpacks/micro-os-plus-micro-test-plus')`
18
18
  #
19
- # The result is a library and a dependency that can be refered as:
19
+ # The result is a library and a dependency that can be referred as:
20
20
  #
21
21
  # `dependencies: [micro_os_plus_micro_test_plus_dependency],`
22
22
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@micro-os-plus/micro-test-plus",
3
- "version": "3.0.0",
4
- "description": "A source library xPack with µTest++, a testing framework for embedded platforms",
3
+ "version": "3.1.0",
4
+ "description": "A source library xPack with µTest++, a lightweight testing framework for embedded platforms",
5
5
  "main": "",
6
6
  "scripts": {
7
7
  "npm-install": "npm install",
@@ -37,7 +37,7 @@
37
37
  "@xpack-dev-tools/cmake": "3.21.6-1.1",
38
38
  "@xpack-dev-tools/meson-build": "0.60.3-1.1",
39
39
  "@xpack-dev-tools/ninja-build": "1.10.2-5.1",
40
- "@micro-os-plus/build-helper": "2.6.3",
40
+ "@micro-os-plus/build-helper": "2.7.1",
41
41
  "@micro-os-plus/diag-trace": "3.0.0"
42
42
  },
43
43
  "xpack": {
@@ -597,7 +597,7 @@
597
597
  "xpm link --config {{ configuration.name }} @micro-os-plus/semihosting",
598
598
  "xpm link --config {{ configuration.name }} @micro-os-plus/startup",
599
599
  "xpm link --config {{ configuration.name }} @micro-os-plus/version",
600
- "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core-m"
600
+ "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core"
601
601
  ],
602
602
  "prepare": "{{ properties.commandCMakePrepareWithToolchain }}",
603
603
  "build": [
@@ -618,7 +618,7 @@
618
618
  "@micro-os-plus/semihosting": "4.0.0",
619
619
  "@micro-os-plus/startup": "3.0.0",
620
620
  "@micro-os-plus/version": "7.1.2",
621
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
621
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
622
622
  }
623
623
  },
624
624
  "qemu-mps2-an386-cmake-release": {
@@ -641,7 +641,7 @@
641
641
  "xpm link --config {{ configuration.name }} @micro-os-plus/semihosting",
642
642
  "xpm link --config {{ configuration.name }} @micro-os-plus/startup",
643
643
  "xpm link --config {{ configuration.name }} @micro-os-plus/version",
644
- "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core-m"
644
+ "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core"
645
645
  ],
646
646
  "prepare": "{{ properties.commandCMakePrepareWithToolchain }}",
647
647
  "build": [
@@ -662,7 +662,7 @@
662
662
  "@micro-os-plus/semihosting": "4.0.0",
663
663
  "@micro-os-plus/startup": "3.0.0",
664
664
  "@micro-os-plus/version": "7.1.2",
665
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
665
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
666
666
  }
667
667
  },
668
668
  "qemu-mps2-an386-meson-debug": {
@@ -682,7 +682,7 @@
682
682
  "xpm link --config {{ configuration.name }} @micro-os-plus/semihosting",
683
683
  "xpm link --config {{ configuration.name }} @micro-os-plus/startup",
684
684
  "xpm link --config {{ configuration.name }} @micro-os-plus/version",
685
- "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core-m"
685
+ "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core"
686
686
  ],
687
687
  "prepare": "{{ properties.commandMesonPrepareCross }}",
688
688
  "build": [
@@ -703,7 +703,7 @@
703
703
  "@micro-os-plus/semihosting": "4.0.0",
704
704
  "@micro-os-plus/startup": "3.0.0",
705
705
  "@micro-os-plus/version": "7.1.2",
706
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
706
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
707
707
  }
708
708
  },
709
709
  "qemu-mps2-an386-meson-release": {
@@ -723,7 +723,7 @@
723
723
  "xpm link --config {{ configuration.name }} @micro-os-plus/semihosting",
724
724
  "xpm link --config {{ configuration.name }} @micro-os-plus/startup",
725
725
  "xpm link --config {{ configuration.name }} @micro-os-plus/version",
726
- "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core-m"
726
+ "xpm link --config {{ configuration.name }} @xpack-3rd-party/arm-cmsis-core"
727
727
  ],
728
728
  "prepare": "{{ properties.commandMesonPrepareCross }}",
729
729
  "build": [
@@ -744,7 +744,7 @@
744
744
  "@micro-os-plus/semihosting": "4.0.0",
745
745
  "@micro-os-plus/startup": "3.0.0",
746
746
  "@micro-os-plus/version": "7.1.2",
747
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
747
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
748
748
  }
749
749
  },
750
750
  "stm32f4discovery-cmake-debug": {
@@ -786,7 +786,7 @@
786
786
  "@micro-os-plus/semihosting": "4.0.0",
787
787
  "@micro-os-plus/startup": "3.0.0",
788
788
  "@micro-os-plus/version": "7.1.2",
789
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
789
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
790
790
  }
791
791
  },
792
792
  "stm32f4discovery-cmake-release": {
@@ -828,7 +828,7 @@
828
828
  "@micro-os-plus/semihosting": "4.0.0",
829
829
  "@micro-os-plus/startup": "3.0.0",
830
830
  "@micro-os-plus/version": "7.1.2",
831
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
831
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
832
832
  }
833
833
  },
834
834
  "stm32f4discovery-meson-debug": {
@@ -871,7 +871,7 @@
871
871
  "@micro-os-plus/semihosting": "4.0.0",
872
872
  "@micro-os-plus/startup": "3.0.0",
873
873
  "@micro-os-plus/version": "7.1.2",
874
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
874
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
875
875
  }
876
876
  },
877
877
  "stm32f4discovery-meson-release": {
@@ -914,7 +914,7 @@
914
914
  "@micro-os-plus/semihosting": "4.0.0",
915
915
  "@micro-os-plus/startup": "3.0.0",
916
916
  "@micro-os-plus/version": "7.1.2",
917
- "@xpack-3rd-party/arm-cmsis-core-m": "5.4.0-5"
917
+ "@xpack-3rd-party/arm-cmsis-core": "5.4.0-6"
918
918
  }
919
919
  }
920
920
  }
@@ -103,11 +103,14 @@ namespace micro_os_plus::micro_test_plus
103
103
  #else
104
104
  printf ("Built with an unknown compiler");
105
105
  #endif
106
- #if defined(__ARM_PCS_VFP)
106
+ #if !(defined(__APPLE__) || defined(__linux__) || defined(__unix__) || defined(WIN32))
107
+ // This is relevant only on bare-metal.
108
+ #if defined(__ARM_PCS_VFP) || defined(__ARM_FP)
107
109
  printf (", with FP");
108
110
  #else
109
111
  printf (", no FP");
110
112
  #endif
113
+ #endif
111
114
  #if defined(__EXCEPTIONS)
112
115
  printf (", with exceptions");
113
116
  #else
@@ -144,8 +147,11 @@ namespace micro_os_plus::micro_test_plus
144
147
  {
145
148
  for (auto suite : *suites_)
146
149
  {
147
- default_test_suite_ = suite;
150
+ current_test_suite = suite;
151
+
152
+ suite->begin_test_suite ();
148
153
  suite->run ();
154
+ suite->end_test_suite();
149
155
 
150
156
  was_successful &= suite->was_successful ();
151
157
  }
@@ -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>