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
pull/11721/head
RAJKUMAR KANAGARAJ 2019-10-21 04:55:31 -07:00
parent e4164bee51
commit f402dbb2da
3 changed files with 16 additions and 1 deletions

8
TESTS/baremetal.json Normal file
View File

@ -0,0 +1,8 @@
{
"requires": [
"bare-metal",
"greentea-client",
"utest",
"unity"
]
}

View File

@ -20,6 +20,8 @@
#include "platform/mbed_stats.h"
#include <stdint.h>
#if defined(MBED_CONF_RTOS_PRESENT)
#define THREAD_BUF_COUNT 16
typedef struct {
@ -234,3 +236,4 @@ static uint32_t print_dec(char *buf, uint32_t value)
}
#endif
#endif // #if defined(MBED_CONF_RTOS_PRESENT)

View File

@ -67,7 +67,9 @@ static void greentea_write_string(const char *str);
* This function is blocking.
*/
void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char *buffer, size_t size) {
#if defined(MBED_CONF_RTOS_PRESENT)
greentea_metrics_setup();
#endif
// Key-value protocol handshake function. Waits for {{__sync;...}} message
// Sync preamble: "{{__sync;0dad4a9d-59a3-4aec-810d-d5fb09d852c1}}"
// Example value of sync_uuid == "0dad4a9d-59a3-4aec-810d-d5fb09d852c1"
@ -486,7 +488,9 @@ static void greentea_notify_completion(const int result) {
__gcov_flush();
coverage_report = false;
#endif
#if defined(MBED_CONF_RTOS_PRESENT)
greentea_metrics_report();
#endif
greentea_send_kv(GREENTEA_TEST_ENV_END, val);
greentea_send_kv(GREENTEA_TEST_ENV_EXIT, 0);
}
@ -787,4 +791,4 @@ static int HandleKV(char *out_key,
return 0;
}
#endif
#endif