Skip to content

Commit 3c0dfc7

Browse files
authored
Merge pull request #319 from screamerbg/0.9-polishing
Update README.md table of contents
2 parents 5a6bc01 + da61afc commit 3c0dfc7

File tree

1 file changed

+81
-51
lines changed

1 file changed

+81
-51
lines changed

README.md

Lines changed: 81 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,33 @@ This document covers the installation and usage of mbed CLI.
66

77
## Table of Contents
88

9-
1. [Requirements](#requirements)
9+
1. [Using mbed CLI](#using-mbed-cli)
1010
1. [Installing and uninstalling](#installing-mbed-cli)
11-
1. [Working context and command help](#working-context)
11+
1. [Understanding working context and program root](#before-you-begin-understanding-the-working-context-and-program-root)
1212
1. [Creating and importing programs](#creating-and-importing-programs)
13-
1. [Creating a new program](#creating-a-new-program)
14-
2. [Importing an existing program](#importing-an-existing-program)
13+
1. [Creating a new program](#creating-a-new-program-for-mbed-os-5)
14+
2. [Importing an existing program](#importing-an-existing-program)
1515
1. [Adding and removing libraries](#adding-and-removing-libraries)
16-
1. [Adding a library](#adding-a-library)
17-
2. [Removing a library](#removing-a-library)
18-
1. [Updating programs and libraries](#updating-programs-and-libraries)
19-
1. [Synchronizing library references](#synchronizing-library-references)
20-
2. [Update scenarios](#update-scenarios)
21-
3. [Updating to an upstream version](#updating-to-an-upstream-version)
22-
1. [Publishing your changes](#publishing-your-changes)
23-
1. [Checking status](#checking-status)
24-
2. [Pushing upstream](#pushing-upstream)
2516
1. [Compiling code](#compiling-code)
26-
1. [Toolchain selection](#toolchain-selection)
27-
2. [Compiling your program](#compiling-your-program)
28-
3. [Compiling static libraries](#compiling-static-libraries)
17+
1. [Toolchain selection](#toolchain-selection)
18+
2. [Compiling your program](#compiling-your-program)
19+
3. [Compiling static libraries](#compiling-static-libraries)
2920
4. [Compile configuration system](#compile-configuration-system)
3021
5. [Compile-time customizations](#compile-time-customizations)
31-
6. [Automating toolchain and target selection](#automating-toolchain-and-target-selection)
3222
1. [Exporting to desktop IDEs](#exporting-to-desktop-ides)
3323
1. [Testing](#testing)
3424
1. [Finding available tests](#finding-available-tests)
35-
2. [Change the test action](#change-the-test-action)
25+
2. [Compiling and running tests](#compiling-and-running-tests)
3626
3. [Limiting the test scope](#limiting-the-test-scope)
3727
4. [Test directory structure](#test-directory-structure)
28+
1. [Publishing your changes](#publishing-your-changes)
29+
1. [Checking status](#checking-status)
30+
2. [Pushing upstream](#pushing-upstream)
31+
1. [Updating programs and libraries](#updating-programs-and-libraries)
32+
1. [Updating to an upstream version](#updating-to-an-upstream-version)
33+
2. [Update examples](#update-examples)
3834
1. [mbed CLI configuration](#mbed-cli-configuration)
35+
1. [Troubleshooting](#troubleshooting)
3936

4037

4138
## Using mbed CLI
@@ -419,7 +416,9 @@ ___Macros___
419416

420417
You can specify macros in your command line using the -D option. For example:
421418

422-
`$ mbed compile -t GCC_ARM -m K64F -c -DUVISOR_PRESENT`
419+
```
420+
$ mbed compile -t GCC_ARM -m K64F -c -DUVISOR_PRESENT
421+
```
423422

424423
___Compiling in debug mode___
425424

@@ -478,52 +477,30 @@ mbedgt: test suite report:
478477
+--------------+---------------+---------------------------------+--------+--------------------+-------------+
479478
| target | platform_name | test suite | result | elapsed_time (sec) | copy_method |
480479
+--------------+---------------+---------------------------------+--------+--------------------+-------------+
481-
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | OK | 21.09 | shell |
480+
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | OK | 21.09 | shell |
482481
+--------------+---------------+---------------------------------+--------+--------------------+-------------+
483482
mbedgt: test suite results: 1 OK
484483
mbedgt: test case report:
485-
+--------------+---------------+---------------------------------+---------------------------------+--------+--------+--------+--------------------+
484+
+--------------+---------------+------------------------------------------+--------+--------+--------+--------------------+
486485
| target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
487-
+--------------+---------------+---------------------------------+---------------------------------+--------+--------+--------+--------------------+
486+
+--------------+---------------+--------------------+---------------------+--------+--------+--------+--------------------+
488487
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | TESTS-unit-myclass1 | 1 | 0 | OK | 5.00 |
489488
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | TESTS-unit-myclass2 | 1 | 0 | OK | 5.00 |
490489
| K64F-GCC_ARM | K64F | TESTS-unit-myclass | TESTS-unit-myclass3 | 1 | 0 | OK | 5.00 |
491-
+--------------+---------------+---------------------------------+---------------------------------+--------+--------+--------+--------------------+
490+
+--------------+---------------+--------------------+---------------------+--------+--------+--------+--------------------+
492491
mbedgt: test case results: 3 OK
493492
mbedgt: completed in 21.28 sec
494493
```
495494

496495
The arguments to `test` are:
497-
498496
* `-m <MCU>` to select a target for the compilation.
499497
* `-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).
500-
* `--compile-list` to list all the tests that can be built. For example:
501-
```
502-
$ mbed test --compile-list
503-
Test Case:
504-
Name: TESTS-functional-test1
505-
Path: .\TESTS\functional\test1
506-
Test Case:
507-
Name: TESTS-functional-test2
508-
Path: .\TESTS\functional\test2
509-
Test Case:
510-
Name: TESTS-functional-test3
511-
Path: .\TESTS\functional\test3
512-
```
513-
* `--run-list` to list all the tests that can be run (they must be built first). For example:
514-
```
515-
$ mbed test --run-list
516-
mbedgt: test specification file '.\.build/tests\K64F\ARM\test_spec.json' (specified with --test-spec option)
517-
mbedgt: using '.\.build/tests\K64F\ARM\test_spec.json' from current directory!
518-
mbedgt: available tests for built 'K64F-ARM', location '.\.build/tests\K64F\ARM'
519-
test 'TESTS-functional-test1'
520-
test 'TESTS-functional-test2'
521-
test 'TESTS-functional-test3'
522-
```
523-
* `--compile` to only compile the tests. For example, `$ mbed test -m K64F -t GCC_ARM --compile`.
524-
* `--run` to only run the tests. For example, `$ mbed test -m K64F -t GCC_ARM --run`.
525-
* `-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`.
526-
* `--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.
527504
* `--build <BUILD>` to select the build directory. Default: `.build/` inside your program.
528505
* `--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
529506
* `-c or --clean` to clean the build directory before compiling,
@@ -533,6 +510,59 @@ The arguments to `test` are:
533510

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

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+
536566
### Test directory structure
537567

538568
Test code exists in the following directory structure:

0 commit comments

Comments
 (0)