Skip to content

Commit 2b4ff78

Browse files
authored
Merge pull request #5738 from ARMmbed/release-candidate
Release candidate for mbed-os-5.7.1
2 parents 8b54959 + de20588 commit 2b4ff78

File tree

126 files changed

+20991
-948
lines changed

Some content is hidden

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

126 files changed

+20991
-948
lines changed

.travis.yml

Lines changed: 67 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
language: python
2+
python:
3+
'2.7'
14

25
env:
36
global:
@@ -11,13 +14,22 @@ env:
1114
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
1215
}\nDATA'
1316
17+
cache:
18+
pip: true
19+
directories:
20+
- $HOME/.cache/apt
21+
- $HOME/gcc-arm-none-eabi-6-2017-q2-update
22+
1423
before_install:
1524
- bash -c "$STATUS" pending "Local $NAME testing is in progress"
1625
# Make sure pipefail
1726
- set -o pipefail
27+
# Setup apt to cache
28+
- mkdir -p $HOME/.cache/apt/partial
29+
- sudo rm -rf /var/cache/apt/archives
30+
- sudo ln -s $HOME/.cache/apt /var/cache/apt/archives
1831
# Setup ppa to make sure arm-none-eabi-gcc is correct version
1932
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
20-
- sudo add-apt-repository -y ppa:libreoffice/libreoffice-4-2
2133
- sudo apt-get update -qq
2234

2335
after_success:
@@ -28,22 +40,12 @@ after_failure:
2840

2941
matrix:
3042
include:
31-
- python: '2.7'
32-
env:
33-
- NAME=tools
43+
- env:
44+
- NAME=docs
3445
install:
3546
# Install dependencies
36-
- sudo apt-get install gcc-arm-embedded doxygen
37-
- pip install --user -r requirements.txt
38-
- pip install --user pytest
39-
- pip install --user pylint
40-
- pip install --user hypothesis
41-
- pip install --user mock
42-
- pip install --user coverage
43-
- pip install --user coveralls
47+
- sudo apt-get install doxygen
4448
# Print versions we use
45-
- arm-none-eabi-gcc --version
46-
- python --version
4749
- doxygen --version
4850
before_script:
4951
# Create BUILD directory for tests
@@ -52,39 +54,52 @@ matrix:
5254
# Assert that the Doxygen build produced no warnings.
5355
# The strange command below asserts that the Doxygen command had an
5456
# output of zero length
55-
- |
56-
doxygen doxyfile_options 2>&1 | tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
57+
- >
58+
doxygen doxyfile_options 2>&1 |
59+
tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
5760
# Assert that all binary libraries are named correctly
58-
# The strange command below asserts that there are exactly 0 libraries that do
59-
# not start with lib
60-
- |
61-
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" | tee BUILD/badlibs | sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
61+
# The strange command below asserts that there are exactly 0 libraries
62+
# that do not start with lib
63+
- >
64+
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" |
65+
tee BUILD/badlibs |
66+
sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
6267
# Assert that all assebler files are named correctly
63-
# The strange command below asserts that there are exactly 0 libraries that do
64-
# end with .s
65-
- |
66-
find -name "*.s" | tee BUILD/badasm | sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
68+
# The strange command below asserts that there are exactly 0 libraries
69+
# that do end with .s
70+
- >
71+
find -name "*.s" | tee BUILD/badasm |
72+
sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
73+
74+
- env:
75+
- NAME=tools
76+
install:
77+
# Install dependencies
78+
- sudo apt-get install gcc-arm-embedded
79+
- pip install -r requirements.txt
80+
- pip install pytest pylint hypothesis mock coverage coveralls
81+
# Print versions we use
82+
- arm-none-eabi-gcc --version
83+
- python --version
84+
script:
6785
# Run local testing on tools
68-
# Note: These take ~40 minutes to run
6986
- PYTHONPATH=. coverage run -a -m pytest tools/test
7087
- python2 tools/test/pylint.py
7188
- coverage run -a tools/project.py -S | sed -n '/^Total/p'
72-
# - python2 -u tools/build_travis.py | sed -n '/^Executing/p'
7389
- coverage html
7490
after_success:
7591
# Coverage for tools
7692
- coveralls
7793
# Report success since we have overridden default behaviour
7894
- bash -c "$STATUS" success "Local $NAME testing has passed"
7995

