Skip to content

Bare metal greentea support #11721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions TESTS/configs/baremetal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"requires": [
"bare-metal",
"rtos-api",
"greentea-client",
"utest",
"unity",
"psa",
"mbed-crypto",
"mbedtls",
"psa-compliance-framework",
"filesystem",
"littlefs",
"mbed-trace",
"device_key",
"storage_tdb_internal",
"storage_filesystem",
"storage_tdb_external",
"lora",
"nfc",
"network-emac",
"nanostack-libservice",
"flashiap-block-device",
"system-storage",
"filesystemstore",
"SecureStore",
"storage",
"kv-map",
"direct-access-devicekey",
"tdbstore",
"kv-config",
"events",
"kv-global-api",
"sd",
"nvstore"
],
"target_overrides": {
"*": {
"target.device_has_remove": ["EMAC", "USBDEVICE"]
}
}
}
1 change: 0 additions & 1 deletion TESTS/events/queue/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
#include "mbed_events.h"
#include "mbed.h"
#include "rtos.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
Expand Down
1 change: 0 additions & 1 deletion TESTS/events/timing/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
#include "mbed_events.h"
#include "mbed.h"
#include "rtos.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
Expand Down
4 changes: 3 additions & 1 deletion TESTS/integration/COMMON/download_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

#if INTEGRATION_TESTS

#include "mbed.h"
#include "unity/unity.h"
#include "greentea-client/test_env.h"
Expand Down Expand Up @@ -202,4 +204,4 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz

return received_bytes;
}

#endif // INTEGRATION_TESTS
1 change: 0 additions & 1 deletion TESTS/integration/COMMON/download_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
/*
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

size_t download_test(NetworkInterface *interface, const unsigned char *data, size_t data_length, size_t buff_size, uint32_t thread_id = 0);

2 changes: 2 additions & 0 deletions TESTS/integration/COMMON/file_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/*
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/
#if INTEGRATION_TESTS

#include "mbed.h"
#include "unity/unity.h"
Expand Down Expand Up @@ -103,3 +104,4 @@ void file_test_read(const char *file, size_t offset, const unsigned char *data,
float(data_length) / 1024, float(data_length) / timer.read() / 1024, timer.read());
}

#endif //#if INTEGRATION_TESTS
1 change: 0 additions & 1 deletion TESTS/integration/COMMON/file_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
/*
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

void file_test_write(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size);

void file_test_read(const char *file, size_t offset, const unsigned char *data, size_t data_length, size_t block_size);
9 changes: 5 additions & 4 deletions TESTS/integration/fs-single/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#else

#include "mbed.h"
#include "FATFileSystem.h"
#include "LittleFileSystem.h"
Expand All @@ -30,10 +34,6 @@
#include "common_defines_test.h"
#include "file_test.h"

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#endif

#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
#include MBED_CONF_APP_BASICS_TEST_FILENAME
#else
Expand Down Expand Up @@ -162,3 +162,4 @@ int main()

return !Harness::run(specification);
}
#endif // !INTEGRATION_TESTS
9 changes: 5 additions & 4 deletions TESTS/integration/fs-threaded/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#else

#include "mbed.h"
#include "FATFileSystem.h"
#include "LittleFileSystem.h"
Expand All @@ -30,10 +34,6 @@
#include "common_defines_test.h"
#include "file_test.h"

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#endif

#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
#include MBED_CONF_APP_BASICS_TEST_FILENAME
#else
Expand Down Expand Up @@ -181,3 +181,4 @@ int main()

return !Harness::run(specification);
}
#endif // !INTEGRATION_TESTS
9 changes: 5 additions & 4 deletions TESTS/integration/net-single/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#else

#include "mbed.h"
#include "utest/utest.h"
#include "unity/unity.h"
Expand All @@ -29,10 +33,6 @@
#include "download_test.h"
#include <string>

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#endif

#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
#include MBED_CONF_APP_BASICS_TEST_FILENAME
#else
Expand Down Expand Up @@ -139,3 +139,4 @@ int main()

return !Harness::run(specification);
}
#endif // !INTEGRATION_TESTS
9 changes: 5 additions & 4 deletions TESTS/integration/net-threaded/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#else

#include "mbed.h"
#include "utest/utest.h"
#include "unity/unity.h"
Expand All @@ -29,10 +33,6 @@
#include "download_test.h"
#include <string>

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#endif

#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
#include MBED_CONF_APP_BASICS_TEST_FILENAME
#else
Expand Down Expand Up @@ -173,3 +173,4 @@ int main()

return !Harness::run(specification);
}
#endif // !INTEGRATION_TESTS
8 changes: 5 additions & 3 deletions TESTS/integration/stress-net-fs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
*/

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#else

#include "mbed.h"
#include "FATFileSystem.h"
#include "LittleFileSystem.h"
Expand All @@ -32,9 +36,6 @@
#include "file_test.h"
#include <string>

#if !INTEGRATION_TESTS
#error [NOT_SUPPORTED] integration tests not enabled for this target
#endif

