Skip to content

Commit a387a74

Browse files
committed
2 parents 54a1e61 + a07a118 commit a387a74

File tree

1,631 files changed

+350188
-165721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,631 files changed

+350188
-165721
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ dist
77
MANIFEST
88

99
# Private settings
10-
private_settings.py
10+
mbed_settings.py
1111

1212
# Default Build Directory
13-
build/
13+
.build/
1414
venv/
1515

1616
# Eclipse Project Files

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
---
21
python:
32
- "2.7"
4-
script: "python workspace_tools/build_travis.py"
3+
4+
script: "python tools/build_travis.py"
5+
before_install:
6+
- sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
7+
- sudo apt-get update -qq
8+
- sudo apt-get install -qq gcc-arm-none-eabi --force-yes
9+
# Print versions we use
10+
- arm-none-eabi-gcc --version
11+
- python --version
512
install:
6-
- "sudo $TRAVIS_BUILD_DIR/travis/install_dependencies.sh > /dev/null"
713
- sudo pip install colorama
814
- sudo pip install prettytable
915
- sudo pip install jinja2

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
graft workspace_tools
2-
recursive-exclude workspace_tools *.pyc
1+
graft tools
2+
recursive-exclude tools *.pyc
33
include LICENSE

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Silicon Labs:
9595
* [EFM32 Leopard Gecko](https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/) (Cortex-M3)
9696
* [EFM32 Giant Gecko](https://developer.mbed.org/platforms/EFM32-Giant-Gecko/) (Cortex-M3)
9797
* [EFM32 Wonder Gecko](https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/) (Cortex-M4)
98+
* [EFM32 Pearl Gecko](https://developer.mbed.org/platforms/EFM32-Pearl-Gecko/) (Cortex-M4)
9899

99100
Atmel:
100101
* [SAM R21 XPRO](https://developer.mbed.org/platforms/SAMR21-XPRO/) (Cortex-M0+)
@@ -157,7 +158,7 @@ Develop
157158
```
158159
> "venv/Scripts/activate"
159160
> pip install -r requirements.txt
160-
> cd workspace_tools
161+
> cd tools
161162
> ... do things ...
162163
> "venv/Scripts/deactivate"
163164
```

docs/BUILDING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ Checking out files: 100% (3994/3994), done.
130130
```
131131
$ cd mbed
132132
$ ls
133-
LICENSE MANIFEST.in README.md libraries setup.py travis workspace_tools
133+
LICENSE MANIFEST.in README.md libraries setup.py travis tools
134134
```
135135
Directory structure we are interested in:
136136
```
137-
mbed/workspace_tools/ - test suite scripts, build scripts etc.
137+
mbed/tools/ - test suite scripts, build scripts etc.
138138
mbed/libraries/tests/ - mbed SDK tests,
139139
mbed/libraries/tests/mbed/ - tests for mbed SDK and peripherals tests,
140140
mbed/libraries/tests/net/echo/ - tests for Ethernet interface,
@@ -153,9 +153,9 @@ Workspace tools are set of Python scripts used off-line by Mbed SDK team to:
153153
Before we can run our first test we need to configure our test environment a little!
154154
Now we need to tell workspace tools where our compilers are.
155155

156-
* Please to go ```mbed/workspace_tools/``` directory and create empty file called ```private_settings.py```.
156+
* Please to go ```mbed``` directory and create empty file called ```mbed_settings.py```.
157157
```
158-
$ touch private_settings.py
158+
$ touch mbed_settings.py
159159
```
160160
* Populate this file the Python code below:
161161
```python
@@ -203,13 +203,13 @@ GCC_CR_PATH = "C:/Work/toolchains/LPCXpresso_6.1.4_194/lpcxpresso/tools/bin"
203203
IAR_PATH = "C:/Work/toolchains/iar_6_5/arm"
204204
```
205205

206-
Note: Settings in ```private_settings.py``` will overwrite variables with default values in ```mbed/workspace_tools/settings.py``` file.
206+
Note: Settings in ```mbed_settings.py``` will overwrite variables with default values in ```mbed/default_settings.py``` file.
207207

208208
## Build Mbed SDK library from sources
209-
Let's build mbed SDK library off-line from sources using your compiler. We've already cloned mbed SDK sources, we've also installed compilers and added their paths to ```private_settings.py```.
209+
Let's build mbed SDK library off-line from sources using your compiler. We've already cloned mbed SDK sources, we've also installed compilers and added their paths to ```mbed_settings.py```.
210210
We now should be ready to use workspace tools script ```build.py``` to compile and build mbed SDK from sources.
211211

212-
We are still using console. You should be already in ```mbed/workspace_tools/``` directory if not go to ```mbed/workspace_tools/``` and type below command:
212+
We are still using console. You should be already in ```mbed/tools/``` directory if not go to ```mbed/tools/``` and type below command:
213213
```
214214
$ python build.py -m LPC1768 -t ARM
215215
```
@@ -276,7 +276,7 @@ Build successes:
276276

277277
### build.py script
278278

279-
Build script located in mbed/workspace_tools/ is our core script solution to drive compilation, linking and building process for:
279+
Build script located in mbed/tools/ is our core script solution to drive compilation, linking and building process for:
280280

281281
* mbed SDK (with libs like Ethernet, RTOS, USB, USB host).
282282
* Tests which also can be linked with libraries like RTOS or Ethernet.
@@ -426,7 +426,7 @@ $ python build.py -t uARM -m NUCLEO_F334R8 --cppcheck
426426
```
427427

428428
# make.py script
429-
```make.py``` is a ```mbed/workspace_tools/``` script used to build tests (we call them sometimes 'programs') one by one manually. This script allows you to flash board, execute and test it. However, this script is deprecated and will not be described here. Instead please use ```singletest.py``` file to build mbed SDK, tests and run automation for test cases included in ```mbedmicro/mbed```.
429+
```make.py``` is a ```mbed/tools/``` script used to build tests (we call them sometimes 'programs') one by one manually. This script allows you to flash board, execute and test it. However, this script is deprecated and will not be described here. Instead please use ```singletest.py``` file to build mbed SDK, tests and run automation for test cases included in ```mbedmicro/mbed```.
430430
Note: ```make.py``` script depends on existing already built mbed SDK and library sources so you need to pre-build mbed SDK and other libraries (such as RTOS library) to link 'program' (test) with mbed SDK and RTOS library. To pre-build mbed SDK please use ```build.py``` script.
431431

432432
Just for sake of example please see few ways to use ```make.py``` together with Freedom K64F board.

docs/COMMITTERS.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Committing changes to mbedmicro/mbed
2+
23
* Our current branching model is very simple. We are using ```master``` branch to merge all pull requests.
34
* Based on stable ```SHA``` version of ```master``` branch we decide to release and at the same time ```tag``` our build release.
45
* Our current release versioning follows simple integer version: ```94```, ```95```, ```96``` etc.
@@ -33,10 +34,10 @@ Please send pull requests with changes which are:
3334
* Test results are added.
3435

3536
After you send us your pull request our Gate Keeper will change the state of pull request to:
36-
``` enhancement``` or ```bug``` when pull request creates new improvement or fixed issue.
37+
``` enhancement``` or ```bug``` when pull request creates new improvement or fixed issue.
3738
Than we will set for you labels:
38-
```review``` to let you know your pull request is under review and you can expect review related comments from us.
39-
```in progress``` when you pull request requires some additional change which will for now block this pull request from merging.
39+
```review``` to let you know your pull request is under review and you can expect review related comments from us.
40+
```in progress``` when you pull request requires some additional change which will for now block this pull request from merging.
4041
At the end we will remove ```review``` label and merge your change if everything goes well.
4142

4243
## C++ coding rules & coding guidelines
@@ -197,7 +198,7 @@ $ astyle.exe --style=kr --indent=spaces=4 --indent-switches $(FULL_CURRENT_PATH)
197198
```
198199
199200
## Python coding rules & coding guidelines
200-
Some of our tools in workspace_tools are written in ```Python 2.7```. In case of developing tools for python we prefer to keep similar code styles across all Python source code. Please note that not all rules must be enforced. For example we do not limit you to 80 characters per line, just be sure your code can fit to widescreen display.
201+
Some of our tools in tools are written in ```Python 2.7```. In case of developing tools for python we prefer to keep similar code styles across all Python source code. Please note that not all rules must be enforced. For example we do not limit you to 80 characters per line, just be sure your code can fit to widescreen display.
201202
202203
Please stay compatible with ```Python 2.7``` but nothing stops you to write your code so in the future it will by Python 3 friendly.
203204
@@ -210,7 +211,7 @@ Some general guidelines:
210211
* Please document your code, write comments and ```doc``` sections for each function or class you implement.
211212
212213
### Static Code Analizers for Python
213-
If you are old-school developer for sure you remember tools like lint. "lint was the name originally given to a particular program that flagged some suspicious and non-portable constructs (likely to be bugs) in C language source code." Now lint-like programs are used to check similar code issues for multiple languages, also for Python. Please do use them if you want to commit new code to workspace_tools and other mbed SDK Python tooling.
214+
If you are old-school developer for sure you remember tools like lint. "lint was the name originally given to a particular program that flagged some suspicious and non-portable constructs (likely to be bugs) in C language source code." Now lint-like programs are used to check similar code issues for multiple languages, also for Python. Please do use them if you want to commit new code to tools and other mbed SDK Python tooling.
214215
215216
Below is the list Python lint tools you may want to use:
216217
@@ -253,17 +254,17 @@ class HostRegistry:
253254
```
254255

255256
## Testing
256-
Please refer to TESTING.md document for detais regarding mbed SDK test suite and build scripts included in ```mbed/workspace_tools/```.
257+
Please refer to TESTING.md document for detais regarding mbed SDK test suite and build scripts included in ```mbed/tools/```.
257258

258259
## Before pull request checklist
259260
* Your pull request description section contains:
260-
* Rationale – tell us why you submitted this pull request. This is your change to write us summary of your change.
261-
* Description – describe changes you’ve made and tell us which new features / functionalities were implemented.
262-
* Manual / Cookbook / Handbook – you can put here manual, cookbook or handbook related to your change / enhancement. Your documentation can stay with pull request.
261+
* Rationale – tell us why you submitted this pull request. This is your change to write us summary of your change.
262+
* Description – describe changes you’ve made and tell us which new features / functionalities were implemented.
263+
* Manual / Cookbook / Handbook – you can put here manual, cookbook or handbook related to your change / enhancement. Your documentation can stay with pull request.
263264
* Test results (if applicable).
264265
* Make sure you followed project's coding rules and styles.
265266
* No dependencies are created to external C/C++ libraries which are not included already in our repository.
266267
* Please make sure that in your module all functions have unique prefix (no name space collisions).
267-
* You reused existing functionality, please do not add or rewrite existing code. E.g. use mbed’s ```FunctionPointer``` if possible to store your function pointers. Do not write another wrapper for it. We already got one. If some functionality is missing, just add it! Extend our APIs wisely!
268+
* You reused existing functionality, please do not add or rewrite existing code. E.g. use mbed’s ```FunctionPointer``` if possible to store your function pointers. Do not write another wrapper for it. We already got one. If some functionality is missing, just add it! Extend our APIs wisely!
268269
* Were you consistent? Please continue using style / code formatting, variables naming etc. in file they are modifying.
269-
* Your code compiles and links. Also doesn’t generate additional compilation warnings.
270+
* Your code compiles and links. Also doesn’t generate additional compilation warnings.

docs/TESTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Test suit allows users to run locally on their machines Mbed SDK’s tests inclu
66
Each test is supervised by python script called “host test” which will at least Test suite is using build script API to compile and build test source together with required by test libraries like CMSIS, Mbed, Ethernet, USB etc.
77

88
## What is host test?
9-
Test suite supports test supervisor concept. This concept is realized by separate Python script called ```host test```. Host tests can be found in ```mbed/workspace_tools/host_tests/``` directory. Note: In newer mbed versions (mbed OS) host tests will be separate library.
9+
Test suite supports test supervisor concept. This concept is realized by separate Python script called ```host test```. Host tests can be found in ```mbed/tools/host_tests/``` directory. Note: In newer mbed versions (mbed OS) host tests will be separate library.
1010

1111
Host test script is executed in parallel with test runner to monitor test execution. Basic host test just monitors device's default serial port for test results returned by test runner. Simple tests will print test result on serial port. In other cases host tests can for example judge by test results returned by test runner if test passed or failed. It all depends on test itself.
1212

1313
In some cases host test can be TCP server echoing packets from test runner and judging packet loss. In other cases it can just check if values returned from accelerometer are actually valid (sane).
1414

1515
## Test suite core: singletest.py script
1616

17-
```singletest.py``` script located in ```mbed/workspace_tools/``` is a test suite script which allows users to compile, build tests and test runners (also supports CppUTest unit test library). Script also is responsible for test execution on devices selected by configuration files.
17+
```singletest.py``` script located in ```mbed/tools/``` is a test suite script which allows users to compile, build tests and test runners (also supports CppUTest unit test library). Script also is responsible for test execution on devices selected by configuration files.
1818

1919
### Parameters of singletest.py
2020

@@ -37,7 +37,7 @@ After connecting boards to our host machine (PC) we can check which serial ports
3737
* ```NUCLEO_F103RB``` serial port is on ```COM11``` and disk drive is ```I:```.
3838
If you are working under Linux your port and disk could look like /dev/ttyACM5 and /media/usb5.
3939

40-
This information is needed to create ```muts_all.json``` configuration file. You can create it in ```mbed/workspace_tools/``` directory:
40+
This information is needed to create ```muts_all.json``` configuration file. You can create it in ```mbed/tools/``` directory:
4141
```
4242
$ touch muts_all.json
4343
```
@@ -67,8 +67,8 @@ Its name will be passed to ```singletest.py``` script after ```-M``` (MUTs speci
6767

6868
Note: We will leave field ```peripherals``` empty for the sake of this example. We will explain it later. All you need to do now is to properly fill fields ```mcu```, ```port``` and ```disk```.
6969

70-
Note: Please make sure files muts_all.json and test_spec.json are in workspace_tools/ directory. We will assume in this example they are.
71-
Where to find ```mcu``` names? You can use option ```-S``` of ```build.py``` script (in ```mbed/workspace_tools/``` directory) to check all supported off-line MCUs names.
70+
Note: Please make sure files muts_all.json and test_spec.json are in tools/ directory. We will assume in this example they are.
71+
Where to find ```mcu``` names? You can use option ```-S``` of ```build.py``` script (in ```mbed/tools/``` directory) to check all supported off-line MCUs names.
7272

7373
Note: If you update mbed device firmware or even disconnect / reconnect mbed device you may find that serial port / disk configuration changed. You need to update configuration file accordingly or you will face connection problems and obviously tests will not run.
7474

@@ -172,9 +172,9 @@ For our example purposes let's assume we only have Keil ARM compiler, so let's c
172172
```
173173
#### Run your tests
174174

175-
After you configure all your MUTs and compilers you are ready to run tests. Make sure your devices are connected and your configuration files reflect your current configuration (serial ports, devices). Go to workspace_tools directory in your mbed location.
175+
After you configure all your MUTs and compilers you are ready to run tests. Make sure your devices are connected and your configuration files reflect your current configuration (serial ports, devices). Go to tools directory in your mbed location.
176176
```
177-
$ cd workspace_tools/
177+
$ cd tools/
178178
```
179179
and execute test suite script.
180180
```
@@ -244,7 +244,7 @@ In below example we would like to have all test binaries called ```firmware.bin`
244244
```
245245
$ python singletest.py -i test_spec.json -M muts_all.json --firmware-name firmware
246246
```
247-
* Where to find test list? Tests are defined in file ```tests.py``` in ```mbed/workspace_tools/``` directory. ```singletest.py``` uses test metadata in ```tests.py``` to resolve libraries dependencies and build tests for proper platforms and peripherals. Option ```-R``` can be used to get test names and direct path and test configuration.
247+
* Where to find test list? Tests are defined in file ```tests.py``` in ```mbed/tools/``` directory. ```singletest.py``` uses test metadata in ```tests.py``` to resolve libraries dependencies and build tests for proper platforms and peripherals. Option ```-R``` can be used to get test names and direct path and test configuration.
248248
```
249249
$ python singletest.py -R
250250
+-------------+-----------+---------------------------------------+--------------+-------------------+----------+--------------------------------------------------------+
@@ -344,7 +344,7 @@ test_spec.json:
344344
```
345345
Note:
346346
* Please make sure device is connected before we will start running tests.
347-
* Please make sure files ```muts_all.json``` and ```test_spec.json``` are in ```mbed/workspace_tools/``` directory.
347+
* Please make sure files ```muts_all.json``` and ```test_spec.json``` are in ```mbed/tools/``` directory.
348348
Now you can call test suite and execute tests:
349349
```
350350
$ python singletest.py -i test_spec.json -M muts_all.json
@@ -451,7 +451,7 @@ We want to create directory structure similar to one below:
451451
└───mbed
452452
├───libraries
453453
├───travis
454-
└───workspace_tools
454+
└───tools
455455
```
456456

457457
Please go to directory with your project. For example it could be c:\Projects\Project.
@@ -492,7 +492,7 @@ $ git clone https://github.com/mbedmicro/mbed.git
492492
$ hg clone https://mbed.org/users/rgrover1/code/cpputest/
493493
```
494494

495-
After above three steps you should have proper directory structure. All you need to do now is to configure your ```private_settings.py``` in ```mbed/workspace_tools/``` directory. Please refer to mbed SDK build script documentation for details.
495+
After above three steps you should have proper directory structure. All you need to do now is to configure your ```mbed_settings.py``` in ```mbed``` directory. Please refer to mbed SDK build script documentation for details.
496496

497497
## CppUTest with mbed port
498498
To make sure you actualy have CppUTest library with mbed SDK port you can go to CppUTest ```armcc``` platform directory:
@@ -577,7 +577,7 @@ utest
577577
```
578578

579579
## Define unit tests in mbed SDK test suite structure
580-
All tests defined in test suite are described in ```mbed/workspace_tools/tests.py``` file. This file stores data structure ```TESTS``` which is a list of simple structures describing each test. Below you can find example of ```TESTS``` structure which is configuring one of the unit tests.
580+
All tests defined in test suite are described in ```mbed/tools/tests.py``` file. This file stores data structure ```TESTS``` which is a list of simple structures describing each test. Below you can find example of ```TESTS``` structure which is configuring one of the unit tests.
581581
```
582582
.
583583
.

0 commit comments

Comments
 (0)