[elbe-devel] [PATCH v2 3/5] Call new junit API in project finetuning.
Torben Hohn
torben.hohn at linutronix.de
Wed Aug 7 17:14:22 CEST 2019
From: Olivier Dion <dion at linutronix.de>
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/finetuning.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 0ea082e94..f8cc1683a 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -23,6 +23,7 @@ from elbepack.shellhelper import CommandError
from elbepack.filesystem import ImgMountFilesystem
from elbepack.packers import default_packer, packers
from elbepack.egpg import unlock_key
+from elbepack.junit import TestSuite, TestException
class FinetuningException(Exception):
@@ -680,6 +681,26 @@ class CopyToPartition(ImageFinetuningAction):
log.do(cmd)
+ at FinetuningAction.register("unit-tests")
+class TestSuites(FinetuningAction):
+
+ elbe_junit = "elbe-junit.xml"
+
+ def execute_prj(self, log, buildenv, target, builddir):
+
+ tss = []
+ output = os.path.join(builddir, elbe_junit)
+ target.images.append(elbe_junit)
+
+ for test_suite in self.node:
+ ts = TestSuite(test_suite, target)
+ try:
+ tss.append(ts())
+ except TestException as E:
+ log.printo(str(E))
+
+ TestSuite.to_file(output, tss)
+
def do_finetuning(xml, log, buildenv, target):
if not xml.has('target/finetuning'):
--
2.11.0
More information about the elbe-devel
mailing list