Browse Source

support/testing: add lame runtime test

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Julien Olivain 1 year ago
parent
commit
73e8652b57
2 changed files with 21 additions and 0 deletions
  1. 1 0
      DEVELOPERS
  2. 20 0
      support/testing/tests/package/test_lame.py

+ 1 - 0
DEVELOPERS

@@ -1897,6 +1897,7 @@ F:	support/testing/tests/package/test_kmod.py
 F:	support/testing/tests/package/test_kmod/
 F:	support/testing/tests/package/test_kmscube.py
 F:	support/testing/tests/package/test_kmscube/
+F:	support/testing/tests/package/test_lame.py
 F:	support/testing/tests/package/test_less.py
 F:	support/testing/tests/package/test_libcamera.py
 F:	support/testing/tests/package/test_libcamera/

+ 20 - 0
support/testing/tests/package/test_lame.py

@@ -0,0 +1,20 @@
+from tests.package.test_audio_codec_base import TestAudioCodecBase
+
+
+class TestLame(TestAudioCodecBase):
+    __test__ = True
+    config = TestAudioCodecBase.config + \
+        """
+        BR2_PACKAGE_LAME=y
+        """
+    encoded_file = "encoded.mp3"
+
+    def encode_test(self, input_filename):
+        cmd = "lame --quiet"
+        cmd += f" {input_filename} {self.encoded_file}"
+        self.assertRunOk(cmd)
+
+    def decode_test(self, output_filename):
+        cmd = "lame --quiet --decode"
+        cmd += f" {self.encoded_file} {output_filename}"
+        self.assertRunOk(cmd)