Commit 47ebf75a authored by norvell's avatar norvell
Browse files

Add handling of split measurements in parse_xml_report.py

parent 842de937
Loading
Loading
Loading
Loading
+26 −5
Original line number Diff line number Diff line
@@ -136,6 +136,16 @@ if __name__ == "__main__":
            else:
                testresult = "PASS"

            # Extract number of splits, if any
            splits = [p.split('_')[-1] for p in properties_found if 'split' in p]
            splits = list(dict.fromkeys(splits)) # Remove duplicates, keeping order

            if splits:
                properties_values = {}
                for s in splits:
                    properties_suffixed = [p + '_' + s for p in PROPERTIES]
                    properties_values[s] = [str(properties_found.get(p)) for p in properties_suffixed]
            else:
                properties_values = [str(properties_found.get(p)) for p in PROPERTIES]

            # Identify format and category (mode of operation)
@@ -158,6 +168,13 @@ if __name__ == "__main__":

            # For ERROR cases, both a FAIL and an ERROR result is generated.
            # Here, a FAIL would be overwritten with an ERROR result since it has the same name.
            if splits:
                for s in splits:
                    fulltestname_split = f"{fulltestname}-{s}"
                    results[fmt][cat][fulltestname_split] = {"Result": testresult}
                    for propertyname, propertyvalue in zip(PROPERTIES, properties_values[s]):
                        results[fmt][cat][fulltestname_split][propertyname] = propertyvalue
            else:
                results[fmt][cat][fulltestname] = {"Result": testresult}
                for propertyname, propertyvalue in zip(PROPERTIES, properties_values):
                    results[fmt][cat][fulltestname][propertyname] = propertyvalue
@@ -172,6 +189,10 @@ if __name__ == "__main__":
            for cat in CATEGORIES:
                results[fmt][cat] = dict(sorted(results[fmt][cat].items()))
                for test in results[fmt][cat]:
                    if splits:
                        if "split1" in test:
                            count[results[fmt][cat][test]["Result"]] += 1    
                    else:                            
                        count[results[fmt][cat][test]["Result"]] += 1
                    line = (
                        ";".join(