support/testing: add opus-tools runtime test

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Julien Olivain
2025-12-18 22:46:35 +01:00
committed by Thomas Petazzoni
parent 4fd7a468af
commit 7f1c2b9d69
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
from tests.package.test_audio_codec_base import TestAudioCodecBase
class TestOpusTools(TestAudioCodecBase):
__test__ = True
config = TestAudioCodecBase.config + \
"""
BR2_PACKAGE_OPUS_TOOLS=y
"""
encoded_file = "encoded.opus"
def encode_test(self, input_filename):
cmd = f"opusenc {input_filename} {self.encoded_file}"
self.assertRunOk(cmd)
def decode_test(self, output_filename):
cmd = f"opusdec {self.encoded_file} {output_filename}"
self.assertRunOk(cmd)