Skip to content

Commit e00bad2

Browse files
committed
Fixed the greentea test dependency and incorporated the review comments
-Added the mbedtls,crypto,psa,filesystem,fat,littlefs in baremetal.json to resolve compiler issue -Disable metrics that are not available for bare metal -Moved the baremetal.json inside TESTS/configs directory
1 parent 1f98bbe commit e00bad2

File tree

13 files changed

+61
-53
lines changed

13 files changed

+61
-53
lines changed

TESTS/baremetal.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

TESTS/configs/baremetal.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"requires": [
3+
"bare-metal",
4+
"greentea-client",
5+
"utest",
6+
"unity",
7+
"psa",
8+
"mbed-crypto",
9+
"mbedtls",
10+
"psa-compliance-framework",
11+
"filesystem",
12+
"littlefs",
13+
"mbed-trace",
14+
"device-key",
15+
"lora"
16+
]
17+
}

TESTS/integration/COMMON/download_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
2323

24+
#if !INTEGRATION_TESTS
25+
#error [NOT_SUPPORTED] integration tests not enabled for this target
26+
#endif
27+
2428
#include "mbed.h"
2529
#include "unity/unity.h"
2630
#include "greentea-client/test_env.h"

TESTS/integration/COMMON/file_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
/*
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
23+
#if !INTEGRATION_TESTS
24+
#error [NOT_SUPPORTED] integration tests not enabled for this target
25+
#endif
2326

2427
#include "mbed.h"
2528
#include "unity/unity.h"

TESTS/integration/fs-single/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
2323

24+
#if !INTEGRATION_TESTS
25+
#error [NOT_SUPPORTED] integration tests not enabled for this target
26+
#endif
27+
2428
#include "mbed.h"
2529
#include "FATFileSystem.h"
2630
#include "LittleFileSystem.h"
@@ -30,10 +34,6 @@
3034
#include "common_defines_test.h"
3135
#include "file_test.h"
3236

33-
#if !INTEGRATION_TESTS
34-
#error [NOT_SUPPORTED] integration tests not enabled for this target
35-
#endif
36-
3737
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3939
#else

TESTS/integration/fs-threaded/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
2323

24+
#if !INTEGRATION_TESTS
25+
#error [NOT_SUPPORTED] integration tests not enabled for this target
26+
#endif
27+
2428
#include "mbed.h"
2529
#include "FATFileSystem.h"
2630
#include "LittleFileSystem.h"
@@ -30,10 +34,6 @@
3034
#include "common_defines_test.h"
3135
#include "file_test.h"
3236

33-
#if !INTEGRATION_TESTS
34-
#error [NOT_SUPPORTED] integration tests not enabled for this target
35-
#endif
36-
3737
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3939
#else

TESTS/integration/net-single/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
2323

24+
#if !INTEGRATION_TESTS
25+
#error [NOT_SUPPORTED] integration tests not enabled for this target
26+
#endif
27+
2428
#include "mbed.h"
2529
#include "utest/utest.h"
2630
#include "unity/unity.h"
@@ -29,10 +33,6 @@
2933
#include "download_test.h"
3034
#include <string>
3135

32-
#if !INTEGRATION_TESTS
33-
#error [NOT_SUPPORTED] integration tests not enabled for this target
34-
#endif
35-
3636
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3737
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#else

TESTS/integration/net-threaded/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
2323

24+
#if !INTEGRATION_TESTS
25+
#error [NOT_SUPPORTED] integration tests not enabled for this target
26+
#endif
27+
2428
#include "mbed.h"
2529
#include "utest/utest.h"
2630
#include "unity/unity.h"
@@ -29,10 +33,6 @@
2933
#include "download_test.h"
3034
#include <string>
3135

32-
#if !INTEGRATION_TESTS
33-
#error [NOT_SUPPORTED] integration tests not enabled for this target
34-
#endif
35-
3636
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
3737
#include MBED_CONF_APP_BASICS_TEST_FILENAME
3838
#else

TESTS/integration/stress-net-fs/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
* Based on mbed-stress-test by Marcus Chang @ Arm Mbed - http://github.com/ARMmbed/mbed-stress-test
2222
*/
2323

24+
#if !INTEGRATION_TESTS
25+
#error [NOT_SUPPORTED] integration tests not enabled for this target
26+
#endif
27+
2428
#include "mbed.h"
2529
#include "FATFileSystem.h"
2630
#include "LittleFileSystem.h"
@@ -32,9 +36,6 @@
3236
#include "file_test.h"
3337
#include <string>
3438

35-
#if !INTEGRATION_TESTS
36-
#error [NOT_SUPPORTED] integration tests not enabled for this target
37-
#endif
3839

3940
#ifdef MBED_CONF_APP_BASICS_TEST_FILENAME
4041
#include MBED_CONF_APP_BASICS_TEST_FILENAME

TESTS/lorawan/loraradio/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "unity.h"
1919
#include "greentea-client/test_env.h"
2020

