From 29ad0ec7a8ec8aae5afeb32ef8be03707f626843 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 5 Dec 2019 07:18:08 +0100 Subject: tester: Prefer '_' as test state separator char --- tester/rt/report.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'tester') diff --git a/tester/rt/report.py b/tester/rt/report.py index 06acb21..c62d553 100644 --- a/tester/rt/report.py +++ b/tester/rt/report.py @@ -142,7 +142,9 @@ class report(object): elif banner.startswith('TEST VERSION:'): version = banner[13:].strip() elif banner.startswith('TEST STATE:'): - state = banner[11:].strip() + # Depending on the RTESM version '-' or '_' is used in + # test state strings. Normalize it to '_'. + state = banner[11:].strip().replace('-', '_') elif banner.startswith('TEST BUILD:'): build = ','.join(banner[11:].strip().split(' ')) elif banner.startswith('TEST TOOLS:'): @@ -164,22 +166,22 @@ class report(object): self.config['version'] = version else: if version != self.config['version']: - state = 'WRONG-VERSION' + state = 'WRONG_VERSION' if build: if 'build' not in self.config: self.config['build'] = build else: if build != self.config['build']: - state = 'WRONG-BUILD' + state = 'WRONG_BUILD' if tools: if 'tools' not in self.config: self.config['tools'] = tools else: if tools != self.config['tools']: - state = 'WRONG-TOOLS' - if state is None or state == 'EXPECTED-PASS': + state = 'WRONG_TOOLS' + if state is None or state == 'EXPECTED_PASS': if start and end: - if state is None or state == 'EXPECTED-PASS': + if state is None or state == 'EXPECTED_PASS': status = 'passed' self.passed += 1 elif timeout: @@ -218,13 +220,13 @@ class report(object): elif state == 'BENCHMARK': status = 'benchmark' self.benchmark += 1 - elif state == 'WRONG-VERSION': + elif state == 'WRONG_VERSION': status = 'wrong-version' self.wrong_version += 1 - elif state == 'WRONG-BUILD': + elif state == 'WRONG_BUILD': status = 'wrong-build' self.wrong_build += 1 - elif state == 'WRONG-TOOLS': + elif state == 'WRONG_TOOLS': status = 'wrong-tools' self.wrong_tools += 1 else: -- cgit v1.2.3