Skip to content

Commit 6a5bef4

Browse files
committed
Update unittest section with new invocation
1 parent c3c89b9 commit 6a5bef4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -730,61 +730,61 @@ As shown above, tests exist inside `TESTS\testgroup\testcase\` directories. Plea
730730

731731
## Unit testing
732732

733-
Use the `mbed unittest` command to build and run unit tests, or to generate files for new unit tests.
733+
Use the `mbed test --unittests` command to build and run unit tests, or to generate files for new unit tests.
734734

735-
Build and run unit tests with `mbed unittest`. The arguments are:
735+
Build and run unit tests with `mbed test --unittests`. The arguments are:
736736

737737
* `--compile` to only compile unit tests.
738738
* `--run` to only run unit tests.
739739
* `-c` or `--clean` to clean build directory.
740-
* `-d` or `--debug` to prepare debug build.
740+
* `--profile debug` to prepare debug build.
741741
* `--coverage <TYPE>` to generate code coverage report where TYPE can be "html", "xml" or "both".
742742
* `-m <NAME>` or `--make-program <NAME>` to select which make build tool to use where NAME can be "make", "gmake", "mingw32-make" or "ninja".
743743
* `-g <NAME>` or `--generator <NAME>` to select which CMake generator to use where NAME can be "Unix Makefiles", "MinGW Makefiles" or "Ninja".
744744
* `-r <EXPRESSION>` or `--regex <EXPRESSION>` to run tests matching the regular expression.
745745
* `--build <PATH>` to specify build directory.
746746
* `-v` or `--verbose` for verbose diagnostic output.
747747

748-
Generate files for a new unit test with `mbed unittest --new <FILE>`.
748+
Generate files for a new unit test with `mbed test --unittests --new <FILE>`.
749749

750750
### Building and running unit tests
751751

752752
You can specify to only **build** the unit tests by using the `--compile option:
753753

754754
```
755-
$ mbed unittest --compile
755+
$ mbed test --unittests --compile
756756
```
757757

758758
You can specify to only **run** the unit tests by using the `--run` option:
759759

760760
```
761-
$ mbed unittest --run
761+
$ mbed test --unittests --run
762762
```
763763

764-
If you do not specify any of these, `mbed unittest` will build all available unit tests and run them.
764+
If you do not specify any of these, `mbed test --unittests` will build all available unit tests and run them.
765765

766766
### Running a subset of tests
767767

768768
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:
769769

770770
```
771-
$ mbed unittest -r cellular
771+
$ mbed test --unittests -r cellular
772772
```
773773

774774
### Getting code coverage
775775

776776
You can generate a code coverage report by using the `--coverage` option. For example to create an html report you can specify:
777777

778778
```
779-
$ mbed unittest --coverage html
779+
$ mbed test --unittests --coverage html
780780
```
781781

782782
### Creating new unit tests
783783

784784
All unit tests are under `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:
785785

786786
```
787-
$ mbed unittest --new rtos/Semaphore.cpp
787+
$ mbed test --unittests --new rtos/Semaphore.cpp
788788
```
789789

790790
## Publishing your changes

0 commit comments

Comments
 (0)