Hello Nikos Nikoleris,

I'd like you to do a code review. Please visit

    https://gem5-review.googlesource.com/c/public/gem5/+/25083

to review the following change.


Change subject: ext: Add failure node to JUnit xml file
......................................................................

ext: Add failure node to JUnit xml file

"failure" is a child of the testcase node:

https://llg.cubic.org/docs/junit/

It allows xml parsers to understand which testcase failed the run.
Otherwise CI frameworks like jenkins wouldn't be able to classify every
single testcase. Prior to this patch testlib was using
testsuites.failures and testsuite.failures only. These are simply
reporting the number of failures.

Change-Id: I0d498eca029c3232f2a588b153b6b6829b789394
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikole...@arm.com>
---
M ext/testlib/result.py
1 file changed, 14 insertions(+), 0 deletions(-)



diff --git a/ext/testlib/result.py b/ext/testlib/result.py
index 22c0248..786c21b 100644
--- a/ext/testlib/result.py
+++ b/ext/testlib/result.py
@@ -269,6 +269,20 @@
             LargeFileElement('system-out', test_result.stdout),
         ]

+        if str(test_result.result) == 'Failed':
+            self.elements.append(JUnitFailure('Test failed', 'ERROR'))
+
+
+class JUnitFailure(XMLElement):
+    name = 'failure'
+    def __init__(self, message, fail_type):
+        self.attributes = [
+            XMLAttribute('message', message),
+            XMLAttribute('type', fail_type),
+        ]
+        self.elements = []
+
+
 class LargeFileElement(XMLElement):
     def __init__(self, name, filename):
         self.name = name

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/25083
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I0d498eca029c3232f2a588b153b6b6829b789394
Gerrit-Change-Number: 25083
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to