You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the `mbed unittest` command to build and run unit tests, or to generate files for new unit tests.
217
+
Use the `mbed test --unittests` command to build and run unit tests, or to generate files for new unit tests.
218
218
219
-
Build and run unit tests with `mbed unittest`. The arguments are:
219
+
Build and run unit tests with `mbed test --unittests`. The arguments are:
220
220
221
221
*`--compile` to only compile unit tests.
222
222
*`--run` to only run unit tests.
@@ -229,46 +229,46 @@ Build and run unit tests with `mbed unittest`. The arguments are:
229
229
*`--build <PATH>` to specify build directory.
230
230
*`-v` or `--verbose` for verbose diagnostic output.
231
231
232
-
Generate files for a new unit test with `mbed unittest --new <FILE>`.
232
+
Generate files for a new unit test with `mbed test --unittests --new <FILE>`.
233
233
234
234
### Building and running unit tests
235
235
236
236
You can specify to only **build** the unit tests by using the `--compile option:
237
237
238
238
```
239
-
$ mbed unittest --compile
239
+
$ mbed test --unittests --compile
240
240
```
241
241
242
242
You can specify to only **run** the unit tests by using the `--run` option:
243
243
244
244
```
245
-
$ mbed unittest --run
245
+
$ mbed test --unittests --run
246
246
```
247
247
248
-
If you do not specify any of these, `mbed unittest` builds all available unit tests and runs them.
248
+
If you do not specify any of these, `mbed test --unittests` builds all available unit tests and runs them.
249
249
250
250
### Running a subset of tests
251
251
252
252
You can run a **limited set** of unit tests by using the `-r` or `--regex` option. This takes a regular expression, which it compares against the test names. For example, to run all cellular unit tests, you can specify:
253
253
254
254
```
255
-
$ mbed unittest -r cellular
255
+
$ mbed test --unittests -r cellular
256
256
```
257
257
258
258
### Getting code coverage
259
259
260
260
You can generate a code coverage report by using the `--coverage` option. For example, to create an html report, you can specify:
261
261
262
262
```
263
-
$ mbed unittest --coverage html
263
+
$ mbed test --unittests --coverage html
264
264
```
265
265
266
266
### Creating new unit tests
267
267
268
268
All unit tests are under the `mbed-os/UNITTESTS` directory. You can **generate** the necessary files for a unit test by using the `--new` option. For example, to create the files for `rtos/Semaphore.cpp`, you can specify:
0 commit comments