aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-06-15 13:27:07 +0200
committerpespin <pespin@sysmocom.de>2020-06-15 15:42:58 +0000
commitd4dc2ad3a2767bcebf4eb2bba2cefee0c26f6d6e (patch)
tree7e86ae6a1a466abc93877c0395bee5a3de3ce1a3 /src/osmo_gsm_tester
parente592de80561377fdbf87b0822d2ff1f7098c0bf0 (diff)
selftest: Add test to verify junit xml report
Diffstat (limited to 'src/osmo_gsm_tester')
-rw-r--r--src/osmo_gsm_tester/core/suite.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/osmo_gsm_tester/core/suite.py b/src/osmo_gsm_tester/core/suite.py
index 938471c..a1d068e 100644
--- a/src/osmo_gsm_tester/core/suite.py
+++ b/src/osmo_gsm_tester/core/suite.py
@@ -189,18 +189,21 @@ class SuiteRun(log.Origin):
util.import_path_remove(suite_libdir)
self.duration = time.time() - self.start_timestamp
- passed, skipped, failed, errors = self.count_test_results()
- # if no tests ran, count it as failure
- if passed and not failed and not errors:
- self.status = SuiteRun.PASS
- else:
- self.status = SuiteRun.FAIL
+ self.determine_status()
log.large_separator(self._trial.name(), self.name(), self.status, sublevel=2, space_above=False)
def passed(self):
return self.status == SuiteRun.PASS
+ def determine_status(self):
+ passed, skipped, failed, errors = self.count_test_results()
+ # if no tests ran, count it as failure
+ if passed and not failed and not errors:
+ self.status = SuiteRun.PASS
+ else:
+ self.status = SuiteRun.FAIL
+
def count_test_results(self):
passed = 0
skipped = 0