diff --git a/TESTS/configs/baremetal.json b/TESTS/configs/baremetal.json new file mode 100644 index 00000000000..11a232ca369 --- /dev/null +++ b/TESTS/configs/baremetal.json @@ -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"] + } + } +} diff --git a/TESTS/events/queue/main.cpp b/TESTS/events/queue/main.cpp index 8f6b8e45dc0..3367622888c 100644 --- a/TESTS/events/queue/main.cpp +++ b/TESTS/events/queue/main.cpp @@ -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" diff --git a/TESTS/events/timing/main.cpp b/TESTS/events/timing/main.cpp index 146d5de7642..5bf873d061c 100644 --- a/TESTS/events/timing/main.cpp +++ b/TESTS/events/timing/main.cpp @@ -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" diff --git a/TESTS/integration/COMMON/download_test.cpp b/TESTS/integration/COMMON/download_test.cpp index 8a637219c06..dea90ede773 100644 --- a/TESTS/integration/COMMON/download_test.cpp +++ b/TESTS/integration/COMMON/download_test.cpp @@ -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" @@ -202,4 +204,4 @@ size_t download_test(NetworkInterface *interface, const unsigned char *data, siz return received_bytes; } - +#endif // INTEGRATION_TESTS diff --git a/TESTS/integration/COMMON/download_test.h b/TESTS/integration/COMMON/download_test.h index c38783ab939..d755b2c9e85 100644 --- a/TESTS/integration/COMMON/download_test.h +++ b/TESTS/integration/COMMON/download_test.h @@ -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); diff --git a/TESTS/integration/COMMON/file_test.cpp b/TESTS/integration/COMMON/file_test.cpp index 2251b32507f..77a2859fe12 100644 --- a/TESTS/integration/COMMON/file_test.cpp +++ b/TESTS/integration/COMMON/file_test.cpp @@ -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" @@ -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 diff --git a/TESTS/integration/COMMON/file_test.h b/TESTS/integration/COMMON/file_test.h index 05f0b9aa7e6..bde36948134 100644 --- a/TESTS/integration/COMMON/file_test.h +++ b/TESTS/integration/COMMON/file_test.h @@ -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); diff --git a/TESTS/integration/fs-single/main.cpp b/TESTS/integration/fs-single/main.cpp index 7a423b685ee..5fb2ca1840c 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 +#else + #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 @@ -162,3 +162,4 @@ int main() return !Harness::run(specification); } +#endif // !INTEGRATION_TESTS diff --git a/TESTS/integration/fs-threaded/main.cpp b/TESTS/integration/fs-threaded/main.cpp index 06a0b8a5b45..f1af5dbc065 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 +#else + #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 @@ -181,3 +181,4 @@ int main() return !Harness::run(specification); } +#endif // !INTEGRATION_TESTS diff --git a/TESTS/integration/net-single/main.cpp b/TESTS/integration/net-single/main.cpp index 7d91a3af29f..22031cb8142 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 +#else + #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 @@ -139,3 +139,4 @@ int main() return !Harness::run(specification); } +#endif // !INTEGRATION_TESTS diff --git a/TESTS/integration/net-threaded/main.cpp b/TESTS/integration/net-threaded/main.cpp index ddd12cb469e..7238d4129e6 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 +#else + #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 @@ -173,3 +173,4 @@ int main() return !Harness::run(specification); } +#endif // !INTEGRATION_TESTS diff --git a/TESTS/integration/stress-net-fs/main.cpp b/TESTS/integration/stress-net-fs/main.cpp index 5ec201f43a6..8024ebc97b7 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 +#else + #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 @@ -243,3 +244,4 @@ int main() return !Harness::run(specification); } +#endif // !INTEGRATION_TESTS diff --git a/TESTS/mbed_drivers/crc/main.cpp b/TESTS/mbed_drivers/crc/main.cpp index 129c1c9b2f0..8081a089cfa 100644 --- a/TESTS/mbed_drivers/crc/main.cpp +++ b/TESTS/mbed_drivers/crc/main.cpp @@ -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"; @@ -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) diff --git a/TESTS/mbed_drivers/lp_timeout/main.cpp b/TESTS/mbed_drivers/lp_timeout/main.cpp index 6eb8c142040..ab80d2e8b6d 100644 --- a/TESTS/mbed_drivers/lp_timeout/main.cpp +++ b/TESTS/mbed_drivers/lp_timeout/main.cpp @@ -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 @@ -95,3 +98,4 @@ int main() } #endif // !DEVICE_LPTICKER +#endif //!defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbed_drivers/lp_timer/main.cpp b/TESTS/mbed_drivers/lp_timer/main.cpp index 390c6e23376..5f40cd63bf6 100644 --- a/TESTS/mbed_drivers/lp_timer/main.cpp +++ b/TESTS/mbed_drivers/lp_timer/main.cpp @@ -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 diff --git a/TESTS/mbed_drivers/race_test/main.cpp b/TESTS/mbed_drivers/race_test/main.cpp index 8f896e25187..d5f54d87dca 100644 --- a/TESTS/mbed_drivers/race_test/main.cpp +++ b/TESTS/mbed_drivers/race_test/main.cpp @@ -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" @@ -22,10 +30,6 @@ #include "SingletonPtr.h" #include -#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 @@ -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) diff --git a/TESTS/mbed_drivers/rtc/main.cpp b/TESTS/mbed_drivers/rtc/main.cpp index 8cdb54581c5..00478a10b78 100644 --- a/TESTS/mbed_drivers/rtc/main.cpp +++ b/TESTS/mbed_drivers/rtc/main.cpp @@ -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 diff --git a/TESTS/mbed_drivers/timer/main.cpp b/TESTS/mbed_drivers/timer/main.cpp index 317ce916f20..dbd13b149bd 100644 --- a/TESTS/mbed_drivers/timer/main.cpp +++ b/TESTS/mbed_drivers/timer/main.cpp @@ -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 diff --git a/TESTS/mbed_drivers/watchdog/main.cpp b/TESTS/mbed_drivers/watchdog/main.cpp index db42107bf28..26fd84b0f12 100644 --- a/TESTS/mbed_drivers/watchdog/main.cpp +++ b/TESTS/mbed_drivers/watchdog/main.cpp @@ -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 @@ -284,3 +289,4 @@ int main() } #endif // !DEVICE_WATCHDOG +#endif // !defined(MBED_CONG_RTOS_PRESENT) diff --git a/TESTS/mbed_drivers/watchdog_reset/main.cpp b/TESTS/mbed_drivers/watchdog_reset/main.cpp index 0732d98fa43..1c9a7a3617e 100644 --- a/TESTS/mbed_drivers/watchdog_reset/main.cpp +++ b/TESTS/mbed_drivers/watchdog_reset/main.cpp @@ -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 @@ -334,3 +338,4 @@ int main() return !Harness::run(specification); } #endif // !DEVICE_WATCHDOG +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbed_hal/common_tickers/main.cpp b/TESTS/mbed_hal/common_tickers/main.cpp index df78f1469c2..cbe5dd20aa5 100644 --- a/TESTS/mbed_hal/common_tickers/main.cpp +++ b/TESTS/mbed_hal/common_tickers/main.cpp @@ -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" @@ -606,3 +611,4 @@ int main() return !Harness::run(specification); } #endif // !DEVICE_USTICKER +#endif // !defined(MBED_RTOS_CONF_PRESENT) diff --git a/TESTS/mbed_hal/common_tickers_freq/main.cpp b/TESTS/mbed_hal/common_tickers_freq/main.cpp index a91abf86d72..8a221623f48 100644 --- a/TESTS/mbed_hal/common_tickers_freq/main.cpp +++ b/TESTS/mbed_hal/common_tickers_freq/main.cpp @@ -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" @@ -206,3 +209,4 @@ int main() } #endif // defined(SKIP_TIME_DRIFT_TESTS) || !DEVICE_USTICKER +#endif // !defined(MBED_RTOS_CONF_PRESENT) diff --git a/TESTS/mbed_hal/lp_ticker/main.cpp b/TESTS/mbed_hal/lp_ticker/main.cpp index 8fc728e30c4..5438fe2343d 100644 --- a/TESTS/mbed_hal/lp_ticker/main.cpp +++ b/TESTS/mbed_hal/lp_ticker/main.cpp @@ -13,6 +13,11 @@ * 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 + #include "mbed.h" #include "greentea-client/test_env.h" #include "unity.h" @@ -207,3 +212,4 @@ int main() } #endif // !DEVICE_LPTICKER +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbed_hal/sleep/main.cpp b/TESTS/mbed_hal/sleep/main.cpp index 4767e594356..c8f2b34d6d1 100644 --- a/TESTS/mbed_hal/sleep/main.cpp +++ b/TESTS/mbed_hal/sleep/main.cpp @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #if !DEVICE_SLEEP #error [NOT_SUPPORTED] sleep not supported for this target #else @@ -216,7 +215,9 @@ utest::v1::status_t greentea_test_setup(const size_t number_of_cases) { GREENTEA_SETUP(60, "default_auto"); /* Suspend RTOS Kernel to enable sleep modes. */ +#if defined(MBED_CONF_RTOS_PRESENT) osKernelSuspend(); +#endif #if DEVICE_LPTICKER ticker_suspend(get_lp_ticker_data()); #if DEVICE_LPTICKER && (LPTICKER_DELAY_TICKS > 0) @@ -242,8 +243,9 @@ void greentea_test_teardown(const size_t passed, const size_t failed, const fail #endif ticker_resume(get_lp_ticker_data()); #endif +#if defined(MBED_CONF_RTOS_PRESENT) osKernelResume(0); - +#endif greentea_test_teardown_handler(passed, failed, failure); } diff --git a/TESTS/mbed_hal/sleep_manager/main.cpp b/TESTS/mbed_hal/sleep_manager/main.cpp index 97ecaff2909..1a0488fb0d7 100644 --- a/TESTS/mbed_hal/sleep_manager/main.cpp +++ b/TESTS/mbed_hal/sleep_manager/main.cpp @@ -88,7 +88,9 @@ void test_lock_eq_ushrt_max() utest::v1::status_t testcase_setup(const Case *const source, const size_t index_of_case) { // Suspend the RTOS kernel scheduler to prevent interference with duration of sleep. +#if defined(MBED_RTOS_PRESENT) osKernelSuspend(); +#endif #if DEVICE_LPTICKER ticker_suspend(get_lp_ticker_data()); #if (LPTICKER_DELAY_TICKS > 0) @@ -115,7 +117,9 @@ utest::v1::status_t testcase_teardown(const Case *const source, const size_t pas #endif ticker_resume(get_lp_ticker_data()); #endif +#if defined(MBED_RTOS_PRESENT) osKernelResume(0); +#endif return utest::v1::greentea_case_teardown_handler(source, passed, failed, failure); } diff --git a/TESTS/mbed_hal/sleep_manager_racecondition/main.cpp b/TESTS/mbed_hal/sleep_manager_racecondition/main.cpp index 6f5cd877cd7..2cce93cf571 100644 --- a/TESTS/mbed_hal/sleep_manager_racecondition/main.cpp +++ b/TESTS/mbed_hal/sleep_manager_racecondition/main.cpp @@ -26,7 +26,7 @@ using namespace utest::v1; #define TEST_STACK_SIZE 256 - +#if defined(MBED_CONF_RTOS_PRESENT) void sleep_manager_locking_thread_test() { for (uint32_t i = 0; i < 100; i++) { @@ -55,6 +55,7 @@ void sleep_manager_multithread_test() bool deep_sleep_allowed = sleep_manager_can_deep_sleep_test_check(); TEST_ASSERT_TRUE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed"); } +#endif void sleep_manager_locking_irq_test() { @@ -91,7 +92,9 @@ utest::v1::status_t greentea_test_setup(const size_t number_of_cases) } Case cases[] = { +#if defined(MBED_CONF_RTOS_PRESENT) Case("deep sleep lock/unlock is thread safe", sleep_manager_multithread_test), +#endif Case("deep sleep lock/unlock is IRQ safe", sleep_manager_irq_test), }; diff --git a/TESTS/mbed_hal/stack_size_unification/main.cpp b/TESTS/mbed_hal/stack_size_unification/main.cpp index 377cd1eb750..3707727a4a2 100644 --- a/TESTS/mbed_hal/stack_size_unification/main.cpp +++ b/TESTS/mbed_hal/stack_size_unification/main.cpp @@ -15,6 +15,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] stack size unification test cases require a RTOS to run. +#else + #include "mbed.h" #include "greentea-client/test_env.h" #include "unity.h" @@ -76,3 +80,4 @@ int main() } #endif // TARGET_RENESAS +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbed_hal/watchdog/main.cpp b/TESTS/mbed_hal/watchdog/main.cpp index 7df1efb55e7..71aaa2da3a2 100644 --- a/TESTS/mbed_hal/watchdog/main.cpp +++ b/TESTS/mbed_hal/watchdog/main.cpp @@ -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 test cases require a RTOS to run. +#else + #if !DEVICE_WATCHDOG #error [NOT_SUPPORTED] Watchdog not supported for this target #else @@ -285,3 +289,4 @@ int main() } #endif // !DEVICE_WATCHDOG +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbed_platform/crash_reporting/main.cpp b/TESTS/mbed_platform/crash_reporting/main.cpp index 3f3260b5f2e..5253276d4fd 100644 --- a/TESTS/mbed_platform/crash_reporting/main.cpp +++ b/TESTS/mbed_platform/crash_reporting/main.cpp @@ -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] crash_reporting test cases require a RTOS to run. +#else #include "mbed.h" #include "mbed_error.h" #include "mbed_crash_data_offsets.h" @@ -80,3 +83,4 @@ int main(void) } #endif // !MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbed_platform/error_handling/main.cpp b/TESTS/mbed_platform/error_handling/main.cpp index f961edbf766..aecbad8e023 100644 --- a/TESTS/mbed_platform/error_handling/main.cpp +++ b/TESTS/mbed_platform/error_handling/main.cpp @@ -125,6 +125,7 @@ void test_error_context_capture() mbed_error_status_t status = mbed_get_last_error_info(&error_ctx); TEST_ASSERT(status == MBED_SUCCESS); TEST_ASSERT_EQUAL_UINT(error_value, error_ctx.error_value); +#if defined(MBED_CONF_RTOS_PRESENT) TEST_ASSERT_EQUAL_UINT((uint32_t)osThreadGetId(), error_ctx.thread_id); //Capture thread info and compare @@ -135,6 +136,7 @@ void test_error_context_capture() #if MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED TEST_ASSERT_EQUAL_STRING(MBED_FILENAME, error_ctx.error_filename); #endif +#endif } #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED @@ -246,14 +248,17 @@ void test_error_logging_multithread() } #endif +#if defined(MBED_CONF_RTOS_PRESENT) static Semaphore callback_sem; void MyErrorHook(const mbed_error_ctx *error_ctx) { callback_sem.release(); } +#endif /** Test error hook */ +#if defined(MBED_CONF_RTOS_PRESENT) void test_error_hook() { if (MBED_SUCCESS != mbed_set_error_hook(MyErrorHook)) { @@ -265,6 +270,7 @@ void test_error_hook() TEST_ASSERT(acquired); } +#endif #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED && defined(MBED_TEST_SIM_BLOCKDEVICE) @@ -352,13 +358,11 @@ utest::v1::status_t test_setup(const size_t number_of_cases) Case cases[] = { Case("Test error counting and reset", test_error_count_and_reset), Case("Test error encoding, value capture, first and last errors", test_error_capturing), -#if MBED_CONF_RTOS_PRESENT Case("Test error context capture", test_error_context_capture), -#endif //MBED_CONF_RTOS_PRESENT - Case("Test error hook", test_error_hook), #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED Case("Test error logging", test_error_logging), #if MBED_CONF_RTOS_PRESENT + Case("Test error hook", test_error_hook), Case("Test error handling multi-threaded", test_error_logging_multithread), #endif //MBED_CONF_RTOS_PRESENT #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED && defined(MBED_TEST_SIM_BLOCKDEVICE) diff --git a/TESTS/mbedmicro-rtos-mbed/MemoryPool/main.cpp b/TESTS/mbedmicro-rtos-mbed/MemoryPool/main.cpp index 60a5613992f..708373f78ba 100644 --- a/TESTS/mbedmicro-rtos-mbed/MemoryPool/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/MemoryPool/main.cpp @@ -18,6 +18,10 @@ #include "unity.h" #include "utest.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] MemoryPool test cases require a RTOS to run. +#else + using namespace utest::v1; #define THREAD_STACK_SIZE 512 @@ -666,3 +670,4 @@ int main() Harness::run(specification); } +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/basic/main.cpp b/TESTS/mbedmicro-rtos-mbed/basic/main.cpp index 13c131feff4..f5b38da65a1 100644 --- a/TESTS/mbedmicro-rtos-mbed/basic/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/basic/main.cpp @@ -14,13 +14,17 @@ * 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] RTOS basic test cases require RTOS with multithread to run +#else + #include "mbed.h" #include "greentea-client/test_env.h" #include "utest/utest.h" #include "unity/unity.h" -#if defined(SKIP_TIME_DRIFT_TESTS) || defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported +#if defined(SKIP_TIME_DRIFT_TESTS) || !DEVICE_USTICKER +#error [NOT_SUPPORTED] UsTicker need to be enabled for this test. #else using utest::v1::Case; @@ -116,4 +120,5 @@ int main() utest::v1::Harness::run(specification); } -#endif // defined(SKIP_TIME_DRIFT_TESTS) || defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // defined(SKIP_TIME_DRIFT_TESTS) || !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/condition_variable/main.cpp b/TESTS/mbedmicro-rtos-mbed/condition_variable/main.cpp index 0f96013d2db..800267af3c7 100644 --- a/TESTS/mbedmicro-rtos-mbed/condition_variable/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/condition_variable/main.cpp @@ -13,16 +13,20 @@ * 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] Condition variable 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 "greentea-client/test_env.h" #include "unity.h" #include "utest.h" #include "rtos.h" -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported -#else - using namespace utest::v1; #define TEST_STACK_SIZE 512 @@ -185,4 +189,5 @@ int main() return !Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/event_flags/main.cpp b/TESTS/mbedmicro-rtos-mbed/event_flags/main.cpp index 2ee4d760e36..14052bea860 100644 --- a/TESTS/mbedmicro-rtos-mbed/event_flags/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/event_flags/main.cpp @@ -14,6 +14,9 @@ * 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] Event flags test cases require RTOS with multithread to run +#else #include "mbed.h" #include "greentea-client/test_env.h" @@ -22,8 +25,8 @@ using utest::v1::Case; -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported +#if !DEVICE_USTICKER +#error [NOT_SUPPORTED] UsTicker need to be enabled for this test. #else #if defined(__CORTEX_M23) || defined(__CORTEX_M33) @@ -371,4 +374,5 @@ int main() return !utest::v1::Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) \ No newline at end of file diff --git a/TESTS/mbedmicro-rtos-mbed/heap_and_stack/main.cpp b/TESTS/mbedmicro-rtos-mbed/heap_and_stack/main.cpp index 9fd9829fdf9..91c1129cdbf 100644 --- a/TESTS/mbedmicro-rtos-mbed/heap_and_stack/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/heap_and_stack/main.cpp @@ -15,8 +15,8 @@ * limitations under the License. */ -#if defined(TARGET_CORTEX_A) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] This function not supported for this target +#if defined(TARGET_CORTEX_A) || !DEVICE_USTICKER || !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] test not supported. #else #include @@ -263,4 +263,4 @@ int main() return !utest::v1::Harness::run(specification); } -#endif // defined(TARGET_CORTEX_A) || !DEVICE_USTICKER +#endif // defined(TARGET_CORTEX_A) || !DEVICE_USTICKER || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp b/TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp index ceeca2a50fc..cd018d1b888 100644 --- a/TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] kernel tick count test cases require a RTOS to run. +#else + #include "greentea-client/test_env.h" #include "utest/utest.h" #include "unity/unity.h" @@ -117,3 +121,4 @@ int main() { return !utest::v1::Harness::run(specification); } +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/mail/main.cpp b/TESTS/mbedmicro-rtos-mbed/mail/main.cpp index cfcec0fa780..b772a2641be 100644 --- a/TESTS/mbedmicro-rtos-mbed/mail/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/mail/main.cpp @@ -13,16 +13,20 @@ * 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] mail 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 "greentea-client/test_env.h" #include "unity.h" #include "utest.h" #include "rtos.h" -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported -#else - using namespace utest::v1; #if defined(__CORTEX_M23) || defined(__CORTEX_M33) @@ -509,4 +513,5 @@ int main() return !Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp b/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp index b2c650f6781..ea5aa12e20b 100644 --- a/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/malloc/main.cpp @@ -19,7 +19,7 @@ #include "unity/unity.h" -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#if !DEVICE_USTICKER #error [NOT_SUPPORTED] test not supported #else @@ -59,13 +59,13 @@ void task_using_malloc(void) free(data); } } - /** Test for multithreaded heap allocations Given multiple threads are started in parallel When each of the threads allocate memory Then the memory allocation succeed and @a malloc return valid memory */ +#if defined(MBED_CONF_RTOS_PRESENT) void test_multithread_allocation(void) { // static stack for threads to reduce heap usage on devices with small RAM @@ -102,6 +102,7 @@ void test_multithread_allocation(void) } TEST_ASSERT_FALSE(thread_alloc_failure); } +#endif /** Test for multiple heap alloc and free calls */ #define ALLOC_ARRAY_SIZE 100 @@ -200,7 +201,9 @@ void test_null_free(void) Case cases[] = { Case("Test 0 size allocation", test_zero_allocation), Case("Test NULL pointer free", test_null_free), +#if defined(MBED_CONF_RTOS_PRESENT) Case("Test multithreaded allocations", test_multithread_allocation), +#endif Case("Test large allocation", test_big_allocation), Case("Test multiple alloc and free calls", test_alloc_and_free) }; diff --git a/TESTS/mbedmicro-rtos-mbed/mutex/main.cpp b/TESTS/mbedmicro-rtos-mbed/mutex/main.cpp index 6a6e4c2bf02..e48f99304a6 100644 --- a/TESTS/mbedmicro-rtos-mbed/mutex/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/mutex/main.cpp @@ -13,16 +13,20 @@ * 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] Mutex 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 "greentea-client/test_env.h" #include "unity.h" #include "utest.h" #include "rtos.h" -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported -#else - using namespace utest::v1; #if defined(__CORTEX_M23) || defined(__CORTEX_M33) @@ -305,4 +309,5 @@ int main() return !Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/queue/main.cpp b/TESTS/mbedmicro-rtos-mbed/queue/main.cpp index 1293f9c3c17..74aeeec6b8b 100644 --- a/TESTS/mbedmicro-rtos-mbed/queue/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/queue/main.cpp @@ -13,16 +13,20 @@ * 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] Queue 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 "greentea-client/test_env.h" #include "unity.h" #include "utest.h" #include "rtos.h" -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported -#else - using namespace utest::v1; #define THREAD_STACK_SIZE 512 @@ -345,4 +349,5 @@ int main() return !Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) \ No newline at end of file diff --git a/TESTS/mbedmicro-rtos-mbed/rtostimer/main.cpp b/TESTS/mbedmicro-rtos-mbed/rtostimer/main.cpp index 024eb475184..d1c0d35b5fb 100644 --- a/TESTS/mbedmicro-rtos-mbed/rtostimer/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/rtostimer/main.cpp @@ -13,6 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] RTOS timer test cases require RTOS to run +#else + #include "mbed.h" #include "greentea-client/test_env.h" #include "unity.h" @@ -360,3 +365,4 @@ int main() #endif // !DEVICE_USTICKER #endif // RESTART_DELAY_MS >= DELAY_MS +#endif diff --git a/TESTS/mbedmicro-rtos-mbed/semaphore/main.cpp b/TESTS/mbedmicro-rtos-mbed/semaphore/main.cpp index 49a806c6e04..8d5646ef220 100644 --- a/TESTS/mbedmicro-rtos-mbed/semaphore/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/semaphore/main.cpp @@ -13,6 +13,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] Semaphore 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 "greentea-client/test_env.h" #include "unity.h" @@ -21,10 +29,6 @@ using namespace utest::v1; -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported -#else - #define THREAD_DELAY 30 #define SEMAPHORE_SLOTS 2 #define SEM_CHANGES 100 @@ -246,4 +250,5 @@ int main() return !Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/signals/main.cpp b/TESTS/mbedmicro-rtos-mbed/signals/main.cpp index 6fd39b23d68..1fae2dacf75 100644 --- a/TESTS/mbedmicro-rtos-mbed/signals/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/signals/main.cpp @@ -13,6 +13,10 @@ * 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] Signals test cases require RTOS with multithread to run +#else + #include "mbed.h" #include "greentea-client/test_env.h" #include "utest/utest.h" @@ -20,8 +24,8 @@ using utest::v1::Case; -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported +#if !DEVICE_USTICKER +#error [NOT_SUPPORTED] UsTicker need to be enabled for this test. #else #define TEST_STACK_SIZE 512 @@ -393,4 +397,5 @@ int main() return !utest::v1::Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/mbedmicro-rtos-mbed/systimer/main.cpp b/TESTS/mbedmicro-rtos-mbed/systimer/main.cpp index 13b60ac99d8..9cd168b0a43 100644 --- a/TESTS/mbedmicro-rtos-mbed/systimer/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/systimer/main.cpp @@ -20,9 +20,6 @@ #include "utest.h" #include "ticker_api.h" -extern "C" { -#include "rtx_lib.h" -} #include "platform/source/SysTimer.h" #define TEST_TICKS 42 diff --git a/TESTS/mbedmicro-rtos-mbed/threads/LockGuard.h b/TESTS/mbedmicro-rtos-mbed/threads/LockGuard.h index fd5fd657197..919d2e105a2 100644 --- a/TESTS/mbedmicro-rtos-mbed/threads/LockGuard.h +++ b/TESTS/mbedmicro-rtos-mbed/threads/LockGuard.h @@ -49,5 +49,4 @@ class LockGuard { LockGuard &operator=(const LockGuard &); rtos::Mutex &_mutex; }; - #endif /* MBEDMICRO_RTOS_MBED_THREADS_LOCK_GUARD */ diff --git a/TESTS/mbedmicro-rtos-mbed/threads/SynchronizedIntegral.h b/TESTS/mbedmicro-rtos-mbed/threads/SynchronizedIntegral.h index afb3ce0ef42..988b4d44f6a 100644 --- a/TESTS/mbedmicro-rtos-mbed/threads/SynchronizedIntegral.h +++ b/TESTS/mbedmicro-rtos-mbed/threads/SynchronizedIntegral.h @@ -75,5 +75,4 @@ class SynchronizedIntegral { mutable rtos::Mutex _mutex; T _value; }; - #endif /* MBEDMICRO_RTOS_MBED_THREADS_SYNCHRONIZED_INTEGRAL */ diff --git a/TESTS/mbedmicro-rtos-mbed/threads/main.cpp b/TESTS/mbedmicro-rtos-mbed/threads/main.cpp index c66e9fb0308..30f0855a325 100644 --- a/TESTS/mbedmicro-rtos-mbed/threads/main.cpp +++ b/TESTS/mbedmicro-rtos-mbed/threads/main.cpp @@ -13,6 +13,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] Threads 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 "greentea-client/test_env.h" #include "unity.h" @@ -21,10 +29,6 @@ #include "SynchronizedIntegral.h" #include "LockGuard.h" -#if defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER -#error [NOT_SUPPORTED] test not supported -#else - #define THREAD_STACK_SIZE 512 #if defined(__CORTEX_A9) || defined(__CORTEX_M23) || defined(__CORTEX_M33) || defined(TARGET_ARM_FM) || defined(TARGET_CY8CKIT_062_WIFI_BT_PSA) #define PARALLEL_THREAD_STACK_SIZE 512 @@ -847,4 +851,5 @@ int main() return !Harness::run(specification); } -#endif // defined(MBED_RTOS_SINGLE_THREAD) || !DEVICE_USTICKER +#endif // !DEVICE_USTICKER +#endif // defined(MBED_RTOS_SINGLE_THREAD) || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/usb_device/basic/USBEndpointTester.cpp b/TESTS/usb_device/basic/USBEndpointTester.cpp index 0b95dff2121..805039dc550 100644 --- a/TESTS/usb_device/basic/USBEndpointTester.cpp +++ b/TESTS/usb_device/basic/USBEndpointTester.cpp @@ -15,6 +15,8 @@ * limitations under the License. */ +#if defined(MBED_CONF_RTOS_PRESENT) + #include "stdint.h" #include "stdlib.h" #include "USBEndpointTester.h" @@ -169,7 +171,6 @@ USBEndpointTester::USBEndpointTester(USBPhy *phy, uint16_t vendor_id, uint16_t p MBED_ASSERT(_endpoint_buffs[i] != NULL); } MBED_ASSERT(resolver.valid()); - queue = mbed::mbed_highprio_event_queue(); configuration_desc(0); ctrl_buf = new uint8_t[CTRL_BUF_SIZE]; @@ -861,3 +862,4 @@ void USBEndpointTester::start_ep_in_abort_test() write_start(_endpoints[EP_BULK_IN], _endpoint_buffs[EP_BULK_IN], (*_endpoint_configs)[EP_BULK_IN].max_packet); write_start(_endpoints[EP_INT_IN], _endpoint_buffs[EP_INT_IN], (*_endpoint_configs)[EP_INT_IN].max_packet); } +#endif diff --git a/TESTS/usb_device/basic/USBTester.cpp b/TESTS/usb_device/basic/USBTester.cpp index 6907a859c1f..584d52b1f07 100644 --- a/TESTS/usb_device/basic/USBTester.cpp +++ b/TESTS/usb_device/basic/USBTester.cpp @@ -15,6 +15,8 @@ * limitations under the License. */ +#if defined(MBED_CONF_RTOS_PRESENT) + #include "stdint.h" #include "USBTester.h" #include "mbed_shared_queues.h" @@ -57,7 +59,6 @@ USBTester::USBTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint1 int_out = resolver.endpoint_out(USB_EP_TYPE_INT, 64); MBED_ASSERT(resolver.valid()); queue = mbed::mbed_highprio_event_queue(); - configuration_desc(0); ctrl_buf = new uint8_t[CTRL_BUF_SIZE]; init(); @@ -703,3 +704,4 @@ void USBTester::epbulk_out_callback() read_finish(bulk_out); read_start(bulk_out, bulk_buf, sizeof(bulk_buf)); } +#endif diff --git a/TESTS/usb_device/basic/main.cpp b/TESTS/usb_device/basic/main.cpp index 09e4e1f7196..50f4e38ab9d 100644 --- a/TESTS/usb_device/basic/main.cpp +++ b/TESTS/usb_device/basic/main.cpp @@ -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] USB stack and test cases require RTOS to run. +#else + #include #include #include "mbed.h" @@ -660,3 +665,4 @@ int main() } #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/usb_device/hid/main.cpp b/TESTS/usb_device/hid/main.cpp index a9c5db76b73..9e8d349dcca 100644 --- a/TESTS/usb_device/hid/main.cpp +++ b/TESTS/usb_device/hid/main.cpp @@ -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] USB stack and test cases require RTOS to run. +#else + #if !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE #error [NOT_SUPPORTED] USB Device not supported for this target #else @@ -385,3 +389,4 @@ int main() } #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/usb_device/msd/main.cpp b/TESTS/usb_device/msd/main.cpp index 3942573ef34..5624fcd298d 100644 --- a/TESTS/usb_device/msd/main.cpp +++ b/TESTS/usb_device/msd/main.cpp @@ -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] USB stack and test cases require RTOS to run. +#else + #include #include #include /* srand, rand */ @@ -482,3 +487,4 @@ int main() } #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/usb_device/serial/main.cpp b/TESTS/usb_device/serial/main.cpp index 11dc3acd8c8..0068d26d3ae 100644 --- a/TESTS/usb_device/serial/main.cpp +++ b/TESTS/usb_device/serial/main.cpp @@ -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] USB stack and test cases require RTOS to run. +#else + #if !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE #error [NOT_SUPPORTED] USB Device not supported for this target #else @@ -848,3 +852,4 @@ int main() } #endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/features/frameworks/greentea-client/source/greentea_metrics.cpp b/features/frameworks/greentea-client/source/greentea_metrics.cpp index 6b2be0da508..e1de35c0ad1 100644 --- a/features/frameworks/greentea-client/source/greentea_metrics.cpp +++ b/features/frameworks/greentea-client/source/greentea_metrics.cpp @@ -20,19 +20,7 @@ #include "platform/mbed_stats.h" #include -#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" @@ -44,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]; @@ -57,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); @@ -70,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 } @@ -80,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 @@ -112,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(); diff --git a/features/frameworks/greentea-client/source/greentea_test_env.cpp b/features/frameworks/greentea-client/source/greentea_test_env.cpp index 42fadc2f6ca..cb6a8a32679 100644 --- a/features/frameworks/greentea-client/source/greentea_test_env.cpp +++ b/features/frameworks/greentea-client/source/greentea_test_env.cpp @@ -787,4 +787,4 @@ static int HandleKV(char *out_key, return 0; } -#endif \ No newline at end of file +#endif