diff --git a/TESTS/mbedtls/selftest/main.cpp b/TESTS/mbedtls/selftest/main.cpp index 8a9cb8870e..0398dd0cb0 100644 --- a/TESTS/mbedtls/selftest/main.cpp +++ b/TESTS/mbedtls/selftest/main.cpp @@ -18,7 +18,9 @@ #include "greentea-client/test_env.h" #include "unity.h" #include "utest.h" +#if defined(MBED_CONF_RTOS_PRESENT) #include "rtos.h" +#endif using namespace utest::v1; diff --git a/TESTS/psa/attestation/main.cpp b/TESTS/psa/attestation/main.cpp index 3789be02b2..ec13fcaf66 100755 --- a/TESTS/psa/attestation/main.cpp +++ b/TESTS/psa/attestation/main.cpp @@ -16,6 +16,10 @@ * limitations under the License. */ +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA attestation test case requires RTOS to run. +#else + #include "psa/crypto.h" #if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) @@ -157,3 +161,4 @@ int main() } #endif // ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C))) +#endif // !defined(MBED_CONF_RTOS_PRESENT) diff --git a/TESTS/psa/its_ps/main.cpp b/TESTS/psa/its_ps/main.cpp index 273c207d3f..ef35212ddf 100644 --- a/TESTS/psa/its_ps/main.cpp +++ b/TESTS/psa/its_ps/main.cpp @@ -16,8 +16,8 @@ * limitations under the License. */ -#ifndef TARGET_PSA -#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets. +#if !defined(TARGET_PSA) || !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets and RTOS. #else #include "greentea-client/test_env.h" @@ -238,4 +238,4 @@ int main() return !Harness::run(specification); } -#endif // TARGET_PSA +#endif // TARGET_PSA || !defined(MBED_CONF_RTOS_PRESENT) diff --git a/components/TARGET_PSA/TESTS/compliance_attestation/test_a001/main.c b/components/TARGET_PSA/TESTS/compliance_attestation/test_a001/main.c index 0c417d3d52..c424d37aac 100644 --- a/components/TARGET_PSA/TESTS/compliance_attestation/test_a001/main.c +++ b/components/TARGET_PSA/TESTS/compliance_attestation/test_a001/main.c @@ -1,9 +1,13 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance attestation test cases requires RTOS to run. +#else void test_entry_a001(val_api_t *val_api, psa_api_t *psa_api); int main(void) { test_start(test_entry_a001, COMPLIANCE_TEST_ATTESTATION); } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s001/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s001/main.c index 8045d73f5e..4c9ddd7758 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s001/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s001/main.c @@ -1,6 +1,10 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else + #ifdef ITS_TEST void test_entry_s001(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST @@ -15,3 +19,4 @@ int main(void) test_start(test_entry_p001, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s002/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s002/main.c index 10c724f850..859e6508b1 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s002/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s002/main.c @@ -1,6 +1,9 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" #include "lifecycle.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else #ifdef ITS_TEST void test_entry_s002(val_api_t *val_api, psa_api_t *psa_api); @@ -16,3 +19,4 @@ int main(void) test_start(test_entry_p002, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s004/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s004/main.c index 952dbdf905..14c6000c4f 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s004/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s004/main.c @@ -1,5 +1,8 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else #ifdef ITS_TEST void test_entry_s004(val_api_t *val_api, psa_api_t *psa_api); @@ -15,3 +18,4 @@ int main(void) test_start(test_entry_p004, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s005/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s005/main.c index c587e5371a..036511facf 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s005/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s005/main.c @@ -1,6 +1,10 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else + #ifdef ITS_TEST void test_entry_s005(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST @@ -15,3 +19,4 @@ int main(void) test_start(test_entry_p005, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s006/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s006/main.c index c438256557..be2f0a7033 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s006/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s006/main.c @@ -1,6 +1,10 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else + #ifdef ITS_TEST void test_entry_s006(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST @@ -15,3 +19,4 @@ int main(void) test_start(test_entry_p006, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s007/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s007/main.c index b79fbc893b..33b88ce915 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s007/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s007/main.c @@ -1,6 +1,10 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else + #ifdef ITS_TEST void test_entry_s007(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST @@ -15,3 +19,4 @@ int main(void) test_start(test_entry_p007, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s008/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s008/main.c index 8faecab01e..d1a254138e 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s008/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s008/main.c @@ -1,6 +1,10 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else + #ifdef ITS_TEST void test_entry_s008(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST @@ -15,3 +19,4 @@ int main(void) test_start(test_entry_p008, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s009/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s009/main.c index adf65a3d8a..595ebb1e6e 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s009/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s009/main.c @@ -1,6 +1,10 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else + #ifdef ITS_TEST void test_entry_s009(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST @@ -15,3 +19,4 @@ int main(void) test_start(test_entry_p009, COMPLIANCE_TEST_STORAGE); #endif } +#endif diff --git a/components/TARGET_PSA/TESTS/compliance_its/test_s010/main.c b/components/TARGET_PSA/TESTS/compliance_its/test_s010/main.c index dd110a6a4d..6c99bd5f7d 100644 --- a/components/TARGET_PSA/TESTS/compliance_its/test_s010/main.c +++ b/components/TARGET_PSA/TESTS/compliance_its/test_s010/main.c @@ -1,6 +1,10 @@ #include "val_interfaces.h" #include "pal_mbed_os_intf.h" +#if !defined(MBED_CONF_RTOS_PRESENT) +#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run +#else + #ifdef ITS_TEST void test_entry_s010(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST @@ -15,3 +19,4 @@ int main(void) test_start(test_entry_p010, COMPLIANCE_TEST_STORAGE); #endif } +#endif 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; }