From 0bb1063b5443a0def920ccbb0e48671bd987ba1b Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Thu, 8 Aug 2024 23:06:03 +0200 Subject: [PATCH] support/testing: add flac runtime test Signed-off-by: Julien Olivain Signed-off-by: Thomas Petazzoni (cherry picked from commit 8e76564b0e745b5fc77f35c1bb7e8c8099822842) Signed-off-by: Thomas Perale --- DEVELOPERS | 1 + support/testing/tests/package/test_flac.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 support/testing/tests/package/test_flac.py diff --git a/DEVELOPERS b/DEVELOPERS index 1adf9c93dd..82dcc729ff 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1860,6 +1860,7 @@ F: support/testing/tests/package/test_exfatprogs.py F: support/testing/tests/package/test_exfatprogs/ F: support/testing/tests/package/test_file.py F: support/testing/tests/package/test_file/ +F: support/testing/tests/package/test_flac.py F: support/testing/tests/package/test_fluidsynth.py F: support/testing/tests/package/test_fluidsynth/ F: support/testing/tests/package/test_fping.py diff --git a/support/testing/tests/package/test_flac.py b/support/testing/tests/package/test_flac.py new file mode 100644 index 0000000000..9ee7bc1c0d --- /dev/null +++ b/support/testing/tests/package/test_flac.py @@ -0,0 +1,20 @@ +from tests.package.test_audio_codec_base import TestAudioCodecBase + + +class TestFlac(TestAudioCodecBase): + __test__ = True + config = TestAudioCodecBase.config + \ + """ + BR2_PACKAGE_FLAC=y + """ + encoded_file = "encoded.flac" + + def encode_test(self, input_filename): + cmd = "flac" + cmd += f" -o {self.encoded_file} {input_filename}" + self.assertRunOk(cmd) + + def decode_test(self, output_filename): + cmd = "flac -d" + cmd += f" -o {output_filename} {self.encoded_file}" + self.assertRunOk(cmd)