80-
- python: '2.7'
81-
env:
96+
- env:
8297
- NAME=events
8398
- EVENTS=events
8499
install:
85100
# Install dependencies
86101
- sudo apt-get install gcc-arm-embedded
87-
- pip install --user -r requirements.txt
102+
- pip install -r requirements.txt
88103
# Print versions we use
89104
- arm-none-eabi-gcc --version
90105
- gcc --version
@@ -96,14 +111,13 @@ matrix:
96111
# Run local equeue tests
97112
- make -C $EVENTS/equeue test
98113

99-
- python: '2.7'
100-
env:
114+
- env:
101115
- NAME=littlefs
102116
- LITTLEFS=features/filesystem/littlefs
103117
install:
104118
# Install dependencies
105119
- sudo apt-get install gcc-arm-embedded fuse libfuse-dev
106-
- pip install --user -r requirements.txt
120+
- pip install -r requirements.txt
107121
- git clone https://github.com/armmbed/spiflash-driver.git
108122
# Print versions
109123
- arm-none-eabi-gcc --version
@@ -143,13 +157,16 @@ matrix:
143157
- ls MOUNT/littlefs
144158
- CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs QUIET=1
145159

146-
- python: '2.7'
147-
env:
148-
- NAME=mbed2
160+
- &mbed-2
161+
env: NAME=mbed2-NXP
149162
install:
150163
# Install dependencies
151-
- sudo apt-get install gcc-arm-embedded
152-
- pip install --user -r requirements.txt
164+
- export GCC_DIR=$HOME/gcc-arm-none-eabi-6-2017-q2-update
165+
- export GCC_ARCHIVE=$HOME/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
166+
- export GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2?revision=2cc92fb5-3e0e-402d-9197-bdfc8224d8a5?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,6-2017-q2-update
167+
- if [ ! -e $GCC_DIR/bin/arm-none-eabi-gcc ]; then wget $GCC_URL -O $GCC_ARCHIVE; tar xfj $GCC_ARCHIVE -C $HOME; fi
168+
- export PATH=$PATH:$GCC_DIR/bin
169+
- pip install -r requirements.txt
153170
# Print versions we use
154171
- arm-none-eabi-gcc --version
155172
- python --version
@@ -158,6 +175,16 @@ matrix:
158175
- mkdir BUILD
159176
script:
160177
# Run local mbed 2 testing
161-
# Note: These take ~40 minutes to run
162-
- python2 -u tools/build_travis.py | sed -n '/^Executing/p'
163-
178+
- python2 -u tools/build_travis.py --vendor "${NAME#mbed2-}"
179+
- <<: *mbed-2
180+
env: NAME=mbed2-STM
181+
- <<: *mbed-2
182+
env: NAME=mbed2-NORDIC
183+
- <<: *mbed-2
184+
env: NAME=mbed2-SILICON_LABS
185+
- <<: *mbed-2
186+
env: NAME=mbed2-MAXIM
187+
- <<: *mbed-2
188+
env: NAME=mbed2-ATMEL
189+
- <<: *mbed-2
190+
env: NAME=mbed2-NUVOTON

