Commit 45a39769 authored by BOHMRR's avatar BOHMRR
Browse files

adjustments to new tests folder + renaming of spar_foa to sba

parent b7b4067b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ self-test-on-merge-request:

    ### run SBA pytest
    - exit_code=0
    - python3 ./scripts/ivas_pytests/self_test_b.py --encref IVAS_cod_ref --decref IVAS_dec_ref --encdut IVAS_cod_test --decdut IVAS_dec_test || exit_code=$?
    - python3 ./tests/self_test_b.py --encref IVAS_cod_ref --decref IVAS_dec_ref --encdut IVAS_cod_test --decdut IVAS_dec_test || exit_code=$?
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - zero_errors=$(cat report-junit.xml | grep -c 'testsuite errors="0"') || true
    - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
+9 −9
Original line number Diff line number Diff line
@@ -130,9 +130,9 @@ def dut_encoder_path(request) -> Path:
    system = platform.system()

    if system == "Windows":
        path = here.joinpath("../../IVAS_cod.exe")
        path = here.joinpath("../IVAS_cod.exe")
    elif system in ["Darwin", "Linux"]:
        path = here.joinpath("../../IVAS_cod")
        path = here.joinpath("../IVAS_cod")
    else:
        raise ValueError(f'Wrong system "{system}"!')

@@ -242,9 +242,9 @@ def ref_encoder_path(request) -> Path:
    system = platform.system()

    if system == "Windows":
        path = here.joinpath("../../IVAS_cod.exe")
        path = here.joinpath("../IVAS_cod.exe")
    elif system in ["Darwin", "Linux"]:
        path = here.joinpath("../../IVAS_cod")
        path = here.joinpath("../IVAS_cod")
    else:
        raise ValueError(f'Wrong system "{system}"!')

@@ -264,9 +264,9 @@ def dut_decoder_path(request) -> Path:
    system = platform.system()

    if system == "Windows":
        path = here.joinpath("../../IVAS_dec.exe")
        path = here.joinpath("../IVAS_dec.exe")
    elif system in ["Darwin", "Linux"]:
        path = here.joinpath("../../IVAS_dec")
        path = here.joinpath("../IVAS_dec")
    else:
        raise ValueError(f'Wrong system "{system}"!')

@@ -360,9 +360,9 @@ def ref_decoder_path(request) -> Path:
    system = platform.system()

    if system == "Windows":
        path = here.joinpath("../../IVAS_dec.exe")
        path = here.joinpath("../IVAS_dec.exe")
    elif system in ["Darwin", "Linux"]:
        path = here.joinpath("../../IVAS_dec")
        path = here.joinpath("../IVAS_dec")
    else:
        raise ValueError(f'Wrong system "{system}"!')

@@ -380,7 +380,7 @@ def data_system_tests_path(request) -> Path:

    here = Path(__file__).parent.resolve()

    path = here.joinpath("testv")
    path = here.joinpath("../scripts/testv")

    path = str(path.resolve())

+10 −10
Original line number Diff line number Diff line
@@ -45,17 +45,17 @@ import subprocess
import platform
from pathlib import Path

sys.path.append('scripts/ivas_pytests/tests/')
sys.path.append('tests/')
from cut_pcm import cut_samples

BIN_EXT = ".exe" if platform.system() == "Windows" else ""
HERE = Path(__file__).parent.resolve()
DEFAULT_ENCODER_DUT = str(HERE.joinpath(f"../../IVAS_cod{BIN_EXT}").resolve())
DEFAULT_DECODER_DUT = str(HERE.joinpath(f"../../IVAS_dec{BIN_EXT}").resolve())
DEFAULT_ENCODER_REF = str(HERE.joinpath(f"../../IVAS_cod_ref{BIN_EXT}").resolve())
DEFAULT_DECODER_REF = str(HERE.joinpath(f"../../IVAS_dec_ref{BIN_EXT}").resolve())
CREND_UNITTEST_REF = str(HERE.joinpath(f"tests/unit_tests/crend/IVAS_crend_unit_test_ref{BIN_EXT}").resolve())
TEST_VECTOR_DIR = str(HERE.joinpath("../testv").resolve())
DEFAULT_ENCODER_DUT = str(HERE.joinpath(f"../IVAS_cod{BIN_EXT}").resolve())
DEFAULT_DECODER_DUT = str(HERE.joinpath(f"../IVAS_dec{BIN_EXT}").resolve())
DEFAULT_ENCODER_REF = str(HERE.joinpath(f"../IVAS_cod_ref{BIN_EXT}").resolve())
DEFAULT_DECODER_REF = str(HERE.joinpath(f"../IVAS_dec_ref{BIN_EXT}").resolve())
CREND_UNITTEST_REF = str(HERE.joinpath(f"../scripts/ivas_pytests/tests/unit_tests/crend/IVAS_crend_unit_test_ref{BIN_EXT}").resolve())
TEST_VECTOR_DIR = str(HERE.joinpath("../scripts/testv").resolve())
REFERENCE_DIR = str(HERE.joinpath("ref").resolve())
DUT_BASE_DIR = str(HERE.joinpath("dut").resolve())

