[elbe-devel] [PATCH v2 3/5] Call new junit API in project finetuning.

dion at linutronix.de dion at linutronix.de
Wed Aug 7 16:34:41 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 7f20436e..730cfdcc 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):
@@ -674,6 +675,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