Commit 7f4569ec authored by norvell's avatar norvell
Browse files

Fix test_renderer.py

parent 0861c7d6
Loading
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
@@ -48,10 +48,13 @@ from .utils import *
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_ambisonics(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property, 
        test_info,
        in_fmt,
        out_fmt,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -61,10 +64,13 @@ def test_ambisonics(record_property, test_info, in_fmt, out_fmt, frame_size, get
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_ambisonics_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -77,11 +83,14 @@ def test_ambisonics_binaural_headrotation(
    record_property, test_info, in_fmt, out_fmt, trj_file, frame_size, get_mld, get_mld_lim
):
    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -94,10 +103,13 @@ def test_ambisonics_binaural_headrotation(
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_multichannel(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -110,10 +122,13 @@ def test_multichannel_binaural_static(record_property, test_info, in_fmt, out_fm
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -129,11 +144,14 @@ def test_multichannel_binaural_headrotation(
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    run_renderer(
        record_property,
        test_info,
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,
    )


@@ -146,11 +164,14 @@ def test_multichannel_binaural_headrotation(
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_ism(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property,
        test_info,
        in_fmt,
        out_fmt,
        in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt],
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,
    )


@@ -165,11 +186,14 @@ def test_ism_binaural_static(record_property, test_info, in_fmt, out_fmt, frame_
        in_meta_files = None

    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        in_meta_files=in_meta_files,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -185,12 +209,15 @@ def test_ism_binaural_headrotation(record_property, test_info, in_fmt, out_fmt,
        in_meta_files = None

    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        in_meta_files=in_meta_files,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -203,11 +230,14 @@ def test_ism_binaural_headrotation(record_property, test_info, in_fmt, out_fmt,
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_masa(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt],
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -220,11 +250,14 @@ def test_masa_binaural_static(record_property, test_info, in_fmt, out_fmt, frame
        pytest.skip("Skipping binaural room outputs for MASA as unimplemented.")

    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt],
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -238,12 +271,15 @@ def test_masa_binaural_headrotation(record_property, test_info, in_fmt, out_fmt,
        pytest.skip("Skipping binaural room outputs for MASA as unimplemented.")

    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt],
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -251,10 +287,13 @@ def test_masa_binaural_headrotation(record_property, test_info, in_fmt, out_fmt,
@pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST_MASA_PREREND)
def test_masa_prerend(record_property, test_info, in_fmt, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        "META",
        "MASA2",
        metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"),
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -267,10 +306,13 @@ def test_masa_prerend(record_property, test_info, in_fmt, get_mld, get_mld_lim):
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_custom_ls_input(record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
        out_fmt,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -279,9 +321,12 @@ def test_custom_ls_input(record_property, test_info, in_layout, out_fmt, frame_s
@pytest.mark.parametrize("in_fmt", OUTPUT_FORMATS)
def test_custom_ls_output(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"),
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -290,9 +335,12 @@ def test_custom_ls_output(record_property, test_info, in_fmt, out_fmt, get_mld,
@pytest.mark.parametrize("in_fmt", CUSTOM_LS_TO_TEST)
def test_custom_ls_input_output(record_property, test_info, in_fmt, out_fmt, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_fmt}.txt"),
        CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"),
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -302,10 +350,13 @@ def test_custom_ls_input_output(record_property, test_info, in_fmt, out_fmt, get
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_custom_ls_input_binaural(record_property, test_info, in_layout, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
        out_fmt,
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -318,11 +369,14 @@ def test_custom_ls_input_binaural_headrotation(
    record_property, test_info, in_layout, out_fmt, trj_file, frame_size, get_mld, get_mld_lim
):
    run_renderer(
        record_property,    
        test_info,
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -335,11 +389,14 @@ def test_custom_ls_input_binaural_headrotation(
@pytest.mark.parametrize("frame_size", FRAMING_TO_TEST)
def test_metadata(record_property, test_info, in_fmt, out_fmt, frame_size, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        "META",
        out_fmt,
        metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"),
        frame_size=frame_size,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -352,10 +409,13 @@ def test_metadata(record_property, test_info, in_fmt, out_fmt, frame_size, get_m
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"])
def test_non_diegetic_pan_static(record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        non_diegetic_pan=non_diegetic_pan,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


@@ -365,10 +425,13 @@ def test_non_diegetic_pan_static(record_property, test_info, in_fmt, out_fmt, no
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"])
def test_non_diegetic_pan_ism_static(record_property, test_info, in_fmt, out_fmt, non_diegetic_pan, get_mld, get_mld_lim):
    run_renderer(
        record_property,    
        test_info,
        in_fmt,
        out_fmt,
        non_diegetic_pan=non_diegetic_pan,
        get_mld=get_mld, 
        mld_lim=get_mld_lim,        
    )


+0 −1
Original line number Diff line number Diff line
@@ -237,7 +237,6 @@ def run_renderer(
            record_property("MLD",mld)
            if output_differs:
                pytest.fail(f"Output differs: ({reason})")
        )
        else:
            try:
                ref, ref_fs = readfile(out_file_ref)