Skip to content

Commit 2c5195c

Browse files
golowanowkartben
authored andcommitted
twister: reports: Pretty print XML reports
Pretty print XML reports with tab identation on levels for better readability and ease text diff there as well. Signed-off-by: Dmitrii Golovanov <[email protected]>
1 parent c5c4165 commit 2c5195c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/pylib/twister/twisterlib/reports.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def xunit_report_suites(self, json_file, filename):
191191
eleTestsuite.attrib['skipped'] = f"{skips}"
192192
eleTestsuite.attrib['tests'] = f"{total}"
193193

194+
ET.indent(eleTestsuites, space="\t", level=0)
194195
result = ET.tostring(eleTestsuites)
195196
with open(filename, 'wb') as report:
196197
report.write(result)
@@ -280,6 +281,7 @@ def xunit_report(self, json_file, filename, selected_platform=None, full_report=
280281
eleTestsuite.attrib['skipped'] = f"{skips}"
281282
eleTestsuite.attrib['tests'] = f"{total}"
282283

284+
ET.indent(eleTestsuites, space="\t", level=0)
283285
result = ET.tostring(eleTestsuites)
284286
with open(filename, 'wb') as report:
285287
report.write(result)

0 commit comments

Comments
 (0)