Skip to content

Commit 610e35d

Browse files
authored
Merge pull request #8163 from ARMmbed/release-candidate
Release candidate for mbed-os-5.10.0-rc3
2 parents dd2d159 + fb7c802 commit 610e35d

File tree

21 files changed

+108
-40
lines changed

21 files changed

+108
-40
lines changed

TESTS/netsocket/dns/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ Case cases[] = {
178178
#endif
179179
Case("SYNCHRONOUS_DNS", SYNCHRONOUS_DNS),
180180
Case("SYNCHRONOUS_DNS_MULTIPLE", SYNCHRONOUS_DNS_MULTIPLE),
181+
#ifdef MBED_EXTENDED_TESTS
181182
Case("SYNCHRONOUS_DNS_CACHE", SYNCHRONOUS_DNS_CACHE),
183+
#endif
182184
Case("SYNCHRONOUS_DNS_INVALID", SYNCHRONOUS_DNS_INVALID),
183185
};
184186

UNITTESTS/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ set(unittest-includes-base
100100
"${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX"
101101
"${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX/rtx5/Include"
102102
"${PROJECT_SOURCE_DIR}/../cmsis"
103+
"${PROJECT_SOURCE_DIR}/../features/frameworks/nanostack-libservice/mbed-client-libservice/"
103104
)
104105

105106
# Create a list for test suites.

UNITTESTS/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sudo easy_install pip
4545

4646
### Installing covr
4747

48-
Install gcovr code coverage tool globally with `pip install 'gcovr>=4.1'` or using virtualenv:
48+
Install gcovr code coverage tool globally with `pip install "gcovr>=4.1"` or using virtualenv:
4949

5050
#### virtualenv
5151

@@ -79,7 +79,7 @@ mbed test --unittests
7979

8080
A subset of tests can be run by providing `-r` flag for the tool which runs tests matching a regular expression.
8181

82-
e.g. `mbed test --unittests --run -r features_netsocket`
82+
e.g. `mbed test --unittests --run -r features-netsocket`
8383

8484
### Build manually without Python tools
8585

@@ -105,7 +105,7 @@ mingw32-make
105105

106106
#### Custom CMake variables
107107

108-
Usage:
108+
Usage:
109109
`cmake [RELATIVE PATH TO UNITTESTS DIR] [OPTIONS]`
110110