@@ -105,7 +105,7 @@ def build_dut_binaries():
    Build the DUT binaries.
    """
    print("Building the DUT binaries")
    dut_src_dir = str(HERE.joinpath("../..").resolve())
    dut_src_dir = str(HERE.joinpath("..").resolve())
    build_enc_and_dec(dut_src_dir)
    build_crend_unittest(dut_src_dir)

@@ -202,7 +202,7 @@ def main(argv):
        else:
            base_cmd = ["python3", "-m", "pytest"]
        base_cmd += [
            "scripts/ivas_pytests/tests",
            "tests",
            "-n",
            args.numprocesses,
            "--update_ref",
@@ -246,7 +246,7 @@ def main(argv):
    else:
        cmd = ["python3", "-m", "pytest"]
    cmd += [
        "scripts/ivas_pytests/tests",
        "tests",
        "-n",
        args.numprocesses,
        "-v",
+9 −11
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@ import shutil
import errno
import sys

sys.path.append('scripts/ivas_pytests/')
sys.path.append('scripts/ivas_pytests/tests/')
from il2mm import il2mm
from cmp_custom import cmp_custom 
from conftest import EncoderFrontend, DecoderFrontend
@@ -62,10 +60,10 @@ def check_and_makedir(dir_path):


# assumption:
# - the needed reference bitstreams are created by test_spar_foa_enc_system
# - the needed reference bitstreams are created by test_sba_enc_system
# -> reference bitstreams are not any longer created as part of this test
# -> the parameters of this test (except additional parameter plc_pattern) need to be a subset of the parameters in test_spar_foa_enc_system
# -> the reference generation for this test (reference decoder output) needs to be done after completion of test_spar_foa_enc_system
# -> the parameters of this test (except additional parameter plc_pattern) need to be a subset of the parameters in test_sba_enc_system
# -> the reference generation for this test (reference decoder output) needs to be done after completion of test_sba_enc_system
#    -> therefore the marker create_ref_part2
@pytest.mark.create_ref_part2
@pytest.mark.parametrize("ivas_br", ivas_br_list)
@@ -74,7 +72,7 @@ def check_and_makedir(dir_path):
@pytest.mark.parametrize("plc_pattern", plc_patterns)
@pytest.mark.parametrize("fs", sampling_rate_list)
@pytest.mark.parametrize("agc", agc_list)
def test_spar_foa_plc_system(
def test_sba_plc_system(
    dut_decoder_frontend: DecoderFrontend,
    data_system_tests_path,
    reference_path,
@@ -91,12 +89,12 @@ def test_spar_foa_plc_system(
    tag = tag + fs + 'c'

    #dec
    spar_foa_dec_plc(dut_decoder_frontend, data_system_tests_path, reference_path, dut_base_path, ref_decoder_path, tag, ch_count_foa, fs, ivas_br, dtx, plc_pattern, update_ref, agc)
    sba_dec_plc(dut_decoder_frontend, data_system_tests_path, reference_path, dut_base_path, ref_decoder_path, tag, ch_count_foa, fs, ivas_br, dtx, plc_pattern, update_ref, agc)


#########################################################
############ test function ##############################
def spar_foa_dec_plc(
def sba_dec_plc(
    decoder_frontend,
    test_vector_path,
    reference_path,
@@ -119,14 +117,14 @@ def spar_foa_dec_plc(
        tag_out += '_AGC1'
    plc_tag_out = f"{tag_out}_{plc_pattern}"

    dut_out_dir = f"{dut_base_path}/spar_foa_bs/raw/{plc_tag_out}"
    ref_out_dir = f"{reference_path}/spar_foa_bs/raw/{plc_tag_out}"
    dut_out_dir = f"{dut_base_path}/sba_bs/raw/{plc_tag_out}"
    ref_out_dir = f"{reference_path}/sba_bs/raw/{plc_tag_out}"

    check_and_makedir(dut_out_dir)
    check_and_makedir(ref_out_dir)

    plc_file = f"{test_vector_path}/{plc_pattern}.g192"
    ref_in_pkt = f"{reference_path}/spar_foa_bs/pkt/{tag_out}.pkt"
    ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}.pkt"

    if ref_decoder_path:
        ref_decoder = DecoderFrontend(ref_decoder_path, "REF")
+20 −22
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ import errno
import shutil
import sys

sys.path.append('scripts/ivas_pytests/')
sys.path.append('scripts/ivas_pytests/tests/')
from il2mm import il2mm
from cmp_custom import cmp_custom
from cut_pcm import cut_samples
@@ -108,7 +106,7 @@ def test_bypass_enc(
    output_config = "FOA"

    # enc
    spar_foa_enc(
    sba_enc(
        dut_encoder_frontend,
        data_system_tests_path,
        ref_encoder_path,
@@ -126,7 +124,7 @@ def test_bypass_enc(
    )

    # dec
    spar_foa_dec(
    sba_dec(
        dut_decoder_frontend,
        ref_decoder_path,
        reference_path,
@@ -150,7 +148,7 @@ def test_bypass_enc(
@pytest.mark.parametrize("tag", tag_list)
@pytest.mark.parametrize("fs", sample_rate_list)
@pytest.mark.parametrize("agc", agc_list)
def test_spar_foa_enc_system(
def test_sba_enc_system(
    dut_encoder_frontend: EncoderFrontend,
    dut_decoder_frontend: DecoderFrontend,
    data_system_tests_path,
@@ -176,7 +174,7 @@ def test_spar_foa_enc_system(
        cut_gain = "1.0"

    # enc
    spar_foa_enc(
    sba_enc(
        dut_encoder_frontend,
        data_system_tests_path,
        ref_encoder_path,
@@ -195,7 +193,7 @@ def test_spar_foa_enc_system(
    )

    # dec
    spar_foa_dec(
    sba_dec(
        dut_decoder_frontend,
        ref_decoder_path,
        reference_path,
@@ -238,7 +236,7 @@ def test_spar_hoa2_enc_system(
    output_config = "HOA2"

    # enc
    spar_foa_enc(
    sba_enc(
        dut_encoder_frontend,
        data_system_tests_path,
        ref_encoder_path,
@@ -257,7 +255,7 @@ def test_spar_hoa2_enc_system(
    )

    # dec
    spar_foa_dec(
    sba_dec(
        dut_decoder_frontend,
        ref_decoder_path,
        reference_path,
@@ -300,7 +298,7 @@ def test_spar_hoa3_enc_system(
    output_config = "HOA3"

    # enc
    spar_foa_enc(
    sba_enc(
        dut_encoder_frontend,
        data_system_tests_path,
        ref_encoder_path,
@@ -319,7 +317,7 @@ def test_spar_hoa3_enc_system(
    )

    # dec
    spar_foa_dec(
    sba_dec(
        dut_decoder_frontend,
        ref_decoder_path,
        reference_path,
@@ -341,7 +339,7 @@ def test_spar_hoa3_enc_system(
@pytest.mark.parametrize("dtx", dtx_set)
@pytest.mark.parametrize("tag", tag_list_bw_force)
@pytest.mark.parametrize("sample_rate_bw_idx", sample_rate_bw_idx_list)
def test_spar_foa_enc_BWforce_system(
def test_sba_enc_BWforce_system(
    dut_encoder_frontend: EncoderFrontend,
    dut_decoder_frontend: DecoderFrontend,
    data_system_tests_path,
@@ -364,7 +362,7 @@ def test_spar_foa_enc_BWforce_system(
    output_config = "FOA"

    # enc
    spar_foa_enc(
    sba_enc(
        dut_encoder_frontend,
        data_system_tests_path,
        ref_encoder_path,
@@ -382,7 +380,7 @@ def test_spar_foa_enc_BWforce_system(
    )

    # dec
    spar_foa_dec(
    sba_dec(
        dut_decoder_frontend,
        ref_decoder_path,
        reference_path,
@@ -402,7 +400,7 @@ def test_spar_foa_enc_BWforce_system(

#########################################################
############ test function ##############################
def spar_foa_enc(
def sba_enc(
    encoder_frontend,
    test_vector_path,
    ref_encoder_path,
@@ -422,8 +420,8 @@ def spar_foa_enc(
):

    #########  run cmd   #####################################
    dut_out_dir = f"{dut_base_path}/spar_foa_bs/pkt"
    ref_out_dir = f"{reference_path}/spar_foa_bs/pkt"
    dut_out_dir = f"{dut_base_path}/sba_bs/pkt"
    ref_out_dir = f"{reference_path}/sba_bs/pkt"

    check_and_makedir(dut_out_dir)
    check_and_makedir(ref_out_dir)
@@ -496,7 +494,7 @@ def spar_foa_enc(
        )


def spar_foa_dec(
def sba_dec(
    decoder_frontend,
    ref_decoder_path,
    reference_path,
@@ -533,11 +531,11 @@ def spar_foa_dec(
    # to avoid conflicting names in case of parallel test execution, differentiate all cases
    long_tag_ext = f"_AGC{agc}_pca{bypass}"

    dut_out_dir = f"{dut_base_path}/spar_foa_bs/raw/{tag_out}{long_tag_ext}"
    ref_out_dir = f"{reference_path}/spar_foa_bs/raw/{tag_out}{short_tag_ext}"
    dut_out_dir = f"{dut_base_path}/sba_bs/raw/{tag_out}{long_tag_ext}"
    ref_out_dir = f"{reference_path}/sba_bs/raw/{tag_out}{short_tag_ext}"

    dut_in_pkt = f"{dut_base_path}/spar_foa_bs/pkt/{tag_out}{long_tag_ext}.pkt"
    ref_in_pkt = f"{reference_path}/spar_foa_bs/pkt/{tag_out}{short_tag_ext}.pkt"
    dut_in_pkt = f"{dut_base_path}/sba_bs/pkt/{tag_out}{long_tag_ext}.pkt"
    ref_in_pkt = f"{reference_path}/sba_bs/pkt/{tag_out}{short_tag_ext}.pkt"

    check_and_makedir(dut_out_dir)
    check_and_makedir(ref_out_dir)