Commit b05b10d9 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch 'main' of forge.3gpp.org:ivas-codec-pc/ivas-codec into...

Merge branch 'main' of forge.3gpp.org:ivas-codec-pc/ivas-codec into 1050-memory-optimization-efap-handle-in-ism-decoder
parents 62bb9e1d 8bd108ed
Loading
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -28,13 +28,14 @@ if __name__ == "__main__":
    tree = ElementTree.parse(xml_report)

    testsuite = tree.find(".//testsuite")
    print(
        f"Found testsuite with {testsuite.get('tests')} tests and {testsuite.get('failures')} failures."
    )


    testcases = tree.findall(".//testcase")
    
    results_unsorted = {}
    passes = 0
    failures = 0
    errors = 0

    for testcase in testcases:
        if testcase.find(".//skipped") is None:
@@ -51,14 +52,29 @@ if __name__ == "__main__":
                p.get("name"): p.get("value")
                for p in testcase.findall(".//property")
            }

            if testcase.find('failure') is not None:
                testresult = 'FAIL'
                failures = failures + 1
            elif testcase.find('error') is not None:
                testresult = 'ERROR'
                errors = errors + 1
            else:
                testresult = 'PASS'
                passes = passes + 1

            properties_values = [str(properties_found.get(p)) for p in PROPERTIES]
            outline = ";".join([fulltestname] + properties_values) + "\n"
            outline = ";".join([fulltestname,testresult] + properties_values) + "\n"
            results_unsorted[fulltestname] = outline

    results_sorted = dict(sorted(results_unsorted.items()))

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

    print(
        f"Parsed testsuite with {passes+failures+errors} tests: {passes} passes, {failures} failures and {errors} errors."
    )
+7 −2
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) -
    print("=====================")

    out_config = "MONO" if out_config == "" else out_config
    if out_config.upper() not in pyivastest.constants.OC_TO_NCHANNELS:
    # out_config may be a string or a Path. Wrap in str() to avoid error in case it is a Path.
    if str(out_config).upper() not in pyivastest.constants.OC_TO_NCHANNELS:
        out_config_in_file_names = os.path.splitext(os.path.basename(out_config))[0]
        nchannels = (
            pyivastest.IvasScriptsCommon.IvasScript.get_n_channels_from_ls_layout(
@@ -43,7 +44,11 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) -
            f"file size in samples: file 1 = {s1.shape[0]},",
            f"file 2 = {s2.shape[0]}",
        )
        return 1, "FAIL: File lengths differ"
        reason = "FAIL: File lengths differ. MAXIMUM ABS DIFF: None"
        if get_mld:
            reason += " - MLD: None"

        return 1, reason

    cmp_result = pyaudio3dtools.audioarray.compare(
        s1, s2, fs, per_frame=False, get_mld=get_mld