21-
#include "Semaphore.h"
22-
2321
#include "mbed_trace.h"
2422
#define TRACE_GROUP "RTST"
2523

@@ -36,6 +34,8 @@
3634
#error [NOT_SUPPORTED] Requires parameters from application config file.
3735
#endif
3836

37+
#include "Semaphore.h"
38+
3939
#if (MBED_CONF_APP_LORA_RADIO == SX1272) || (MBED_CONF_APP_LORA_RADIO == SX1276)
4040

4141
using namespace utest::v1;

features/frameworks/TARGET_PSA/pal/pal_mbed_os_intf.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ int test_start(test_entry_f test_f, compliance_test_type type)
135135
{
136136
test_g = test_f;
137137
type_g = type;
138+
#if defined(MBED_CONF_RTOS_PRESENT)
138139
MBED_ASSERT((type > COMPLIANCE_TEST_START) && (type < COMPLIANCE_TEST_END));
139140
Thread thread(osPriorityNormal, TEST_STACK_SIZE, NULL);
140141
thread.start(main_wrapper);
141142
thread.join();
143+
#endif
142144
return 0;
143145
}

features/frameworks/greentea-client/source/greentea_metrics.cpp

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,7 @@
2020
#include "platform/mbed_stats.h"
2121
#include <stdint.h>
2222

23-
#if defined(MBED_CONF_RTOS_PRESENT)
24-
25-
#define THREAD_BUF_COUNT 16
26-
27-
typedef struct {
28-
uint32_t entry;
29-
uint32_t stack_size;
30-
uint32_t max_stack;
31-
} thread_info_t;
32-
33-
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
34-
35-
#if !defined(MBED_CONF_RTOS_PRESENT) || !(MBED_CONF_RTOS_PRESENT)
36-
#error "RTOS required for Stack stats"
37-
#endif
23+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
3824

3925
#include "rtos/Mutex.h"
4026
#include "rtos/Thread.h"
@@ -46,6 +32,14 @@ typedef struct {
4632
using namespace mbed;
4733
using namespace rtos;
4834

35+
#define THREAD_BUF_COUNT 16
36+
37+
typedef struct {
38+
uint32_t entry;
39+
uint32_t stack_size;
40+
uint32_t max_stack;
41+
} thread_info_t;
42+
4943
// Mutex to protect "buf"
5044
static SingletonPtr<Mutex> mutex;
5145
static char buf[128];
@@ -59,7 +53,7 @@ static void send_CPU_info(void);
5953
#if defined(MBED_HEAP_STATS_ENABLED ) && MBED_HEAP_STATS_ENABLED
6054
static void send_heap_info(void);
6155
#endif
62-
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
56+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
6357
static void send_stack_info(void);
6458
static void on_thread_terminate(osThreadId_t id);
6559
static void enqeue_thread_info(osThreadId_t id);
@@ -72,7 +66,7 @@ static uint32_t print_dec(char *buf, uint32_t value);
7266

7367
void greentea_metrics_setup()
7468
{
75-
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
69+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
7670
Kernel::attach_thread_terminate_hook(on_thread_terminate);
7771
#endif
7872
}
@@ -82,7 +76,7 @@ void greentea_metrics_report()
8276
#if defined(MBED_HEAP_STATS_ENABLED ) && MBED_HEAP_STATS_ENABLED
8377
send_heap_info();
8478
#endif
85-
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
79+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
8680
send_stack_info();
8781
Kernel::attach_thread_terminate_hook(NULL);
8882
#endif
@@ -114,7 +108,7 @@ static void send_heap_info()
114108
}
115109
#endif
116110

117-
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
111+
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
118112
MBED_UNUSED static void send_stack_info()
119113
{
120114
mutex->lock();
@@ -236,4 +230,3 @@ static uint32_t print_dec(char *buf, uint32_t value)
236230
}
237231

238232
#endif
239-
#endif // #if defined(MBED_CONF_RTOS_PRESENT)

features/frameworks/greentea-client/source/greentea_test_env.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ static void greentea_write_string(const char *str);
6767
* This function is blocking.
6868
*/
6969
void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char *buffer, size_t size) {
70-
#if defined(MBED_CONF_RTOS_PRESENT)
7170
greentea_metrics_setup();
72-
#endif
7371
// Key-value protocol handshake function. Waits for {{__sync;...}} message
7472
// Sync preamble: "{{__sync;0dad4a9d-59a3-4aec-810d-d5fb09d852c1}}"
7573
// Example value of sync_uuid == "0dad4a9d-59a3-4aec-810d-d5fb09d852c1"
@@ -484,9 +482,7 @@ static void greentea_notify_completion(const int result) {
484482
__gcov_flush();
485483
coverage_report = false;
486484
#endif
487-
#if defined(MBED_CONF_RTOS_PRESENT)
488485
greentea_metrics_report();
489-
#endif
490486
greentea_send_kv(GREENTEA_TEST_ENV_END, val);
491487
greentea_send_kv(GREENTEA_TEST_ENV_EXIT, 0);
492488
}

0 commit comments

Comments
 (0)