Loading dec_header.txt +3 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ CUT_PATH="./TMP_DEC" rm -rf $CUT_PATH mkdir -p $CUT_PATH mkdir -p $CUT_PATH/ref/masa_test/dec_output mkdir -p $CUT_PATH/ref/param_file/dec mkdir -p $CUT_PATH/ref/sba_bs/raw mkdir -p $CUT_PATH/dut/masa_test/dec_output mkdir -p $CUT_PATH/dut/param_file/dec mkdir -p $CUT_PATH/dut/sba_bs/raw enc_header.txt +3 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ CUT_PATH="./TMP_ENC" rm -rf $CUT_PATH mkdir -p $CUT_PATH mkdir -p $CUT_PATH/ref/masa_test/bitstreams mkdir -p $CUT_PATH/ref/param_file/enc mkdir -p $CUT_PATH/ref/sba_bs/pkt mkdir -p $CUT_PATH/dut/masa_test/bitstreams mkdir -p $CUT_PATH/dut/param_file/enc mkdir -p $CUT_PATH/dut/sba_bs/pkt rend_header.txt +1 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,6 @@ REF_PATH="./tests" CUT_PATH="./TMP_REND" rm -rf $CUT_PATH mkdir -p $CUT_PATH/renderer/ref mkdir -p $CUT_PATH/renderer/cut tests/test_26252.py 0 → 100644 +128 −0 Original line number Diff line number Diff line __copyright__ = """ (C) 2022-2023 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__ = """ Execute tests specified via a parameter file. """ import os from pathlib import Path import filecmp import subprocess import pytest def replace_paths(instr, testv_path, ref_path, cut_path): outstr = instr tmp = testv_path.split('=') if len(tmp)>1: outstr = instr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) tmp = ref_path.split('=') if len(tmp)>1: outstr = outstr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) tmp = cut_path.split('=') if len(tmp)>1: outstr = outstr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) return outstr test_dict = {} TEST_DIR = "." scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt"] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: tag = "" enc_opts = "" dec_opts = "" diff_opts = "" rend_opts = "" testv_path = "" ref_path = "" cut_path = "" preproc = [] for line in fp.readlines(): if line.startswith("rm") or line.startswith("mkdir"): preproc.append(line.strip()) if line.startswith("TESTV_PATH"): testv_path = line if line.startswith("REF_PATH"): ref_path = line if line.startswith("CUT_PATH"): cut_path = line if line.startswith("$CUT_ENC_BIN"): enc_opts = line if line.startswith("$CUT_DEC_BIN"): dec_opts = line if line.startswith("$CUT_REND_BIN"): rend_opts = line if line.startswith("$DIFF_BIN"): diff_opts = line[9:] tag = s + "--" + diff_opts.split()[1].split('/')[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") continue test_dict[tag] = (enc_opts, dec_opts, rend_opts, diff_opts, testv_path, ref_path, cut_path) tag = "" enc_opts = "" dec_opts = "" rend_opts = "" diff_opts = "" for proc in preproc: proc = replace_paths(proc, testv_path, ref_path, cut_path) subprocess.run(proc.split()) @pytest.mark.parametrize("test_tag", list(test_dict.keys())) def test_26252(test_tag): enc_opts, dec_opts, rend_opts, diff_opts, testv_path, ref_path, cut_path = test_dict[test_tag] if enc_opts: enc_opts = replace_paths(enc_opts, testv_path, ref_path, cut_path) subprocess.run(["./IVAS_cod","-q"] + enc_opts.split()[1:]) if dec_opts: dec_opts = replace_paths(dec_opts, testv_path, ref_path, cut_path) subprocess.run(["./IVAS_dec","-q"] + dec_opts.split()[1:]) if rend_opts: rend_opts = replace_paths(rend_opts, testv_path, ref_path, cut_path) subprocess.run(["./IVAS_rend","-q"] + rend_opts.split()[1:]) diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) if ';' in diff_opts: cmd1, cmd2 = diff_opts.split(';') cmd1 = cmd1.split() cmd2 = cmd2.split() result1 = filecmp.cmp(cmd1[0], cmd1[1]) result2 = filecmp.cmp(cmd2[2], cmd2[3]) else: cmd1 = diff_opts.split() result1 = filecmp.cmp(cmd1[0], cmd1[1]) result2 = True if not (result1 and result2): assert False, "Output differs" Loading
dec_header.txt +3 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ CUT_PATH="./TMP_DEC" rm -rf $CUT_PATH mkdir -p $CUT_PATH mkdir -p $CUT_PATH/ref/masa_test/dec_output mkdir -p $CUT_PATH/ref/param_file/dec mkdir -p $CUT_PATH/ref/sba_bs/raw mkdir -p $CUT_PATH/dut/masa_test/dec_output mkdir -p $CUT_PATH/dut/param_file/dec mkdir -p $CUT_PATH/dut/sba_bs/raw
enc_header.txt +3 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ CUT_PATH="./TMP_ENC" rm -rf $CUT_PATH mkdir -p $CUT_PATH mkdir -p $CUT_PATH/ref/masa_test/bitstreams mkdir -p $CUT_PATH/ref/param_file/enc mkdir -p $CUT_PATH/ref/sba_bs/pkt mkdir -p $CUT_PATH/dut/masa_test/bitstreams mkdir -p $CUT_PATH/dut/param_file/enc mkdir -p $CUT_PATH/dut/sba_bs/pkt
rend_header.txt +1 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,6 @@ REF_PATH="./tests" CUT_PATH="./TMP_REND" rm -rf $CUT_PATH mkdir -p $CUT_PATH/renderer/ref mkdir -p $CUT_PATH/renderer/cut
tests/test_26252.py 0 → 100644 +128 −0 Original line number Diff line number Diff line __copyright__ = """ (C) 2022-2023 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__ = """ Execute tests specified via a parameter file. """ import os from pathlib import Path import filecmp import subprocess import pytest def replace_paths(instr, testv_path, ref_path, cut_path): outstr = instr tmp = testv_path.split('=') if len(tmp)>1: outstr = instr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) tmp = ref_path.split('=') if len(tmp)>1: outstr = outstr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) tmp = cut_path.split('=') if len(tmp)>1: outstr = outstr.replace("$"+tmp[0], tmp[1].replace("\"","").strip()) return outstr test_dict = {} TEST_DIR = "." scripts=["Readme_IVAS_enc.txt", "Readme_IVAS_dec.txt", "Readme_IVAS_rend.txt"] for s in scripts: with open(os.path.join(TEST_DIR, s), "r", encoding="UTF-8") as fp: tag = "" enc_opts = "" dec_opts = "" diff_opts = "" rend_opts = "" testv_path = "" ref_path = "" cut_path = "" preproc = [] for line in fp.readlines(): if line.startswith("rm") or line.startswith("mkdir"): preproc.append(line.strip()) if line.startswith("TESTV_PATH"): testv_path = line if line.startswith("REF_PATH"): ref_path = line if line.startswith("CUT_PATH"): cut_path = line if line.startswith("$CUT_ENC_BIN"): enc_opts = line if line.startswith("$CUT_DEC_BIN"): dec_opts = line if line.startswith("$CUT_REND_BIN"): rend_opts = line if line.startswith("$DIFF_BIN"): diff_opts = line[9:] tag = s + "--" + diff_opts.split()[1].split('/')[-1] if tag in test_dict: print("non-unique tag found - ignoring new entry") continue test_dict[tag] = (enc_opts, dec_opts, rend_opts, diff_opts, testv_path, ref_path, cut_path) tag = "" enc_opts = "" dec_opts = "" rend_opts = "" diff_opts = "" for proc in preproc: proc = replace_paths(proc, testv_path, ref_path, cut_path) subprocess.run(proc.split()) @pytest.mark.parametrize("test_tag", list(test_dict.keys())) def test_26252(test_tag): enc_opts, dec_opts, rend_opts, diff_opts, testv_path, ref_path, cut_path = test_dict[test_tag] if enc_opts: enc_opts = replace_paths(enc_opts, testv_path, ref_path, cut_path) subprocess.run(["./IVAS_cod","-q"] + enc_opts.split()[1:]) if dec_opts: dec_opts = replace_paths(dec_opts, testv_path, ref_path, cut_path) subprocess.run(["./IVAS_dec","-q"] + dec_opts.split()[1:]) if rend_opts: rend_opts = replace_paths(rend_opts, testv_path, ref_path, cut_path) subprocess.run(["./IVAS_rend","-q"] + rend_opts.split()[1:]) diff_opts = replace_paths(diff_opts, testv_path, ref_path, cut_path) if ';' in diff_opts: cmd1, cmd2 = diff_opts.split(';') cmd1 = cmd1.split() cmd2 = cmd2.split() result1 = filecmp.cmp(cmd1[0], cmd1[1]) result2 = filecmp.cmp(cmd2[2], cmd2[3]) else: cmd1 = diff_opts.split() result1 = filecmp.cmp(cmd1[0], cmd1[1]) result2 = True if not (result1 and result2): assert False, "Output differs"