Commit e70e8f0d authored by BOHMRR's avatar BOHMRR
Browse files

pytest: added option --param_file to specify .prm file

parent c229a8a0
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ from subprocess import run
import textwrap
from typing import Optional
import os

import testconfig
import pytest

logger = logging.getLogger(__name__)
@@ -114,6 +114,12 @@ def pytest_addoption(parser):
        help="If specified, use given directory as base data directory for dut files.",
    )

    parser.addoption(
        "--param_file",
        action="store",
        help="If specified, use given param file in test_param_file.",
    )


@pytest.fixture(scope="session", autouse=True)
def update_ref(request):
@@ -332,7 +338,7 @@ class DecoderFrontend:

        # add mandatory parameters
        # output_config is mandatory for IVAS; EVS does not have this parameter, indicated by ""
        if output_config is not "":
        if output_config != "":
            command += [output_config]
        command += [
            str(output_sampling_rate),
@@ -473,3 +479,5 @@ def pytest_configure(config):
    config.addinivalue_line(
        "markers", "create_ref_part2: reference creation test that depends on create_ref references"
    )
    if config.option.param_file:
        testconfig.PARAM_FILE = config.option.param_file
+2 −2
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ import errno
import pytest
from cmp_custom import cmp_custom
from conftest import EncoderFrontend, DecoderFrontend
from testconfig import PARAM_FILE

PARAM_FILE = "scripts/config/self_test.prm"

param_file_test_dict = {}
with open(PARAM_FILE, "r", encoding="UTF-8") as fp:
@@ -179,7 +179,7 @@ def test_param_file_tests(

    # the output file is not the real output filename
    # -> construct output filename
    if output_config is not "":
    if output_config != "":
        output_file = f"{testv_base}_{tag_str}.dec.{output_config_name}.pcm"
    else:
        # EVS decoder command lines do not have an output_config: use "MONO" in the output filename

tests/testconfig.py

0 → 100644
+35 −0
Original line number Diff line number Diff line
__license__ = """
(C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository. All Rights Reserved.

This software is protected by copyright law and by international treaties.
The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
contributors to this repository retain full ownership rights in their respective contributions in
the software. This notice grants no license of any kind, including but not limited to patent
license, nor is any license granted by implication, estoppel or otherwise.

Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
contributions.

This software is provided "AS IS", without any express or implied warranties. The software is in the
development stage. It is intended exclusively for experts who have experience with such software and
solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
and fitness for a particular purpose are hereby disclaimed and excluded.

Any dispute, controversy or claim arising under or in relation to providing this software shall be
submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
the United Nations Convention on Contracts on the International Sales of Goods.
"""

__doc__ = """
To configure test modules.
"""

PARAM_FILE = "scripts/config/self_test.prm"