Skip to content

Commit

Permalink
Merge pull request #4889 from ARMmbed/release-candidate
Browse files Browse the repository at this point in the history
Release candidate for mbed-os-5.5.5
  • Loading branch information
0xc0170 authored Aug 14, 2017
2 parents 4c256f0 + 4e1ec4a commit db4be94
Show file tree
Hide file tree
Showing 162 changed files with 2,679 additions and 1,153 deletions.
15 changes: 15 additions & 0 deletions TESTS/events/queue/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_events.h"
#include "mbed.h"
#include "rtos.h"
Expand Down
15 changes: 15 additions & 0 deletions TESTS/events/timing/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_events.h"
#include "mbed.h"
#include "rtos.h"
Expand Down
17 changes: 16 additions & 1 deletion TESTS/integration/basic/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "test_env.h"

int main() {
GREENTEA_SETUP(15, "default_auto");
GREENTEA_TESTSUITE_RESULT(true);
}
}
15 changes: 15 additions & 0 deletions TESTS/mbed_functional/callback/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbed_functional/callback_big/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbed_functional/callback_small/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbed_functional/functionpointer/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
Expand Down
110 changes: 110 additions & 0 deletions TESTS/mbed_hal/lp_us_tickers/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "utest/utest.h"
#include "unity/unity.h"
#include "greentea-client/test_env.h"

#include "mbed.h"
#include "us_ticker_api.h"
#include "ticker_api.h"

using namespace utest::v1;

namespace {
volatile bool complete;
const ticker_interface_t* intf;
}

/* Ticker init should be run just once, thus read should always return a value that
* increases (no reset).
*/
void test_ticker_init(void)
{
intf->init();
uint32_t previous = intf->read();

intf->init();
uint32_t current = intf->read();
TEST_ASSERT_TRUE_MESSAGE(previous <= current, "init() changed the counter");

previous = intf->read();
intf->init();
current = intf->read();
TEST_ASSERT_TRUE_MESSAGE(previous <= current, "init() changed the counter");
}

/* Read multiple times, each returned time should be bigger than the previous one
* Counter up.
*/
void test_ticker_read(void)
{
// this test assumes that to wrap around we would need to run >60 minutes
// therefore wrapping should not happen - previous <= current
const uint32_t test_loop = 15000;
uint32_t previous = intf->read();
uint32_t current;
for (uint32_t i = 0UL; i < test_loop; i++) {
current = intf->read();
TEST_ASSERT_TRUE_MESSAGE(previous <= current, "us ticker counter wrapped around");
}
}

/* Implement simple read while loop to check if time is increasing (counter up)
*/
void test_ticker_read_loop()
{
uint32_t future_time = intf->read() + 10000UL;
while (intf->read() < future_time);
TEST_ASSERT_TRUE_MESSAGE(future_time <= intf->read(), "Future time is in the past");
}

utest::v1::status_t us_ticker_setup(const Case *const source, const size_t index_of_case)
{
intf = get_us_ticker_data()->interface;
return greentea_case_setup_handler(source, index_of_case);
}

#if DEVICE_LOWPOWERTIMER
utest::v1::status_t lp_ticker_setup(const Case *const source, const size_t index_of_case)
{
intf = get_lp_ticker_data()->interface;
return greentea_case_setup_handler(source, index_of_case);
}
#endif

Case cases[] = {
Case("us ticker HAL - Init", us_ticker_setup, test_ticker_init),
Case("us ticker HAL - Read", us_ticker_setup, test_ticker_read),
Case("us ticker HAL - Read in the loop", us_ticker_setup, test_ticker_read_loop),
#if DEVICE_LOWPOWERTIMER
Case("lp ticker HAL - Init", lp_ticker_setup, test_ticker_init),
Case("lp ticker HAL - Read", lp_ticker_setup, test_ticker_read),
Case("lp ticker HAL - Read in the loop", lp_ticker_setup, test_ticker_read_loop),
#endif
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
{
GREENTEA_SETUP(20, "default_auto");
return greentea_test_setup_handler(number_of_cases);
}

Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);

int main()
{
Harness::run(specification);
}
15 changes: 15 additions & 0 deletions TESTS/mbedmicro-mbed/attributes/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdint.h>

Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbedmicro-mbed/call_before_main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "greentea-client/test_env.h"

namespace {
Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbedmicro-mbed/cpp/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "greentea-client/test_env.h"

#define PATTERN_CHECK_VALUE 0xF0F0ADAD
Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbedmicro-mbed/div/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <utility> // std::pair
#include "mbed.h"
#include "greentea-client/test_env.h"
Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbedmicro-mbed/static_assert/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdint.h>

Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbedmicro-rtos-mbed/isr/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "rtos.h"
Expand Down
15 changes: 15 additions & 0 deletions TESTS/mbedmicro-rtos-mbed/mail/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "rtos.h"
Expand Down
Loading

0 comments on commit db4be94

Please sign in to comment.