From 67046daa6be719aa0cd21e65d0a859f250ac4cec Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Thu, 8 Jun 2017 10:17:40 -0500 Subject: [PATCH] Fixing parsing of memory of metrics. In mbed OS versions 5.4.x and older, memory metrics were printed in a format that always included a hyphenated thread "entry" and "argument". In the coming 5.5 release, this doesn't appear to be the case, only containing the "entry". This PR allows greentea to parse both cases. --- mbed_greentea/mbed_test_api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mbed_greentea/mbed_test_api.py b/mbed_greentea/mbed_test_api.py index 890e0ba4..5866e337 100644 --- a/mbed_greentea/mbed_test_api.py +++ b/mbed_greentea/mbed_test_api.py @@ -536,14 +536,17 @@ def get_memory_metrics(output): thread_stack_size = int(thread_stack_size) thread_entry_arg_split = thread_entry_arg.split('-') thread_entry = thread_entry_arg_split[0] - thread_arg = thread_entry_arg_split[1] + thread_info[thread_entry_arg] = { 'entry': thread_entry, - 'arg': thread_arg, 'max_stack': thread_max_stack, 'stack_size': thread_stack_size } + if len(thread_entry_arg_split) > 1: + thread_arg = thread_entry_arg_split[1] + thread_info[thread_entry_arg]['arg'] = thread_arg + thread_info_list = thread_info.values() return max_heap_usage, thread_info_list