diff --git a/TESTS/baremetal.json b/TESTS/baremetal.json deleted file mode 100644 index fcf6f4d9ac..0000000000 --- a/TESTS/baremetal.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "requires": [ - "bare-metal", - "greentea-client", - "utest", - "unity" - ] -} diff --git a/TESTS/configs/baremetal.json b/TESTS/configs/baremetal.json new file mode 100644 index 0000000000..8de4755add --- /dev/null +++ b/TESTS/configs/baremetal.json @@ -0,0 +1,17 @@ +{ + "requires": [ + "bare-metal", + "greentea-client", + "utest", + "unity", + "psa", + "mbed-crypto", + "mbedtls", + "psa-compliance-framework", + "filesystem", + "littlefs", + "mbed-trace", + "device-key", + "lora" + ] +} diff --git a/TESTS/integration/COMMON/download_test.cpp b/TESTS/integration/COMMON/download_test.cpp index 8a637219c0..e71d566c1f 100644 --- a/TESTS/integration/COMMON/download_test.cpp +++ b/TESTS/integration/COMMON/download_test.cpp @@ -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 +#endif + #include "mbed.h" #include "unity/unity.h" #include "greentea-client/test_env.h" diff --git a/TESTS/integration/COMMON/file_test.cpp b/TESTS/integration/COMMON/file_test.cpp index 2251b32507..68efa6b695 100644 --- a/TESTS/integration/COMMON/file_test.cpp +++ b/TESTS/integration/COMMON/file_test.cpp @@ -20,6 +20,9 @@ /* * 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 +#endif #include "mbed.h" #include "unity/unity.h" diff --git a/TESTS/integration/fs-single/main.cpp b/TESTS/integration/fs-single/main.cpp index 7a423b685e..195f833f92 100644 --- a/TESTS/integration/fs-single/main.cpp +++ b/TESTS/integration/fs-single/main.cpp @@ -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 +#endif + #include "mbed.h" #include "FATFileSystem.h" #include "LittleFileSystem.h" @@ -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 diff --git a/TESTS/integration/fs-threaded/main.cpp b/TESTS/integration/fs-threaded/main.cpp index 06a0b8a5b4..6b09d61579 100644 --- a/TESTS/integration/fs-threaded/main.cpp +++ b/TESTS/integration/fs-threaded/main.cpp @@ -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 +#endif + #include "mbed.h" #include "FATFileSystem.h" #include "LittleFileSystem.h" @@ -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 diff --git a/TESTS/integration/net-single/main.cpp b/TESTS/integration/net-single/main.cpp index 7d91a3af29..44f6481b93 100644 --- a/TESTS/integration/net-single/main.cpp +++ b/TESTS/integration/net-single/main.cpp @@ -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 +#endif + #include "mbed.h" #include "utest/utest.h" #include "unity/unity.h" @@ -29,10 +33,6 @@ #include "download_test.h" #include -#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 diff --git a/TESTS/integration/net-threaded/main.cpp b/TESTS/integration/net-threaded/main.cpp index ddd12cb469..cc8c1a514a 100644 --- a/TESTS/integration/net-threaded/main.cpp +++ b/TESTS/integration/net-threaded/main.cpp @@ -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 +#endif + #include "mbed.h" #include "utest/utest.h" #include "unity/unity.h" @@ -29,10 +33,6 @@ #include "download_test.h" #include -#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 diff --git a/TESTS/integration/stress-net-fs/main.cpp b/TESTS/integration/stress-net-fs/main.cpp index 5ec201f43a..b38089d4f6 100644 --- a/TESTS/integration/stress-net-fs/main.cpp +++ b/TESTS/integration/stress-net-fs/main.cpp @@ -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 +#endif + #include "mbed.h" #include "FATFileSystem.h" #include "LittleFileSystem.h" @@ -32,9 +36,6 @@ #include "file_test.h" #include -#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 diff --git a/TESTS/lorawan/loraradio/main.cpp b/TESTS/lorawan/loraradio/main.cpp index f5daaa1308..1fa1283700 100644 --- a/TESTS/lorawan/loraradio/main.cpp +++ b/TESTS/lorawan/loraradio/main.cpp @@ -18,8 +18,6 @@ #include "unity.h" #include "greentea-client/test_env.h" -#include "Semaphore.h" - #include "mbed_trace.h" #define TRACE_GROUP "RTST" @@ -36,6 +34,8 @@ #error [NOT_SUPPORTED] Requires parameters from application config file. #endif +#include "Semaphore.h" + #if (MBED_CONF_APP_LORA_RADIO == SX1272) || (MBED_CONF_APP_LORA_RADIO == SX1276) using namespace utest::v1; diff --git a/features/frameworks/TARGET_PSA/pal/pal_mbed_os_intf.cpp b/features/frameworks/TARGET_PSA/pal/pal_mbed_os_intf.cpp index f125d1be5e..ab1803ddc1 100644 --- a/features/frameworks/TARGET_PSA/pal/pal_mbed_os_intf.cpp +++ b/features/frameworks/TARGET_PSA/pal/pal_mbed_os_intf.cpp @@ -135,9 +135,11 @@ int test_start(test_entry_f test_f, compliance_test_type type) { test_g = test_f; type_g = type; +#if defined(MBED_CONF_RTOS_PRESENT) MBED_ASSERT((type > COMPLIANCE_TEST_START) && (type < COMPLIANCE_TEST_END)); Thread thread(osPriorityNormal, TEST_STACK_SIZE, NULL); thread.start(main_wrapper); thread.join(); +#endif return 0; } diff --git a/features/frameworks/greentea-client/source/greentea_metrics.cpp b/features/frameworks/greentea-client/source/greentea_metrics.cpp index b204860cd3..e1de35c0ad 100644 --- a/features/frameworks/greentea-client/source/greentea_metrics.cpp +++ b/features/frameworks/greentea-client/source/greentea_metrics.cpp @@ -20,21 +20,7 @@ #include "platform/mbed_stats.h" #include -#if defined(MBED_CONF_RTOS_PRESENT) - -#define THREAD_BUF_COUNT 16 - -typedef struct { - uint32_t entry; - uint32_t stack_size; - uint32_t max_stack; -} thread_info_t; - -#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED - -#if !defined(MBED_CONF_RTOS_PRESENT) || !(MBED_CONF_RTOS_PRESENT) -#error "RTOS required for Stack stats" -#endif +#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) #include "rtos/Mutex.h" #include "rtos/Thread.h" @@ -46,6 +32,14 @@ typedef struct { using namespace mbed; using namespace rtos; +#define THREAD_BUF_COUNT 16 + +typedef struct { + uint32_t entry; + uint32_t stack_size; + uint32_t max_stack; +} thread_info_t; + // Mutex to protect "buf" static SingletonPtr mutex; static char buf[128]; @@ -59,7 +53,7 @@ static void send_CPU_info(void); #if defined(MBED_HEAP_STATS_ENABLED ) && MBED_HEAP_STATS_ENABLED static void send_heap_info(void); #endif -#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED +#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) static void send_stack_info(void); static void on_thread_terminate(osThreadId_t id); static void enqeue_thread_info(osThreadId_t id); @@ -72,7 +66,7 @@ static uint32_t print_dec(char *buf, uint32_t value); void greentea_metrics_setup() { -#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED +#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) Kernel::attach_thread_terminate_hook(on_thread_terminate); #endif } @@ -82,7 +76,7 @@ void greentea_metrics_report() #if defined(MBED_HEAP_STATS_ENABLED ) && MBED_HEAP_STATS_ENABLED send_heap_info(); #endif -#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED +#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) send_stack_info(); Kernel::attach_thread_terminate_hook(NULL); #endif @@ -114,7 +108,7 @@ static void send_heap_info() } #endif -#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED +#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) MBED_UNUSED static void send_stack_info() { mutex->lock(); @@ -236,4 +230,3 @@ static uint32_t print_dec(char *buf, uint32_t value) } #endif -#endif // #if defined(MBED_CONF_RTOS_PRESENT) diff --git a/features/frameworks/greentea-client/source/greentea_test_env.cpp b/features/frameworks/greentea-client/source/greentea_test_env.cpp index a26effc102..cb6a8a3267 100644 --- a/features/frameworks/greentea-client/source/greentea_test_env.cpp +++ b/features/frameworks/greentea-client/source/greentea_test_env.cpp @@ -67,9 +67,7 @@ static void greentea_write_string(const char *str); * This function is blocking. */ void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char *buffer, size_t size) { -#if defined(MBED_CONF_RTOS_PRESENT) greentea_metrics_setup(); -#endif // Key-value protocol handshake function. Waits for {{__sync;...}} message // Sync preamble: "{{__sync;0dad4a9d-59a3-4aec-810d-d5fb09d852c1}}" // Example value of sync_uuid == "0dad4a9d-59a3-4aec-810d-d5fb09d852c1" @@ -488,9 +486,7 @@ static void greentea_notify_completion(const int result) { __gcov_flush(); coverage_report = false; #endif -#if defined(MBED_CONF_RTOS_PRESENT) greentea_metrics_report(); -#endif greentea_send_kv(GREENTEA_TEST_ENV_END, val); greentea_send_kv(GREENTEA_TEST_ENV_EXIT, 0); }