Skip to content

Commit

Permalink
Merge pull request #9508 from ARMmbed/release-candidate
Browse files Browse the repository at this point in the history
Release candidate for mbed-os-5.11.3
  • Loading branch information
0xc0170 committed Jan 31, 2019
2 parents a8f0c33 + 36bb984 commit a8d1d26
Show file tree
Hide file tree
Showing 212 changed files with 15,589 additions and 624 deletions.
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<!--
Required
Add detailed description of what you are reporting.
Good example: https://os.mbed.com/docs/latest/reference/workflow.html
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html
Things to consider sharing:
- What target does this relate to?
- What toolchain (name + version) are you using?
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
Required
Add here detailed changes summary, testing results, dependencies
Good example: https://os.mbed.com/docs/latest/reference/workflow.html (Pull request template)
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html (Pull request template)
-->


Expand Down
54 changes: 45 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ matrix:
- doxygen doxyfile_options 2>&1
# Once Mbed OS has been fixed, enable the full test by replacing the top line with this:
# - ( ! doxygen doxyfile_options 2>&1 | grep . )

# Assert that all binary libraries are named correctly
# The strange command below asserts that there are exactly 0 libraries
# that do not start with lib
Expand All @@ -106,12 +105,20 @@ matrix:
install:
# Install dependencies
- sudo apt-get install gcc-arm-embedded
- pip install -r requirements.txt
- pip install pytest pylint hypothesis==3.88.3 mock coverage coveralls
# Print versions we use

- arm-none-eabi-gcc --version
# Add additional dependencies specific for testing
- python --version
- |-
tr -d ' ' >> requirements.txt <<< "
mock==2.0.0
pytest==3.3.0
pylint>=1.9,<2
hypothesis>=3,<4
coverage>=4.5,<5
coveralls>=1.5,<2
"
# ... and install.
- pip install -r requirements.txt
- pip list --verbose
script:
# Run local testing on tools
Expand All @@ -122,7 +129,27 @@ matrix:
after_success:
# Coverage for tools
- coveralls
# Report success since we have overridden default behaviour
# Report success since we have overridden default behavior
- bash -c "$STATUS" success "Local $NAME testing has passed"

- env:
- NAME=doxy-spellcheck

install:
- sudo apt-get install aspell

script:
# Run local testing on header file doxy
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh drivers
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh platform
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh events
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh rtos
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh features/netsocket

after_success:
# Coverage for tools
- coveralls
# Report success since we have overridden default behavior
- bash -c "$STATUS" success "Local $NAME testing has passed"

# - <<: *tools-pytest
Expand Down Expand Up @@ -275,9 +302,18 @@ matrix:
- env:
- NAME=licence_check
script:
- echo 'Checking that there is no GPL licence text in code'
- ! git grep -q --ignore-case "gnu general public";
- ! git grep -q --ignore-case "gnu library general public";
- >-
! grep --recursive --max-count=100 --ignore-case --exclude .travis.yml \
"gnu general\|gnu lesser\|lesser general\|public license"
- env:
- NAME=include_check
script:
- echo 'Checking that there are no '#include "mbed.h"' in code where it should not be'
- |
! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*'
- env:
- NAME=psa-autogen
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Mbed OS is an open-source, device software platform for the Internet of Things. Contributions are an important part of the platform, and our goal is to make it as simple as possible to become a contributor.

