[rtems-tools commit] tester: Prefer '_' as test state separator char

Sebastian Huber sebh at rtems.org
Wed Jan 8 06:19:51 UTC 2020


Module:    rtems-tools
Branch:    master
Commit:    29ad0ec7a8ec8aae5afeb32ef8be03707f626843
Changeset: http://git.rtems.org/rtems-tools/commit/?id=29ad0ec7a8ec8aae5afeb32ef8be03707f626843

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Dec  5 07:18:08 2019 +0100

tester: Prefer '_' as test state separator char

---

 tester/rt/report.py | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

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:



More information about the vc mailing list