Commit 3e86f94e authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Add check of comparison filetype to allow detecting and reporting which filetype has diff.

parent b70ebd54
Loading
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -128,9 +128,25 @@ def test_26252(test_tag, encoder_path, decoder_path, renderer_path, isar_post_re
        subprocess.run([isar_post_renderer_path] + isar_post_rend_opts.split()[1:], check = True)        

    diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path)
    result = True

    diff_in_wav = False
    diff_in_met = False
    diff_in_csv = False
    for cmd in diff_opts.split(';'):
        result = result and filecmp.cmp(cmd.split()[1], cmd.split()[2])
    if not result:
        assert False, "Output differs" 
        if not filecmp.cmp(cmd.split()[1], cmd.split()[2]):
            if ".csv" in cmd.split()[1]:
                diff_in_csv = True
            elif ".met" in cmd.split()[1]:
                diff_in_met = True
            else:
                diff_in_wav = True

    if diff_in_wav or diff_in_csv or diff_in_met:
        result_str = "Output differs in: "
        if diff_in_wav:
            result_str = result_str + "waveform "
        if diff_in_met:
            result_str = result_str + "MASA metadata "
        if diff_in_csv:
            result_str = result_str + "object metadata "
        assert False, result_str