Commit fa428a2c authored by Jan Kiene's avatar Jan Kiene
Browse files

fix mld value from cmp_pcm and add parsing of more than 1 property

parent 8b5f1bee
Loading
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@ from xml.etree import ElementTree
Parse a junit report and create a MLD summary report.
"""

PROPERTIES = ["MLD", "MAXIMUM ABS DIFF"]


# Main routine
if __name__ == "__main__":
    parser = argparse.ArgumentParser(
@@ -32,9 +35,12 @@ if __name__ == "__main__":
    testcases = tree.findall(".//testcase")

    with open(csv_file, "w") as outfile:
        headerline = ";".join(["testcase"] + PROPERTIES) + "\n"
        outfile.write(headerline)

        for testcase in testcases:
            if testcase.find(".//skipped") == None:
                if testcase.get("file") == None:
            if testcase.find(".//skipped") is None:
                if testcase.get("file") is None:
                    fulltestname = (
                        testcase.get("classname").replace(".", "/")
                        + ".py::"
@@ -42,10 +48,11 @@ if __name__ == "__main__":
                    )
                else:
                    fulltestname = testcase.get("file") + "::" + testcase.get("name")
                if testcase.find(".//property") == None:
                    mld_val = None
                else:
                    mld_val = testcase.find(".//property").get(
                        "value"
                    )  # Currently MLD is the only set property. If more are added updates are needed here.
                outfile.write(fulltestname + ";" + str(mld_val) + "\n")

                properties_found = {
                    p.get("name"): p.get("value")
                    for p in testcase.findall(".//property")
                }
                properties_values = [str(properties_found.get(p)) for p in PROPERTIES]
                outline = ";".join([fulltestname] + properties_values) + "\n"
                outfile.write(outline)
+10 −10

File changed.

Contains only whitespace changes.