From ff69562c9b9732e5fb7971265f09d05cc4f97184 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Mon, 5 Dec 2016 16:00:06 +0000 Subject: automated: test-runner: Added support for complex test names Test names can contain '=' now. The parsing is based on regex rather than simple line split with '=' as delimiter. This adresses libhugetlbfs test parsing problem. Change-Id: I1b6e03960456abf437a2720f6e5177556c766f5a Signed-off-by: Milosz Wasilewski --- automated/utils/test-runner.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/automated/utils/test-runner.py b/automated/utils/test-runner.py index ed8b755..ad84d28 100755 --- a/automated/utils/test-runner.py +++ b/automated/utils/test-runner.py @@ -429,6 +429,10 @@ class ResultParser(object): def parse_stdout(self): with open('%s/stdout.log' % self.result_path, 'r') as f: + test_case_re = re.compile("TEST_CASE_ID=(P?.*)") + result_re = re.compile("RESULT=(P?.*)") + measurement_re = re.compile("MEASUREMENT=(P?.*)") + units_re = re.compile("UNITS=(P?.*)") for line in f: if re.match(r'\<(|LAVA_SIGNAL_TESTCASE )TEST_CASE_ID=.*', line): line = line.strip('\n').strip('<>').split(' ') @@ -438,11 +442,18 @@ class ResultParser(object): 'units': ''} for string in line: - parts = string.split('=') - if len(parts) == 2: - key, value = parts - key = key.lower() - data[key] = value + test_case_match = test_case_re.match(string) + result_match = result_re.match(string) + measurement_match = measurement_re.match(string) + units_match = units_re.match(string) + if test_case_match: + data['test_case_id'] = test_case_match.group(0) + if result_match: + data['result'] = result_match.group(0) + if measurement_match: + data['measurement'] = measurement_match.group(0) + if units_match: + data['units'] = units_match.group(0) self.metrics.append(data.copy()) -- cgit v1.2.3