Skip to content

Commit f30dd1c

Browse files
committed
Enable the Bare Metal green tea test
-PSA test framework uses the RTOS threads to run test cases so added MBED_CONF_RTOS_PRESENT to all the test cases.
1 parent e4164be commit f30dd1c

File tree

14 files changed

+59
-3
lines changed

14 files changed

+59
-3
lines changed

TESTS/mbedtls/selftest/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include "greentea-client/test_env.h"
1919
#include "unity.h"
2020
#include "utest.h"
21+
#if defined(MBED_CONF_RTOS_PRESENT)
2122
#include "rtos.h"
23+
#endif
2224

2325
using namespace utest::v1;
2426

TESTS/psa/attestation/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
* limitations under the License.
1717
*/
1818

19+
#if !defined(MBED_CONF_RTOS_PRESENT)
20+
#error [NOT_SUPPORTED] PSA attestation test case requires RTOS to run.
21+
#else
22+
1923
#include "psa/crypto.h"
2024

2125
#if ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
@@ -157,3 +161,4 @@ int main()
157161
}
158162

159163
#endif // ((!defined(TARGET_PSA)) || (!defined(MBEDTLS_PSA_CRYPTO_C)))
164+
#endif // !defined(MBED_CONF_RTOS_PRESENT)

TESTS/psa/its_ps/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#ifndef TARGET_PSA
20-
#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets.
19+
#if !defined(TARGET_PSA) || !defined(MBED_CONF_RTOS_PRESENT)
20+
#error [NOT_SUPPORTED] ITS/PS tests can run only on PSA-enabled targets and RTOS.
2121
#else
2222

2323
#include "greentea-client/test_env.h"
@@ -238,4 +238,4 @@ int main()
238238
return !Harness::run(specification);
239239
}
240240

241-
#endif // TARGET_PSA
241+
#endif // TARGET_PSA || !defined(MBED_CONF_RTOS_PRESENT)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#include "val_interfaces.h"
22
#include "pal_mbed_os_intf.h"
33

4+
#if !defined(MBED_CONF_RTOS_PRESENT)
5+
#error [NOT_SUPPORTED] PSA compliance attestation test cases requires RTOS to run.
6+
#else
47
void test_entry_a001(val_api_t *val_api, psa_api_t *psa_api);
58

69
int main(void)
710
{
811
test_start(test_entry_a001, COMPLIANCE_TEST_ATTESTATION);
912
}
13+
#endif

components/TARGET_PSA/TESTS/compliance_its/test_s001/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "val_interfaces.h"
22
#include "pal_mbed_os_intf.h"
33

4+
#if !defined(MBED_CONF_RTOS_PRESENT)
5+
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
6+
#else
7+
48
#ifdef ITS_TEST
59
void test_entry_s001(val_api_t *val_api, psa_api_t *psa_api);
610
#elif PS_TEST
@@ -15,3 +19,4 @@ int main(void)
1519
test_start(test_entry_p001, COMPLIANCE_TEST_STORAGE);
1620
#endif
1721
}
22+
#endif

components/TARGET_PSA/TESTS/compliance_its/test_s002/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include "val_interfaces.h"
22
#include "pal_mbed_os_intf.h"
33
#include "lifecycle.h"
4+
#if !defined(MBED_CONF_RTOS_PRESENT)
5+
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
6+
#else
47

58
#ifdef ITS_TEST
69
void test_entry_s002(val_api_t *val_api, psa_api_t *psa_api);
@@ -16,3 +19,4 @@ int main(void)
1619
test_start(test_entry_p002, COMPLIANCE_TEST_STORAGE);
1720
#endif
1821
}
22+
#endif

components/TARGET_PSA/TESTS/compliance_its/test_s004/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include "val_interfaces.h"
22
#include "pal_mbed_os_intf.h"
3+
#if !defined(MBED_CONF_RTOS_PRESENT)
4+
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
5+
#else
36

47
#ifdef ITS_TEST
58
void test_entry_s004(val_api_t *val_api, psa_api_t *psa_api);
@@ -15,3 +18,4 @@ int main(void)
1518
test_start(test_entry_p004, COMPLIANCE_TEST_STORAGE);
1619
#endif
1720
}
21+
#endif

components/TARGET_PSA/TESTS/compliance_its/test_s005/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "val_interfaces.h"
22
#include "pal_mbed_os_intf.h"
33

4+
#if !defined(MBED_CONF_RTOS_PRESENT)
5+
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
6+
#else
7+
48
#ifdef ITS_TEST
59
void test_entry_s005(val_api_t *val_api, psa_api_t *psa_api);
610
#elif PS_TEST
@@ -15,3 +19,4 @@ int main(void)
1519
test_start(test_entry_p005, COMPLIANCE_TEST_STORAGE);
1620
#endif
1721
}
22+
#endif

components/TARGET_PSA/TESTS/compliance_its/test_s006/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "val_interfaces.h"
22
#include "pal_mbed_os_intf.h"
33

4+
#if !defined(MBED_CONF_RTOS_PRESENT)
5+
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
6+
#else
7+
48
#ifdef ITS_TEST
59
void test_entry_s006(val_api_t *val_api, psa_api_t *psa_api);
610
#elif PS_TEST
@@ -15,3 +19,4 @@ int main(void)
1519
test_start(test_entry_p006, COMPLIANCE_TEST_STORAGE);
1620
#endif
1721
}
22+
#endif

components/TARGET_PSA/TESTS/compliance_its/test_s007/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "val_interfaces.h"
22
#include "pal_mbed_os_intf.h"
33

4+
#if !defined(MBED_CONF_RTOS_PRESENT)
5+
#error [NOT_SUPPORTED] PSA compliance its test cases requires RTOS to run
6+
#else
7+
48
#ifdef ITS_TEST
59
void test_entry_s007(val_api_t *val_api, psa_api_t *psa_api);
610
#elif PS_TEST
@@ -15,3 +19,4 @@ int main(void)
1519
test_start(test_entry_p007, COMPLIANCE_TEST_STORAGE);
1620
#endif
1721
}
22+
#endif

0 commit comments

Comments
 (0)