]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/core/context: expose results as variable
authorKonrad Weihmann <kweihmann@outlook.com>
Tue, 10 Nov 2020 19:20:14 +0000 (20:20 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Tue, 17 Nov 2020 03:45:12 +0000 (11:45 +0800)
register an unittest handler for testresults and expose it as
variable result.
With this even partial results from an interrupted test suite run
can be made available

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a97ae47525157871b6c098ffc352293e365a4335)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/lib/oeqa/core/context.py

index 7d3fa3b84a581237f80598df6da78fd3ab231174..84b43a93e19a876a04ced6714668bd1d18c69eac 100644 (file)
@@ -31,6 +31,9 @@ class OETestContext(object):
         self._registry = {}
         self._registry['cases'] = collections.OrderedDict()
 
+        self.results = unittest.TestResult()
+        unittest.registerResult(self.results)
+
     def _read_modules_from_manifest(self, manifest):
         if not os.path.exists(manifest):
             raise OEQAMissingManifest("Manifest does not exist on %s" % manifest)