Skip to content

Commit da61afc

Browse files
committed
Further markdown fixes
1 parent 4539141 commit da61afc

File tree

1 file changed

+64
-33
lines changed

1 file changed

+64
-33
lines changed

README.md

Lines changed: 64 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This document covers the installation and usage of mbed CLI.
2222
1. [Exporting to desktop IDEs](#exporting-to-desktop-ides)
2323
1. [Testing](#testing)
2424
1. [Finding available tests](#finding-available-tests)
25-
2. [Change the test action](#change-the-test-action)
25+
2. [Compiling and running tests](#compiling-and-running-tests)
2626
3. [Limiting the test scope](#limiting-the-test-scope)
2727
4. [Test directory structure](#test-directory-structure)
2828
1. [Publishing your changes](#publishing-your-changes)
@@ -477,52 +477,30 @@ mbedgt: test suite report:
477477
+--------------+---------------+---------------------------------+--------+--------------------+-------------+
478478
| target | platform_name | test suite | result | elapsed_time (sec) | copy_method |
479479
+--------------+---------------+---------------------------------+--------+--------------------+-------------+
480-
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | OK | 21.09 | shell |
480+
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | OK | 21.09 | shell |
481481
+--------------+---------------+---------------------------------+--------+--------------------+-------------+
482482
mbedgt: test suite results: 1 OK
483483
mbedgt: test case report:
484-
+--------------+---------------+---------------------------------+---------------------------------+--------+--------+--------+--------------------+
484+
+--------------+---------------+------------------------------------------+--------+--------+--------+--------------------+
485485
| target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
486-
+--------------+---------------+---------------------------------+---------------------------------+--------+--------+--------+--------------------+
486+
+--------------+---------------+--------------------+---------------------+--------+--------+--------+--------------------+
487487
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | TESTS-unit-myclass1 | 1 | 0 | OK | 5.00 |
488488
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | TESTS-unit-myclass2 | 1 | 0 | OK | 5.00 |
489489
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | TESTS-unit-myclass3 | 1 | 0 | OK | 5.00 |
490-
+--------------+---------------+---------------------------------+---------------------------------+--------+--------+--------+--------------------+
490+
+--------------+---------------+--------------------+---------------------+--------+--------+--------+--------------------+
491491
mbedgt: test case results: 3 OK
492492
mbedgt: completed in 21.28 sec
493493
```
494494

495495
The arguments to `test` are:
496-
497496
* `-m <MCU>` to select a target for the compilation.
498497
* `-t <TOOLCHAIN>` to select a toolchain (of those defined in `mbed_settings.py`, see above), where `toolchain` can be either `ARM` (ARM Compiler 5), `GCC_ARM` (GNU ARM Embedded), or `IAR` (IAR Embedded Workbench for ARM).
499-
* `--compile-list` to list all the tests that can be built. For example:
500-
```
501-
$ mbed test --compile-list
502-
Test Case:
503-
Name: TESTS-functional-test1
504-
Path: .\TESTS\functional\test1
505-
Test Case:
506-
Name: TESTS-functional-test2
507-
Path: .\TESTS\functional\test2
508-
Test Case:
509-
Name: TESTS-functional-test3
510-
Path: .\TESTS\functional\test3
511-
```
512-
* `--run-list` to list all the tests that can be run (they must be built first). For example:
513-
```
514-
$ mbed test --run-list
515-
mbedgt: test specification file '.\.build/tests\K64F\ARM\test_spec.json' (specified with --test-spec option)
516-
mbedgt: using '.\.build/tests\K64F\ARM\test_spec.json' from current directory!
517-
mbedgt: available tests for built 'K64F-ARM', location '.\.build/tests\K64F\ARM'
518-
test 'TESTS-functional-test1'
519-
test 'TESTS-functional-test2'
520-
test 'TESTS-functional-test3'
521-
```
522-
* `--compile` to only compile the tests. For example, `$ mbed test -m K64F -t GCC_ARM --compile`.
523-
* `--run` to only run the tests. For example, `$ mbed test -m K64F -t GCC_ARM --run`.
524-
* `-n <TESTS_BY_NAME>` to limit the tests built or run to those listed (by name) in a comma separated list. For example, `$ mbed test -m K64F -t GCC_ARM -n TESTS-functional-test1,TESTS-functional-test2`.
525-
* `--source <SOURCE>` to select the source directory. The default is `.` (the current directory). You can specify multiple source locations, even outside the program tree.
498+
* `--compile-list` to list all the tests that can be built
499+
* `--run-list` to list all the tests that can be ran (they must be built first)
500+
* `--compile` to only compile the tests
501+
* `--run` to only run the tests
502+
* `-n <TESTS_BY_NAME>` to limit the tests built or ran to a comma separated list (ex. test1,test2,test3)
503+
* `--source <SOURCE>` to select the source directory. Default is `.` (the current dir). You can specify multiple source locations, even outside the program tree.
526504
* `--build <BUILD>` to select the build directory. Default: `.build/` inside your program.
527505
* `--options <OPTIONS>` to select compile options. Examples: "debug-info": will generate debugging information; "small-build" will use microlib/nanolib, but limit RTOS to single thread; "save-asm": will save the asm generated by the compiler
528506
* `-c or --clean` to clean the build directory before compiling,
@@ -532,6 +510,59 @@ The arguments to `test` are:
532510

533511
The compiled binaries and test artifacts can be found in the `.build/tests/<TARGET>/<TOOLCHAIN>` directory of your program.
534512

513+
#### Finding available tests
514+
515+
You can find the tests that are available for **building** by using the `--compile-list` option:
516+
517+
```
518+
$ mbed test --compile-list
519+
Test Case:
520+
Name: TESTS-functional-test1
521+
Path: .\TESTS\functional\test1
522+
Test Case:
523+
Name: TESTS-functional-test2
524+
Path: .\TESTS\functional\test2
525+
Test Case:
526+
Name: TESTS-functional-test3
527+
Path: .\TESTS\functional\test3
528+
```
529+
530+
You can find the tests that are available for **running** by using the `--run-list` option:
531+
532+
```
533+
$ mbed test --run-list
534+
mbedgt: test specification file '.\.build/tests\K64F\ARM\test_spec.json' (specified with --test-spec option)
535+
mbedgt: using '.\.build/tests\K64F\ARM\test_spec.json' from current directory!
536+
mbedgt: available tests for built 'K64F-ARM', location '.\.build/tests\K64F\ARM'
537+
test 'TESTS-functional-test1'
538+
test 'TESTS-functional-test2'
539+
test 'TESTS-functional-test3'
540+
```
541+
542+
#### Compiling and running tests
543+
544+
You can specify to only **build** the tests by using the `--compile` option:
545+
546+
```
547+
$ mbed test -m K64F -t GCC_ARM --compile
548+
```
549+
550+
You can specify to only **run** the tests by using the `--run` option:
551+
552+
```
553+
$ mbed test -m K64F -t GCC_ARM --run
554+
```
555+
556+
If you don't specify any of these `mbed test` will first compile all available tests and then run them.
557+
558+
#### Limiting the test scope
559+
560+
You can limit the scope of the tests built and ran by using the `-n` option. This takes a comma separated list of test names as an argument:
561+
562+
```
563+
$ mbed test -m K64F -t GCC_ARM -n TESTS-functional-test1,TESTS-functional-test2
564+
```
565+
535566
### Test directory structure
536567

537568
Test code exists in the following directory structure:

0 commit comments

Comments
 (0)