README.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
# ARM mbed OS
1+
[![Mbed OS][mbed-os-logo]][mbed-os-link]
2+
3+
[![Build status release][mbed-travis-release-svg]][mbed-travis-release]
4+
[![Build status master][mbed-travis-master-svg]][mbed-travis-master]
5+
[![Tools coverage status][mbed-coveralls-tools-svg]][mbed-coveralls-tools]
6+
[![PR progress][mbed-waffle-svg]][mbed-waffle]
7+
8+
[mbed-os-logo]: logo.png
9+
[mbed-os-link]: https://www.mbed.com/en/platform/mbed-os/
10+
[mbed-travis-master]: https://travis-ci.org/ARMmbed/mbed-os
11+
[mbed-travis-master-svg]: https://travis-ci.org/ARMmbed/mbed-os.svg?branch=master
12+
[mbed-travis-release]: https://travis-ci.org/ARMmbed/mbed-os/branches
13+
[mbed-travis-release-svg]: https://travis-ci.org/ARMmbed/mbed-os.svg?branch=latest
14+
[mbed-coveralls-tools]: https://coveralls.io/github/ARMmbed/mbed-os?branch=master
15+
[mbed-coveralls-tools-svg]: https://coveralls.io/repos/github/ARMmbed/mbed-os/badge.svg?branch=master
16+
[mbed-waffle]: https://waffle.io/ARMmbed/mbed-os
17+
[mbed-waffle-svg]: https://badge.waffle.io/ARMmbed/mbed-os.svg?columns=all
18+
19+
Arm Mbed OS is an open source embedded operating system designed specifically for the "things" in the Internet of Things. It includes all the features you need to develop a connected product based on an Arm Cortex-M microcontroller, including security, connectivity, an RTOS and drivers for sensors and I/O devices.
20+
21+
Mbed OS provides a platform that includes:
22+
* Security foundations.
23+
* Cloud management services.
24+
* Drivers for sensors, I/O devices and connectivity.
25+
26+
## Release notes
27+
The [release notes](https://os.mbed.com/releases) detail the current release. You can also find information about previous versions.
28+
29+
## Getting started for developers
230

3-
mbed OS is an open-source embedded operating system designed for the "things" in the Internet of Things (IoT). mbed OS includes the features you need to develop a connected product using an ARM Cortex-M microcontroller.
4-
5-
mbed OS provides a platform that includes:
6-
- Security foundations.
7-
- Cloud management services.
8-
- Drivers for sensors, I/O devices and connectivity.
9-
10-
mbed OS is modular, configurable software that you can customize it to your device and to reduce memory requirements by excluding unused software.
11-
12-
13-
## Release Notes
14-
15-
The [Release Notes](https://docs.mbed.com/docs/mbed-os-release-notes/en/latest/) detail the current release and previous versions.
16-
17-
## Continuous Integration Status
18-
19-
We run continuous integration on all of our branches and pull requests to verify the stability of mbed OS. The following are the Travis CI indicators for mbed OS.
20-
21-
- Master branch [![Master Branch CI Badge](https://travis-ci.org/ARMmbed/mbed-os.svg?branch=master)](https://travis-ci.org/ARMmbed/mbed-os)
22-
- Latest release [![Latest Tag CI Badge](https://travis-ci.org/ARMmbed/mbed-os.svg?branch=latest)](https://travis-ci.org/ARMmbed/mbed-os/branches)
23-
24-
Tools coverage [![Coverage Status](https://coveralls.io/repos/github/ARMmbed/mbed-os/badge.svg?branch=master)](https://coveralls.io/github/ARMmbed/mbed-os?branch=master)
25-
26-
## Getting Started for Developers
27-
28-
You need [mbed CLI](https://github.com/ARMmbed/mbed-cli) to build mbed OS. For more details, read the [mbed OS Handbook](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/).
31+
We have a [developer webiste](https://os.mbed.com) for asking questions, engaging with others, finding information on boards and components, using an online IDE and compiler, reading the documentation and learning about what's new and what's coming next in Mbed OS.
2932

30-
## Getting Started for Contributors
33+
## Getting started for contributors
3134

32-
We have a [Contributing and Publishing Guide](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/cont/contributing/) in the mbed OS Handbook.
35+
We also have a [contributing and publishing guide](https://os.mbed.com/contributing/) that covers licensing, contributor agreements and style guidelines.

TESTS/mbed_drivers/race_test/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ static SingletonPtr<TestClass> test_class;
5858
static void main_func_race()
5959
{
6060
get_test_class();
61+
TEST_ASSERT_EQUAL_UINT32(1, instance_count);
6162
}
6263

6364
static void main_class_race()
6465
{
6566
test_class->do_something();
67+
TEST_ASSERT_EQUAL_UINT32(1, instance_count);
6668
}
6769

6870
void test_case_func_race()
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2017 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#include "mbed.h"
17+
#include "greentea-client/test_env.h"
18+
#include "utest/utest.h"
19+
#include "unity/unity.h"
20+
21+
using utest::v1::Case;
22+
23+
24+
class InstanceTest {
25+
public:
26+
InstanceTest()
27+
{
28+
_instance_counter++;
29+
}
30+
31+
static int get_instance_counter()
32+
{
33+
return _instance_counter;
34+
}
35+
36+
private:
37+
static int _instance_counter;
38+
};
39+
40+
int InstanceTest::_instance_counter = 0;
41+
42+
43+
SingletonPtr<InstanceTest> singleton;
44+
45+
46+
/** Test SingletonPtr lazy initialization
47+
*
48+
* Given a global singleton of type SingletonPtr<InstanceTest>
49+
* When before first singleton use
50+
* Then underneath object is yet not created
51+
*/
52+
void test_lazy_initialization()
53+
{
54+
TEST_ASSERT_MESSAGE(InstanceTest::get_instance_counter() == 0, "Initialized before first use!!!");
55+
}
56+
57+
/** Test SingletonPtr single instance
58+
*
59+
* Given a singleton of type SingletonPtr<InstanceTest>
60+
*
61+
* When after first singleton use
62+
* Then underneath object was created exactly once
63+
*
64+
* When after second singleton use
65+
* Then underneath object was created exactly once
66+
* and both (ref1 and ref2) are references to same instance
67+
*
68+
*/
69+
void test_single_instance()
70+
{
71+
InstanceTest *ref1 = singleton.get();
72+
TEST_ASSERT_NOT_NULL(ref1);
73+
74+
TEST_ASSERT_EQUAL_INT(1, InstanceTest::get_instance_counter());
75+
76+
InstanceTest *ref2 = singleton.get();
77+
TEST_ASSERT_NOT_NULL(ref2);
78+
79+
TEST_ASSERT_EQUAL_INT(1, InstanceTest::get_instance_counter());
80+
81+
// same instance
82+
TEST_ASSERT_EQUAL_PTR(ref1, ref2);
83+
}
84+
85+
utest::v1::status_t test_setup(const size_t number_of_cases)
86+
{
87+
GREENTEA_SETUP(10, "default_auto");
88+
return utest::v1::verbose_test_setup_handler(number_of_cases);
89+
}
90+
91+
Case cases[] = {
92+
Case("Test lazy initialization", test_lazy_initialization),
93+
Case("Test single instance", test_single_instance),
94+
};
95+
96+
utest::v1::Specification specification(test_setup, cases);
97+
98+
int main()
99+
{
100+
return !utest::v1::Harness::run(specification);
101+
}

TESTS/netsocket/gethostbyname/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ using namespace utest::v1;
2929

3030
// Hostname for testing against
3131
// Must have A and AAAA records
32-
#ifndef MBED_DNS_TEST_HOST
33-
#define MBED_DNS_TEST_HOST "connector.mbed.com"
32+
#ifndef MBED_CONF_APP_DNS_TEST_HOST
33+
#define MBED_CONF_APP_DNS_TEST_HOST "connector.mbed.com"
3434
#endif
3535

3636

@@ -59,9 +59,9 @@ void net_bringup() {
5959
// DNS tests
6060
void test_dns_query() {
6161
SocketAddress addr;
62-
int err = net->gethostbyname(MBED_DNS_TEST_HOST, &addr);
62+
int err = net->gethostbyname(MBED_CONF_APP_DNS_TEST_HOST, &addr);
6363
printf("DNS: query \"%s\" => \"%s\"\n",
64-
MBED_DNS_TEST_HOST, addr.get_ip_address());
64+
MBED_CONF_APP_DNS_TEST_HOST, addr.get_ip_address());
6565

6666
TEST_ASSERT_EQUAL(0, err);
6767
TEST_ASSERT((bool)addr);
@@ -70,9 +70,9 @@ void test_dns_query() {
7070

7171
void test_dns_query_pref() {
7272
SocketAddress addr;
73-
int err = net->gethostbyname(MBED_DNS_TEST_HOST, &addr, ip_pref);
73+
int err = net->gethostbyname(MBED_CONF_APP_DNS_TEST_HOST, &addr, ip_pref);
7474
printf("DNS: query %s \"%s\" => \"%s\"\n",
75-
ip_pref_repr, MBED_DNS_TEST_HOST, addr.get_ip_address());
75+
ip_pref_repr, MBED_CONF_APP_DNS_TEST_HOST, addr.get_ip_address());
7676

7777
TEST_ASSERT_EQUAL(0, err);
7878
TEST_ASSERT((bool)addr);

0 commit comments

Comments
 (0)