Skip to content

Commit 1f98bbe

Browse files
committed
Bare metal greentea support
-Added the baremetal.json on Tests directory to enable bare-metal -Conditional enable of greentea metrics Note: Run green tea with bare metal mbed test -m target -t GCC_ARM -n tests-mbed_platform-transaction --app-config TESTS/baremetal.json
1 parent 9534327 commit 1f98bbe

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

TESTS/baremetal.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"requires": [
3+
"bare-metal",
4+
"greentea-client",
5+
"utest",
6+
"unity"
7+
]
8+
}

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

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

23+
#if defined(MBED_CONF_RTOS_PRESENT)
24+
2325
#define THREAD_BUF_COUNT 16
2426

2527
typedef struct {
@@ -234,3 +236,4 @@ static uint32_t print_dec(char *buf, uint32_t value)
234236
}
235237

236238
#endif
239+
#endif // #if defined(MBED_CONF_RTOS_PRESENT)

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ 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)
7071
greentea_metrics_setup();
72+
#endif
7173
// Key-value protocol handshake function. Waits for {{__sync;...}} message
7274
// Sync preamble: "{{__sync;0dad4a9d-59a3-4aec-810d-d5fb09d852c1}}"
7375
// Example value of sync_uuid == "0dad4a9d-59a3-4aec-810d-d5fb09d852c1"
@@ -482,7 +484,9 @@ static void greentea_notify_completion(const int result) {
482484
__gcov_flush();
483485
coverage_report = false;
484486
#endif
487+
#if defined(MBED_CONF_RTOS_PRESENT)
485488
greentea_metrics_report();
489+
#endif
486490
greentea_send_kv(GREENTEA_TEST_ENV_END, val);
487491
greentea_send_kv(GREENTEA_TEST_ENV_EXIT, 0);
488492
}
@@ -783,4 +787,4 @@ static int HandleKV(char *out_key,
783787
return 0;
784788
}
785789

786-
#endif
790+
#endif

0 commit comments

Comments
 (0)