mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
oeqa/runner: Simplify code
There doesn't appear to be any reason we need this _results indirection any more so remove it. (From OE-Core rev: b618261811c48ff3b98eab1b340a8cd09ef183c6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -47,8 +47,10 @@ class OETestResult(_TestResult):
|
||||
self.endtime = {}
|
||||
self.progressinfo = {}
|
||||
|
||||
# Inject into tc so that TestDepends decorator can see results
|
||||
tc.results = self
|
||||
|
||||
self.tc = tc
|
||||
self._tc_map_results()
|
||||
|
||||
def startTest(self, test):
|
||||
# May have been set by concurrencytest
|
||||
@@ -56,13 +58,6 @@ class OETestResult(_TestResult):
|
||||
self.starttime[test.id()] = time.time()
|
||||
super(OETestResult, self).startTest(test)
|
||||
|
||||
def _tc_map_results(self):
|
||||
self.tc._results['failures'] = self.failures
|
||||
self.tc._results['errors'] = self.errors
|
||||
self.tc._results['skipped'] = self.skipped
|
||||
self.tc._results['expectedFailures'] = self.expectedFailures
|
||||
self.tc._results['successes'] = self.successes
|
||||
|
||||
def stopTest(self, test):
|
||||
self.endtime[test.id()] = time.time()
|
||||
super(OETestResult, self).stopTest(test)
|
||||
@@ -80,7 +75,7 @@ class OETestResult(_TestResult):
|
||||
msg = "%s - OK - All required tests passed" % component
|
||||
else:
|
||||
msg = "%s - FAIL - Required tests failed" % component
|
||||
skipped = len(self.tc._results['skipped'])
|
||||
skipped = len(self.skipped)
|
||||
if skipped:
|
||||
msg += " (skipped=%d)" % skipped
|
||||
self.tc.logger.info(msg)
|
||||
@@ -88,7 +83,7 @@ class OETestResult(_TestResult):
|
||||
def _getDetailsNotPassed(self, case, type, desc):
|
||||
found = False
|
||||
|
||||
for (scase, msg) in self.tc._results[type]:
|
||||
for (scase, msg) in getattr(self, type):
|
||||
# XXX: When XML reporting is enabled scase is
|
||||
# xmlrunner.result._TestInfo instance instead of
|
||||
# string.
|
||||
|
||||
Reference in New Issue
Block a user