To encourage productive collaboration, as well as robust, consistent and maintainable code, we have a set of guidelines for [contributing to Mbed OS](https://os.mbed.com/docs/latest/reference/contributing.html).
To encourage productive collaboration, as well as robust, consistent and maintainable code, we have a set of guidelines for [contributing to Mbed OS](https://os.mbed.com/docs/mbed-os/latest/contributing/index.html).
2 changes: 1 addition & 1 deletion TESTS/host_tests/crash_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_steps(self):
wait_after_reset = wait_after_reset if wait_after_reset is not None else DEFAULT_CYCLE_PERIOD

#Wait 2 seconds for system to init
time.sleep(2.0)
time.sleep(7.0)
#self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
self.send_kv(MSG_KEY_DEVICE_ERROR, MSG_VALUE_DUMMY)
time.sleep(5.0)
Expand Down
5 changes: 5 additions & 0 deletions TESTS/mbed_drivers/flashiap/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void flashiap_cross_sector_program_test()
agg_size += sector_size;
address -= sector_size;
}
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, address);
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
ret = flash_device.erase(address, agg_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
Expand Down Expand Up @@ -184,6 +185,7 @@ void flashiap_program_error_test()
TEST_ASSERT_TRUE(address != 0UL);

// unaligned address
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, address);
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
ret = flash_device.erase(address + 1, sector_size);
TEST_ASSERT_EQUAL_INT32(-1, ret);
Expand Down Expand Up @@ -220,6 +222,9 @@ void flashiap_timing_test()
utest_printf("\nFlash timing:\n");
uint32_t sector_size = flash_device.get_sector_size(end_address - 1UL);
uint32_t base_address = end_address - sector_size;
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, base_address);
TEST_SKIP_UNLESS_MESSAGE(base_address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");

timer.start();
for (num_write_sizes = 0; num_write_sizes < max_write_sizes; num_write_sizes++) {
if (write_size > sector_size) {
Expand Down
7 changes: 7 additions & 0 deletions TESTS/mbed_hal/flash/functional_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ void flash_erase_sector_test()
uint32_t last_sector_size = flash_get_sector_size(&test_flash, addr_after_last - 1);
uint32_t last_sector = addr_after_last - last_sector_size;
TEST_ASSERT_EQUAL_INT32(0, last_sector % last_sector_size);

utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, last_sector);
TEST_SKIP_UNLESS_MESSAGE(last_sector >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");

ret = flash_erase_sector(&test_flash, last_sector);
TEST_ASSERT_EQUAL_INT32(0, ret);

Expand All @@ -201,6 +205,9 @@ void flash_program_page_test()

// sector size might not be same as page size
uint32_t erase_sector_boundary = ALIGN_DOWN(address, flash_get_sector_size(&test_flash, address));
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, erase_sector_boundary);
TEST_SKIP_UNLESS_MESSAGE(erase_sector_boundary >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");

ret = flash_erase_sector(&test_flash, erase_sector_boundary);
TEST_ASSERT_EQUAL_INT32(0, ret);

Expand Down
7 changes: 6 additions & 1 deletion TESTS/mbed_platform/crash_reporting/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@ void test_crash_reporting()

// Report readiness
greentea_send_kv(MSG_KEY_DEVICE_READY, MSG_VALUE_DUMMY);
printf("\nMessage sent: %s\n", MSG_KEY_DEVICE_READY);

static char _key[MSG_KEY_LEN + 1] = { };
static char _value[MSG_VALUE_LEN + 1] = { };

printf("\nWaiting for crash inject error message: %s\n", MSG_KEY_DEVICE_ERROR);
greentea_parse_kv(_key, _value, MSG_KEY_LEN, MSG_VALUE_LEN);
printf("\nCrash inject error message received\n");

if (strcmp(_key, MSG_KEY_DEVICE_ERROR) == 0) {
printf("\nForcing error\n");
MBED_ERROR1(MBED_ERROR_OUT_OF_MEMORY, "Executing crash reporting test.", 0xDEADBAD);
TEST_ASSERT_MESSAGE(0, "crash_reporting() error call failed.");
}
Expand All @@ -67,7 +72,7 @@ void test_crash_reporting()

int main(void)
{
GREENTEA_SETUP(30, "crash_reporting");
GREENTEA_SETUP(40, "crash_reporting");
test_crash_reporting();
GREENTEA_TESTSUITE_RESULT(0);

Expand Down
5 changes: 4 additions & 1 deletion TESTS/mbedmicro-rtos-mbed/systimer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ void test_handler_called_once(void)
int32_t sem_slots = st.sem_wait(0);
TEST_ASSERT_EQUAL_INT32(0, sem_slots);

sem_slots = st.sem_wait(osWaitForever);
// Wait in a busy loop to prevent entering sleep or deepsleep modes.
while (sem_slots != 1) {
sem_slots = st.sem_wait(0);
}
us_timestamp_t t2 = st.get_time();
TEST_ASSERT_EQUAL_INT32(1, sem_slots);
TEST_ASSERT_EQUAL_UINT32(1, st.get_tick());
Expand Down
4 changes: 4 additions & 0 deletions TESTS/netsocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ content at minimum:
"help" : "Port of echo server",
"value" : "7"
}
"echo-server-discard-port" : {
"help" : "Discard port of echo server",
"value" : "9"
}
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/dns/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static void net_bringup()
// Test setup
utest::v1::status_t test_setup(const size_t number_of_cases)
{
GREENTEA_SETUP(120, "default_auto");
GREENTEA_SETUP(200, "default_auto");
net_bringup();
return verbose_test_setup_handler(number_of_cases);
}
Expand Down
46 changes: 22 additions & 24 deletions TESTS/netsocket/tcp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
using namespace utest::v1;

namespace {
NetworkInterface *net;
Timer tc_bucket; // Timer to limit a test cases run time
}

Expand All @@ -45,11 +44,6 @@ mbed_stats_socket_t tcp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
char tcp_global::rx_buffer[RX_BUFF_SIZE];
char tcp_global::tx_buffer[TX_BUFF_SIZE];

NetworkInterface *get_interface()
{
return net;
}

void drop_bad_packets(TCPSocket &sock, int orig_timeout)
{
nsapi_error_t err;
Expand All @@ -65,46 +59,50 @@ void drop_bad_packets(TCPSocket &sock, int orig_timeout)

static void _ifup()
{
net = NetworkInterface::get_default_instance();
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address());
}

static void _ifdown()
{
net->disconnect();
NetworkInterface::get_default_instance()->disconnect();
printf("MBED: ifdown\n");
}

nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock)
nsapi_error_t tcpsocket_connect_to_srv(TCPSocket &sock, uint16_t port)
{
SocketAddress tcp_addr;

get_interface()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
NetworkInterface::get_default_instance()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
tcp_addr.set_port(port);

printf("MBED: Server '%s', port %d\n", tcp_addr.get_ip_address(), tcp_addr.get_port());

nsapi_error_t err = sock.open(get_interface());
nsapi_error_t err = sock.open(NetworkInterface::get_default_instance());
if (err != NSAPI_ERROR_OK) {
printf("Error from sock.open: %d\n", err);
return err;
}

return sock.connect(tcp_addr);
}

nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock)
{
SocketAddress tcp_addr;

get_interface()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
tcp_addr.set_port(9);

nsapi_error_t err = sock.open(get_interface());
err = sock.connect(tcp_addr);
if (err != NSAPI_ERROR_OK) {
printf("Error from sock.connect: %d\n", err);
return err;
}

return sock.connect(tcp_addr);
return NSAPI_ERROR_OK;
}

nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock)
{
return tcpsocket_connect_to_srv(sock, MBED_CONF_APP_ECHO_SERVER_PORT);
}

nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock)
{
return tcpsocket_connect_to_srv(sock, MBED_CONF_APP_ECHO_SERVER_DISCARD_PORT);
}

void fill_tx_buffer_ascii(char *buff, size_t len)
Expand Down
5 changes: 3 additions & 2 deletions TESTS/netsocket/tcp/tcpsocket_bind_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ void TCPSOCKET_BIND_ADDRESS()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
SocketAddress sockAddr = SocketAddress(get_interface()->get_ip_address(), 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
SocketAddress sockAddr = SocketAddress(NetworkInterface::get_default_instance()->get_ip_address(), 80);
nsapi_error_t bind_result = sock->bind(sockAddr);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
3 changes: 2 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_invalid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_ADDRESS_INVALID()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
3 changes: 2 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_ADDRESS_NULL()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(NULL, 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
5 changes: 3 additions & 2 deletions TESTS/netsocket/tcp/tcpsocket_bind_address_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ void TCPSOCKET_BIND_ADDRESS_PORT()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
nsapi_error_t bind_result = sock->bind(get_interface()->get_ip_address(), 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(NetworkInterface::get_default_instance()->get_ip_address(), 80);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
Expand Down
3 changes: 2 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_PORT()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
5 changes: 3 additions & 2 deletions TESTS/netsocket/tcp/tcpsocket_bind_port_fail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_PORT_FAIL()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand All @@ -51,7 +52,7 @@ void TCPSOCKET_BIND_PORT_FAIL()
if (!sock2) {
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock2->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock2->open(NetworkInterface::get_default_instance()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock2->bind(1024));

delete sock;
Expand Down
1 change: 1 addition & 0 deletions TESTS/netsocket/tcp/tcpsocket_bind_unopened.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void TCPSOCKET_BIND_UNOPENED()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
Expand Down
Loading

0 comments on commit a8d1d26

Please sign in to comment.