Commit 7116adc9 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix property recording in renderer tests

parent 26ad4994
Loading
Loading
Loading
Loading
+67 −3
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ def test_ambisonics(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -86,6 +87,7 @@ def test_ambisonics(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -102,6 +104,7 @@ def test_ambisonics_binaural_static(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -113,6 +116,7 @@ def test_ambisonics_binaural_static(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -131,6 +135,7 @@ def test_ambisonics_binaural_headrotation(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -143,6 +148,7 @@ def test_ambisonics_binaural_headrotation(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -161,6 +167,7 @@ def test_dynamic_acoustic_environment(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
    aeid,
):
    rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg")
@@ -176,6 +183,7 @@ def test_dynamic_acoustic_environment(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
        config_file=rend_config_path,
        aeid=aeid,
    )
@@ -195,6 +203,7 @@ def test_dynamic_acoustic_environment_file(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg")
    rend_config_path.with_stem(f"rend_config")
@@ -211,6 +220,7 @@ def test_dynamic_acoustic_environment_file(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
        config_file=rend_config_path,
        aeid=aeid,
    )
@@ -232,6 +242,7 @@ def test_multichannel(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -243,6 +254,7 @@ def test_multichannel(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -259,6 +271,7 @@ def test_multichannel_binaural_static(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")
@@ -273,6 +286,7 @@ def test_multichannel_binaural_static(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -291,6 +305,7 @@ def test_multichannel_binaural_headrotation(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")
@@ -306,6 +321,7 @@ def test_multichannel_binaural_headrotation(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -325,6 +341,7 @@ def test_ism(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -337,6 +354,7 @@ def test_ism(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -353,6 +371,7 @@ def test_ism_binaural_static(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    try:
        in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt]
@@ -370,6 +389,7 @@ def test_ism_binaural_static(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -388,6 +408,7 @@ def test_ism_binaural_headrotation(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    try:
        in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt]
@@ -406,6 +427,7 @@ def test_ism_binaural_headrotation(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -425,6 +447,7 @@ def test_masa(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -437,6 +460,7 @@ def test_masa(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -453,6 +477,7 @@ def test_masa_binaural_static(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]:
        pytest.skip("Skipping binaural room outputs for MASA as unimplemented.")
@@ -468,6 +493,7 @@ def test_masa_binaural_static(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -486,6 +512,7 @@ def test_masa_binaural_headrotation(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]:
        pytest.skip("Skipping binaural room outputs for MASA as unimplemented.")
@@ -502,13 +529,20 @@ def test_masa_binaural_headrotation(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@pytest.mark.create_ref
@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND)
def test_masa_prerend(
    record_property, props_to_record, test_info, in_fmt, get_mld, get_mld_lim
    record_property,
    props_to_record,
    test_info,
    in_fmt,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -520,6 +554,7 @@ def test_masa_prerend(
        binary_suffix=EXE_SUFFIX,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -539,6 +574,7 @@ def test_custom_ls_input(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -550,6 +586,7 @@ def test_custom_ls_input(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -557,7 +594,14 @@ def test_custom_ls_input(
@pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST)
@pytest.mark.parametrize("in_fmt", OUTPUT_FORMATS)
def test_custom_ls_output(
    record_property, props_to_record, test_info, in_fmt, out_fmt, get_mld, get_mld_lim
    record_property,
    props_to_record,
    test_info,
    in_fmt,
    out_fmt,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -568,6 +612,7 @@ def test_custom_ls_output(
        binary_suffix=EXE_SUFFIX,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -575,7 +620,14 @@ def test_custom_ls_output(
@pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST)
@pytest.mark.parametrize("in_fmt", CUSTOM_LS_TO_TEST)
def test_custom_ls_input_output(
    record_property, props_to_record, test_info, in_fmt, out_fmt, get_mld, get_mld_lim
    record_property,
    props_to_record,
    test_info,
    in_fmt,
    out_fmt,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -586,6 +638,7 @@ def test_custom_ls_input_output(
        binary_suffix=EXE_SUFFIX,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -602,6 +655,7 @@ def test_custom_ls_input_binaural(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -613,6 +667,7 @@ def test_custom_ls_input_binaural(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -631,6 +686,7 @@ def test_custom_ls_input_binaural_headrotation(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -643,6 +699,7 @@ def test_custom_ls_input_binaural_headrotation(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -662,6 +719,7 @@ def test_metadata(
    frame_size,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -674,6 +732,7 @@ def test_metadata(
        frame_size=frame_size,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -693,6 +752,7 @@ def test_non_diegetic_pan_static(
    non_diegetic_pan,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -704,6 +764,7 @@ def test_non_diegetic_pan_static(
        binary_suffix=EXE_SUFFIX,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -720,6 +781,7 @@ def test_non_diegetic_pan_ism_static(
    non_diegetic_pan,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    run_renderer(
        record_property,
@@ -731,6 +793,7 @@ def test_non_diegetic_pan_ism_static(
        binary_suffix=EXE_SUFFIX,
        get_mld=get_mld,
        mld_lim=get_mld_lim,
        get_ssnr=get_ssnr,
    )


@@ -756,6 +819,7 @@ def test_ambisonics_binaural_headrotation_refrotzero(
    trj_file,
    get_mld,
    get_mld_lim,
    get_ssnr,
):
    if test_info.config.option.create_ref or test_info.config.option.create_cut:
        pytest.skip("OTR tests only run for smoke test")
+27 −28
Original line number Diff line number Diff line
@@ -304,7 +304,6 @@ def run_renderer(
        # CUT creation mode will run a comparison with REF
        out_file_ref = str(OUTPUT_PATH_REF.joinpath(out_file_stem))

        if get_mld:
        # see constants.py
        ref_fs = int(cmd[10]) * 1000
        output_differs, reason = cmp_pcm(
@@ -324,7 +323,7 @@ def run_renderer(

        if output_differs:
            pytest.fail(f"Output differs: ({reason})")
        else:

        try:
            ref, ref_fs = readfile(out_file_ref)
        except FileNotFoundError: