Commit cef43e80 authored by Jan Kiene's avatar Jan Kiene
Browse files

cleanup and remove duplicate cmld arg

parent 0242d399
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ Execute tests specified via a parameter file.
import errno
import filecmp
import os
import json
import platform
from pathlib import Path
from subprocess import run
@@ -48,7 +47,11 @@ from tests.cmp_pcm import cmp_pcm
from tests.cmp_stats_files import cmp_stats_files
from tests.conftest import DecoderFrontend, EncoderFrontend, parse_properties
from tests.testconfig import PARAM_FILE
from tests.constants import ENC_AUX_FILES, MAX_ENC_DIFF_PATTERN, MIN_ENC_FILE_LENGTH_DIFF, MIN_ENC_STATS_DIFF
from tests.constants import (
    MAX_ENC_DIFF_PATTERN,
    MIN_ENC_FILE_LENGTH_DIFF,
    MIN_ENC_STATS_DIFF,
)

import pdb

@@ -135,7 +138,6 @@ def convert_test_string_to_tag(test_string):
    return tag_str



@pytest.mark.create_ref
@pytest.mark.parametrize("test_tag", list(param_file_test_dict.keys()))
# hack to have stv/ltv/evs in the test name
@@ -167,7 +169,6 @@ def test_param_file_tests(

    tag_str = convert_test_string_to_tag(test_tag)


    # evaluate encoder options
    enc_split = enc_opts.split()
    assert len(enc_split) >= 4
@@ -222,7 +223,12 @@ def test_param_file_tests(
            dut_stats_file = f"{dut_base_path}/param_file/enc/{stats_file}"

            # compare ref and dut .stats files
            enc_test_result, enc_test_result_msg = cmp_stats_files(ref_stats_file, dut_stats_file, min_enc_file_length_diff = MIN_ENC_FILE_LENGTH_DIFF, min_enc_stats_diff = MIN_ENC_STATS_DIFF)
            enc_test_result, enc_test_result_msg = cmp_stats_files(
                ref_stats_file,
                dut_stats_file,
                min_enc_file_length_diff=MIN_ENC_FILE_LENGTH_DIFF,
                min_enc_stats_diff=MIN_ENC_STATS_DIFF,
            )

            if enc_test_result:
                # find the maximum number of differences in the test result message
+2 −8
Original line number Diff line number Diff line
@@ -230,13 +230,6 @@ def pytest_addoption(parser):
        default=0,
    )

    parser.addoption(
        "--get_enc_stats",
        help="Generate .stats file containing statistics about encoder parameters",
        action="store_true",
        default=False,
    )


@pytest.fixture(scope="session", autouse=True)
def update_ref(request):
@@ -287,7 +280,8 @@ def get_enc_stats(request) -> bool:
    """
    Return value of cmdl param --get_enc_stats
    """
    return request.config.getoption("--get_enc_stats")
    return request.config.getoption("--enc_stats")


@pytest.fixture(scope="session")
def abs_tol(request) -> int:
+6 −2
Original line number Diff line number Diff line
@@ -11,8 +11,12 @@ MAX_DIFF_PATTERN = r"MAXIMUM ABS DIFF: (\d*)"
SSNR_PATTERN = r"Channel \d* SSNR: (nan|[+-]*inf|[\d\.]*)"
MAX_ENC_DIFF_PATTERN = r"MAXIMUM ENC DIFF: (\d+) \((\d+\.\d+)%\)"

MIN_ENC_FILE_LENGTH_DIFF = 0.1  # minimum difference between ref and dut encoder file lengths
MIN_ENC_STATS_DIFF =  0.1  # minimum difference between the statistics of ref and dut encoder files
MIN_ENC_FILE_LENGTH_DIFF = (
    0.1  # minimum difference between ref and dut encoder file lengths
)
MIN_ENC_STATS_DIFF = (
    0.1  # minimum difference between the statistics of ref and dut encoder files
)

# list of encoder filename patterns with their data type and number of samples per frame
# note: instead of specifying the number of samples per frame, you can use a formula incl. 'fs', e.g. 'fs/50'