111111
Keyword variables (usage `cmake -D<VARIABLE>(:<TYPE>)=<value>`:
@@ -157,17 +157,17 @@ mkdir UNITTESTS/build
157157
cd UNITTESTS/build
158158
cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE:STRING=html ..
159159
make
160-
./features_netsocket_InternetSocket
161-
gcovr -r ../.. --html --html-detail -o ./index.html ./CMakeFiles/features_netsocket_InternetSocket.MbedOS.dir/
160+
./features-netsocket-InternetSocket
161+
gcovr -r ../.. --html --html-detail -o ./index.html ./CMakeFiles/features-netsocket-InternetSocket.MbedOS.dir/
162162
```
163163
Windows:
164164
```
165165
mkdir UNITTESTS/build
166166
cd UNITTESTS/build
167167
cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE:STRING=html -g "MinGW Makefiles" ..
168168
mingw32-make
169-
features_netsocket_InternetSocket.exe
170-
gcovr -r ..\.. --html --html-detail -o .\index.html .\CMakeFiles\features_netsocket_InternetSocket.MbedOS.dir\
169+
features-netsocket-InternetSocket.exe
170+
gcovr -r ..\.. --html --html-detail -o .\index.html .\CMakeFiles\features-netsocket-InternetSocket.MbedOS.dir\
171171
```
172172

173173
## The structure of unit tests
@@ -203,7 +203,7 @@ Each class to be tested requires two files for unit testing:
203203

204204
A unit test definition file `unittest.cmake` requires variables to be set for a test to be configured. File source paths in `unittest.cmake` files need to be relative to the unit test folder and `CMakeLists.txt`.
205205

206-
* **TEST_SUITE_NAME** - Identifier for the test suite. Use naming convention *PATH_TO_THE_TESTABLE_FILE* e.g. *features_netsocket_InternetSocket*
206+
* **TEST_SUITE_NAME** - Identifier for the test suite. Use naming convention *PATH_TO_THE_TESTABLE_FILE* e.g. *features-netsocket-InternetSocket*
207207
* **unittest-includes** - Include paths for headers needed to build the tests in addition to the base include paths listed in [CMakeLists.txt](CMakeLists.txt). Optional.
208208
* **unittest-sources** - Mbed OS source files and stubs included for the build.
209209
* **unittest-test-sources** - Unit test source files.
@@ -225,7 +225,7 @@ For example to create a unit test for `rtos/Semaphore.cpp`:
225225
1. Create a directory for unit test files in `UNITTESTS/rtos/Semaphore`.
226226
2. Create a test definition file `UNITTESTS/rtos/Semaphore/unittest.cmake` with the following content:
227227
```
228-
set(TEST_SUITE_NAME "rtos_Semaphore")
228+
set(TEST_SUITE_NAME "rtos-Semaphore")
229229
230230
set(unittest-sources
231231
stubs/mbed_assert.c
@@ -291,4 +291,4 @@ TEST_F(TestSemaphore, constructor)
291291

292292
**Problem:** virus protection identifies files generated by CMake as malicious and quarantines the files on Windows.
293293

294-
* **Solution**: restore the false positive files from the quarantine.
294+
* **Solution**: restore the false positive files from the quarantine.

UNITTESTS/features/cellular/framework/AT/AT_CellularBase/unittest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
####################
55

66
# Unit test suite name
7-
set(TEST_SUITE_NAME "cellular_framework_AT_AT_CellularBase")
7+
set(TEST_SUITE_NAME "cellular-framework-AT-AT_CellularBase")
88

99
# Add test specific include paths
1010
set(unittest-includes ${unittest-includes}

UNITTESTS/features/cellular/framework/common/util/unittest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
####################
55

66
# Unit test suite name
7-
set(TEST_SUITE_NAME "cellular_framework_common_util")
7+
set(TEST_SUITE_NAME "cellular-framework-common-util")
88

99
# Add test specific include paths
1010
set(unittest-includes ${unittest-includes}

UNITTESTS/features/netsocket/InternetSocket/unittest.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
####################
55

66
# Unit test suite name
7-
set(TEST_SUITE_NAME "features_netsocket_InternetSocket")
7+
set(TEST_SUITE_NAME "features-netsocket-InternetSocket")
88

99
set(unittest-sources
1010
../features/netsocket/SocketAddress.cpp
1111
../features/netsocket/NetworkStack.cpp
1212
../features/netsocket/InternetSocket.cpp
13+
../features/frameworks/nanostack-libservice/source/libip4string/ip4tos.c
14+
../features/frameworks/nanostack-libservice/source/libip4string/stoip4.c
1315
)
1416

1517
set(unittest-test-sources

UNITTESTS/features/netsocket/NetworkInterface/unittest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
####################
55

66
# Unit test suite name
7-
set(TEST_SUITE_NAME "features_netsocket_NetworkInterface")
7+
set(TEST_SUITE_NAME "features-netsocket-NetworkInterface")
88

99
# Source files
1010
set(unittest-sources

UNITTESTS/features/netsocket/TCPSocket/unittest.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
####################
55

66
# Unit test suite name
7-
set(TEST_SUITE_NAME "features_netsocket_TCPSocket")
7+
set(TEST_SUITE_NAME "features-netsocket-TCPSocket")
88

99
set(unittest-sources
1010
../features/netsocket/SocketAddress.cpp
1111
../features/netsocket/InternetSocket.cpp
1212
../features/netsocket/TCPSocket.cpp
13+
../features/frameworks/nanostack-libservice/source/libip4string/ip4tos.c
14+
../features/frameworks/nanostack-libservice/source/libip4string/stoip4.c
1315
)
1416

1517
set(unittest-test-sources

UNITTESTS/features/netsocket/UDPSocket/unittest.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
####################
55

66
# Unit test suite name
7-
set(TEST_SUITE_NAME "features_netsocket_UDPSocket")
7+
set(TEST_SUITE_NAME "features-netsocket-UDPSocket")
88

99
set(unittest-sources
1010
../features/netsocket/SocketAddress.cpp
1111
../features/netsocket/NetworkStack.cpp
1212
../features/netsocket/InternetSocket.cpp
1313
../features/netsocket/UDPSocket.cpp
14+
../features/frameworks/nanostack-libservice/source/libip4string/ip4tos.c
15+
../features/frameworks/nanostack-libservice/source/libip4string/stoip4.c
1416
)
1517

1618
set(unittest-test-sources

UNITTESTS/platform/CircularBuffer/unittest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
####################
55

66
# Unit test suite name
7-
set(TEST_SUITE_NAME "platform_CircularBuffer")
7+
set(TEST_SUITE_NAME "platform-CircularBuffer")
88

99
set(unittest-sources
1010
)

UNITTESTS/unit_test/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _get_coverage_script(self, coverage_type, excludes):
134134
"./coverage.xml"])
135135

136136
for path in excludes:
137-
args.extend(["-e", path])
137+
args.extend(["-e", path.replace("\\", "/")])
138138

139139
if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
140140
args.append("-v")

doxyfile_options

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,8 @@ EXCLUDE_PATTERNS = */tools/* \
843843
*/cmsis/* \
844844
*/features/cryptocell/* \
845845
*/features/mbedtls/* \
846-
*/features/storage/* \
846+
*/features/storage/cfstore/* \
847+
*/features/storage/FEATURE_STORAGE/* \
847848
*/features/unsupported/* \
848849
*/features/lwipstack/* \
849850
*/features/nanostack/sal-stack-nanostack/* \
@@ -855,7 +856,8 @@ EXCLUDE_PATTERNS = */tools/* \
855856
*/nanostack/sal-stack-nanostack-eventloop/* \
856857
*/ble/generic/* \
857858
*/ble/pal/* \
858-
*/components/* \
859+
*/components/802.15.4_RF/* \
860+
*/components/wifi/* \
859861
*/UNITTESTS/*
860862

861863
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names

doxygen_options.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"EXPAND_AS_DEFINED": "",
1111
"SKIP_FUNCTION_MACROS": "NO",
1212
"STRIP_CODE_COMMENTS": "NO",
13-
"EXCLUDE_PATTERNS": "*/tools/* */targets/* */features/mbedtls/* */features/storage/* */features/unsupported/* */BUILD/* */rtos/TARGET_CORTEX/rtx*/* */cmsis/* */features/lwipstack/* */nanostack/sal-stack-nanostack/* */nanostack/coap-service/* */ble/generic/* */ble/pal/* */mbed-trace/* */mbed-coap/* */nanostack-libservice/* */mbed-client-randlib/* */nanostack/sal-stack-nanostack-eventloop/* */components/* */features/nfc/stack/*"
13+
"EXCLUDE_PATTERNS": "*/tools/* */targets/* */features/mbedtls/* */features/storage/cfstore/* */features/storage/FEATURE_STORAGE/* */features/unsupported/* */BUILD/* */rtos/TARGET_CORTEX/rtx*/* */cmsis/* */features/lwipstack/* */nanostack/sal-stack-nanostack/* */nanostack/coap-service/* */ble/generic/* */ble/pal/* */mbed-trace/* */mbed-coap/* */nanostack-libservice/* */mbed-client-randlib/* */nanostack/sal-stack-nanostack-eventloop/* */components/802.15.4_RF/* */components/wifi/* */features/nfc/stack/*"
1414
}

features/netsocket/TCPServer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ TCPServer::~TCPServer()
2828

2929
nsapi_error_t TCPServer::accept(TCPSocket *connection, SocketAddress *address)
3030
{
31+
_lock.lock();
3132
nsapi_error_t ret;
3233

3334
while (true) {

platform/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
"error-decode-http-url-str": {
7474
"help": "HTTP URL string for ARM Mbed-OS Error Decode microsite",
75-
"value": "\"\\nFor more info, visit: https:/\\/armmbed.github.io/mbedos-error/?error=0x%08X\""
75+
"value": "\"\\nFor more info, visit: https://armmbed.github.io/mbedos-error/?error=0x%08X\""
7676
}
7777
},
7878
"target_overrides": {

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ IntelHex>=1.3
66
junit-xml
77
pyYAML
88
requests
9-
mbed-ls>=1.4.2,==1.*
9+
mbed-ls>=1.5.1,==1.*
1010
mbed-host-tests>=1.1.2
1111
mbed-greentea>=0.2.24
1212
beautifulsoup4>=4
@@ -17,4 +17,4 @@ future>=0.16.0
1717
six>=1.11.0
1818
git+https://github.com/armmbed/[email protected]
1919
mbed-cloud-sdk==2.0.0
20-
icetea>=1.0.1,<2
20+
icetea>=1.0.2,<2

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/TOOLCHAIN_IAR/stm32f411xe.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__]
1818
define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__];
1919

2020
/* Stack and Heap */
21-
/*Heap 1/4 of ram and stack 1/8*/
22-
define symbol __size_cstack__ = 0x4000;
23-
define symbol __size_heap__ = 0x8000;
21+
/*Heap 84kB and stack 1kB */
22+
define symbol __size_cstack__ = 0x400;
23+
define symbol __size_heap__ = 0x15000;
2424
define block CSTACK with alignment = 8, size = __size_cstack__ { };
2525
define block HEAP with alignment = 8, size = __size_heap__ { };
2626
define block STACKHEAP with fixed order { block HEAP, block CSTACK };

tools/device_management.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,40 @@ def inner(options):
8080

8181
def wrap_init(func):
8282
def inner(options):
83-
accounts = AccountManagementAPI()
84-
certs = CertificatesAPI()
83+
if getattr(options, 'api_key', None):
84+
api_key = options.api_key
85+
else:
86+
api_key = getenv("MBED_CLOUD_SDK_API_KEY")
87+
if getattr(options, 'server_address', None):
88+
host_addr = options.server_address
89+
else:
90+
host_addr = getenv("MBED_CLOUD_SDK_HOST",
91+
"https://api.us-east-1.mbedcloud.com/")
92+
config = {
93+
"api_key": api_key,
94+
"host": host_addr,
95+
}
96+
accounts = AccountManagementAPI(config)
97+
certs = CertificatesAPI(config)
8598
api_key = accounts.list_api_keys(filter={
86-
'key': getenv("MBED_CLOUD_SDK_API_KEY")
99+
'key': api_key
87100
}).next()
88-
user = accounts.get_user(api_key.owner_id)
89101
certificates_owned = list(certs.list_certificates())
90102
dev_cert_info = None
91103
for certif in certificates_owned:
92-
if certif.type == "developer" and (certif.owner_id == user.id or
104+
if certif.type == "developer" and (certif.owner_id == api_key.owner_id or
93105
certif.owner_id == api_key.id):
94106
dev_cert_info = certs.get_certificate(certif.id)
95-
LOG.info("Found developer certificate onwed by %s named %s",
96-
user.full_name, dev_cert_info.name)
107+
LOG.info("Found developer certificate named %s",
108+
dev_cert_info.name)
97109
break
98110
else:
99111
LOG.warning(
100112
"Could not find developer certificate for this account."
101113
" Generting a new developer certificate."
102114
)
103115
dev_cert_info = CertificatesAPI().add_developer_certificate(
104-
"mbed-cli-auto {}".format(user.full_name),
116+
"mbed-cli-auto {}".format(api_key.name),
105117
description="cetificate auto-generated by Mbed CLI"
106118
)
107119
LOG.info("Writing developer certificate %s into c file "

tools/run_icetea.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535

3636
def find_build_from_build_data(build_data, id, target, toolchain):
37-
3837
if 'builds' not in build_data:
3938
raise Exception("build data is in wrong format, does not include builds object")
4039

@@ -86,7 +85,7 @@ def create_test_suite(target, tool, icetea_json_output, build_data, tests_by_nam
8685
test_case = {
8786
'name': test['name'],
8887
'config': {
89-
'requirements': test['requirements']
88+
'requirements': set_allowed_platform(test['requirements'], target)
9089
}
9190
}
9291

@@ -104,6 +103,17 @@ def create_test_suite(target, tool, icetea_json_output, build_data, tests_by_nam
104103
return test_suite
105104

106105

106+
def set_allowed_platform(requirements, target):
107+
"""
108+
Allowed platform restrict icetea to run tests on specific board
109+
This targets tests to the right board in case that user has multiple ones connected same time
110+
"""
111+
if '*' not in requirements['duts'].keys():
112+
requirements['duts']['*'] = dict()
113+
requirements['duts']['*']['allowed_platforms'] = [target]
114+
return requirements
115+
116+
107117
def get_applications(test):
108118
ret = list()
109119
for dut in test['requirements']['duts'].values():

tools/test/run_icetea/run_icetea_unittest.py renamed to tools/test/run_icetea/run_icetea_unit_test.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
sys.path.insert(0, ROOT)
2222

2323
from tools.run_icetea import find_build_from_build_data, filter_test_by_build_data, filter_test_by_name, \
24-
get_application_list
24+
get_application_list, set_allowed_platform
2525

2626
"""
2727
Unit tests for run_icetea.py
@@ -32,7 +32,8 @@
3232
{
3333
"id": "TEST_APPS-DEVICE-SOCKET_APP",
3434
"target_name": "K64F",
35-
"toolchain_name": "GCC_ARM"
35+
"toolchain_name": "GCC_ARM",
36+
"result": "OK"
3637
}
3738
]
3839
}
@@ -142,3 +143,36 @@ def test_get_application_list_not_found():
142143

143144
def test_get_application_list_none():
144145
assert 'TEST_APPS-device-socket_app' in get_application_list(icetea_json_output, None)
146+
147+
148+
def test_set_allowed_platform_simple():
149+
ret = set_allowed_platform({"duts": {}}, "K66F")
150+
assert ret['duts']['*']['allowed_platforms'] == ["K66F"]
151+
152+
153+
def test_set_allowed_platform_normal():
154+
ret = set_allowed_platform({
155+
"duts": {
156+
"*": {
157+
"count": 3,
158+
"allowed_platforms": ["K64F"],
159+
"application": {"bin": "hex.bin"}
160+
},
161+
1: {"application": {"bin": "my_hex.bin"}},
162+
2: {"application": {"bin": "my_hex2.bin"}}
163+
}
164+
}, "K66F")
165+
assert ret['duts']['*']['allowed_platforms'] == ["K66F"]
166+
167+
168+
def test_set_allowed_platform_no_changes():
169+
temp = {
170+
"duts": {
171+
"*": {
172+
"count": 3,
173+
"allowed_platforms": ["K64F"],
174+
"application": {"bin": "hex.bin"}
175+
},
176+
}
177+
}
178+
assert temp == set_allowed_platform(temp, "K64F")

0 commit comments

Comments
 (0)