#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
#include MBED_CONF_APP_BASICS_TEST_FILENAME
Expand Down Expand Up @@ -243,3 +244,4 @@ int main()

return !Harness::run(specification);
}
#endif // !INTEGRATION_TESTS
8 changes: 6 additions & 2 deletions TESTS/mbed_drivers/crc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void test_thread(void)
TEST_ASSERT_EQUAL(0xCBF43926, crc);
}

#if defined(MBED_CONF_RTOS_PRESENT)
void test_thread_safety()
{
char test[] = "123456789";
Expand All @@ -153,13 +154,16 @@ void test_thread_safety()
// Wait for the thread to finish
t1.join();
}
#endif

Case cases[] = {
Case("Test supported polynomials", test_supported_polynomials),
Case("Test partial CRC", test_partial_crc),
Case("Test SD CRC polynomials", test_sd_crc),
Case("Test not supported polynomials", test_any_polynomial),
Case("Test thread safety", test_thread_safety)
#if defined(MBED_CONF_RTOS_PRESENT)
Case("Test thread safety", test_thread_safety),
#endif
Case("Test not supported polynomials", test_any_polynomial)
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
Expand Down
4 changes: 4 additions & 0 deletions TESTS/mbed_drivers/lp_timeout/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] Low power timer test cases require a RTOS to run.
#else

#if !DEVICE_LPTICKER
#error [NOT_SUPPORTED] Low power timer not supported for this target
Expand Down Expand Up @@ -95,3 +98,4 @@ int main()
}

#endif // !DEVICE_LPTICKER
#endif //!defined(MBED_CONF_RTOS_PRESENT)
1 change: 0 additions & 1 deletion TESTS/mbed_drivers/lp_timer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "rtos.h"
#include "hal/us_ticker_api.h"

#if !DEVICE_LPTICKER
Expand Down
15 changes: 10 additions & 5 deletions TESTS/mbed_drivers/race_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] Race test test cases require RTOS with multithread to run
#else

#if !DEVICE_USTICKER
#error [NOT_SUPPORTED] UsTicker need to be enabled for this test.
#else

#include "mbed.h"
#include "rtos.h"
#include "greentea-client/test_env.h"
Expand All @@ -22,10 +30,6 @@
#include "SingletonPtr.h"
#include <stdio.h>

#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER
#error [NOT_SUPPORTED] Test not supported for single threaded enviroment. UsTicker need to be enabled for this test.
#else

using namespace utest::v1;

#define TEST_STACK_SIZE 512
Expand Down Expand Up @@ -132,4 +136,5 @@ int main()
Harness::run(specification);
}

#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER
#endif // !DEVICE_USTICKER
#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_THREAD)
1 change: 0 additions & 1 deletion TESTS/mbed_drivers/rtc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "rtos.h"
#include "rtc_api.h"

#if !DEVICE_RTC || !DEVICE_USTICKER
Expand Down
1 change: 0 additions & 1 deletion TESTS/mbed_drivers/timer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include "rtos.h"
#include "hal/us_ticker_api.h"

#if !DEVICE_USTICKER
Expand Down
6 changes: 6 additions & 0 deletions TESTS/mbed_drivers/watchdog/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] Watchdog test cases require a RTOS to run.
#else

#if !DEVICE_WATCHDOG
#error [NOT_SUPPORTED] Watchdog not supported for this target
#else
Expand Down Expand Up @@ -284,3 +289,4 @@ int main()
}

#endif // !DEVICE_WATCHDOG
#endif // !defined(MBED_CONG_RTOS_PRESENT)
5 changes: 5 additions & 0 deletions TESTS/mbed_drivers/watchdog_reset/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] Watchdog reset test cases require a RTOS to run.
#else

#if !DEVICE_WATCHDOG
#error [NOT_SUPPORTED] Watchdog not supported for this target
#else
Expand Down Expand Up @@ -334,3 +338,4 @@ int main()
return !Harness::run(specification);
}
#endif // !DEVICE_WATCHDOG
#endif // !defined(MBED_CONF_RTOS_PRESENT)
6 changes: 6 additions & 0 deletions TESTS/mbed_hal/common_tickers/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#if !defined(MBED_RTOS_CONF_PRESENT)
#error [NOT_SUPPORTED] usticker test cases require a RTOS to run
#else

#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
Expand Down Expand Up @@ -606,3 +611,4 @@ int main()
return !Harness::run(specification);
}
#endif // !DEVICE_USTICKER
#endif // !defined(MBED_RTOS_CONF_PRESENT)
4 changes: 4 additions & 0 deletions TESTS/mbed_hal/common_tickers_freq/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* freqency is valid.
*/

#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] common tickers frequency test cases require a RTOS to run.
#else

#include "mbed.h"
#include "greentea-client/test_env.h"
Expand Down Expand Up @@ -206,3 +209,4 @@ int main()
}

#endif // defined(SKIP_TIME_DRIFT_TESTS) || !DEVICE_USTICKER
#endif // !defined(MBED_RTOS_CONF_PRESENT)
Loading