diff options
author | Naresh Kamboju <naresh.kamboju@linaro.org> | 2016-12-06 12:59:28 +0000 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2016-12-06 12:59:28 +0000 |
commit | 0631f90b4ef62f58a25be81463373795fc94fc6b (patch) | |
tree | 4b37dfe84b4d5458d600c8cda08c59e0b3c6d58b | |
parent | 307031702a0e75bde3c5f3e6e8ad415027e63c8a (diff) | |
parent | ff69562c9b9732e5fb7971265f09d05cc4f97184 (diff) |
Merge "automated: test-runner: Added support for complex test names"
-rwxr-xr-x | automated/utils/test-runner.py | 21 |
1 files 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()) |