File: junit-merge.py

package info (click to toggle)
wsclean 3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,968 kB
  • sloc: cpp: 85,742; python: 3,526; sh: 245; makefile: 21
file content (15 lines) | stat: -rwxr-xr-x 425 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3
import sys
from xml.etree import ElementTree


def run(output_file, input_files):
    suites = ElementTree.Element("testsuites")
    for filename in input_files:
        data = ElementTree.parse(filename).getroot()
        suites.extend(data.iter("testsuite"))
    ElementTree.ElementTree(suites).write(output_file, xml_declaration=True)


if __name__ == "__main__":
    run(sys.argv[1], sys.argv[2:])