diff options
Diffstat (limited to '.ci/utils/format_devtest_junitxml.py')
-rw-r--r-- | .ci/utils/format_devtest_junitxml.py | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/.ci/utils/format_devtest_junitxml.py b/.ci/utils/format_devtest_junitxml.py index b941a64e6..39b4d13ed 100644 --- a/.ci/utils/format_devtest_junitxml.py +++ b/.ci/utils/format_devtest_junitxml.py @@ -8,15 +8,32 @@ class ClassNameTestCase(TestCase): parser = argparse.ArgumentParser() parser.add_argument("search_path") parser.add_argument("output_name") +parser.add_argument("--fpgas") args = parser.parse_args() -xml = JUnitXml() -for file in glob.glob(args.search_path + "/**/*.xml", recursive=True): - xml += JUnitXml.fromfile(file) +if args.fpgas: + return_xml = JUnitXml() + for fpga in args.fpgas.split(','): + xml = JUnitXml() + for file in glob.glob(args.search_path + "/" + fpga + "/**/*.xml", recursive=True): + xml += JUnitXml.fromfile(file) + for suite in xml: + for case in suite: + classname_case = ClassNameTestCase.fromelem(case) + if classname_case.name == 'test_all': + classname_case.name = fpga + " " + classname_case.classname + return_xml += xml + return_xml.write(args.output_name) -for suite in xml: - for case in suite: - classname_case = ClassNameTestCase.fromelem(case) - if classname_case.name == 'test_all': - classname_case.name = classname_case.classname -xml.write(args.output_name) +else: + return_xml = JUnitXml() + for file in glob.glob(args.search_path + "/**/*.xml", recursive=True): + return_xml += JUnitXml.fromfile(file) + + for suite in return_xml: + for case in suite: + classname_case = ClassNameTestCase.fromelem(case) + if classname_case.name == 'test_all': + classname_case.name = classname_case.classname + + return_xml.write(args.output_name) |