Skip to contentSkip to conversation

libsamplerate0: Adding ptest for libsamplerate0

PATCH Superseded Shaik Moin 2 participants 2 messages Feb 24 – Feb 25

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Shaik Moin

author
#0 lore raw

PATCH 1/1 libsamplerate0: Adding ptest for libsamplerate0

Executables Description:
callback_hang_test - Verifies that callback-based processing does not hang and that the library properly returns control without deadlocks.
callback_test - Tests the callback-driven processing mode of libsamplerate (SRC's non-blocking interface).
clone_test - Ensures the SRC state objects can be cloned correctly and continue producing identical output.
downsample_test - Tests accuracy and behavior when downsampling audio (reducing sample rate).
float_short_test - Tests conversions between float and short integer sample formats.
misc_test - Runs assorted sanity and utility tests that don't fit into other categories.
multi_channel_test - Verifies correct handling of multi-channel audio (e.g., stereo, 5.1) during sample-rate conversion.
multichan_throughput_test - Measures throughput and performance for multi-channel SRC processing.
nullptr_test - Ensures libsamplerate properly rejects or handles NULL pointers and invalid state.
reset_test - Tests the reset() behavior - state clearing, flushing buffers, resetting filters.
simple_test - The most basic test of sample-rate conversion functionality - often converting a small buffer to ensure fundamental correctness.
snr_bw_test - Measures Signal - Noise Ratio (SNR) and bandwidth performance for different converter algorithms.
src-evaluate - Evaluates internal SRC filter performance, quality, and algorithmic behavior.
termination_test - Ensures end - stream / termination behavior is handled correctly without artifacts or crashes.
throughput_test - Benchmarks throughput for mono or simple use cases to measure raw processing speed.
varispeed_test - Tests variable sample-rate operation (changing SRC ratio on the fly).

Time taken to execute the ptest:- Approx ~3 mins

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../libsamplerate/files/run-ptest             | 51 +++++++++++++++++++
 .../libsamplerate/libsamplerate0_0.2.2.bb     | 34 ++++++++++++-
 3 files changed, 85 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-multimedia/libsamplerate/files/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 80414f1cb8..922c341b30 100644
@@ -122,6 +122,7 @@ PTESTS_SLOW = "\
     libmodule-build-perl \
     libpng \
     ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'libseccomp', '',d)} \
+    libsamplerate0 \
     lttng-tools \
     lz4 \
     openssh \
meta/recipes-multimedia/libsamplerate/files/run-ptest new file +51 -0

51 lines not on this page · raw message

meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb +33 -1
index 819096878b..8a0fe4e108 100644
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=336d6faf40fb600bafb0061f4052f1f4 \
 DEPENDS = "libsndfile1"
 
 SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/libsamplerate-${PV}.tar.xz \
+           file://run-ptest \
 "
 
 SRC_URI[sha256sum] = "3258da280511d24b49d6b08615bbe824d0cacc9842b0e4caf11c52cf2b043893"
@@ -18,9 +19,40 @@ GITHUB_BASE_URI = "https://github.com/libsndfile/libsamplerate/releases"
 
 S = "${UNPACKDIR}/libsamplerate-${PV}"
 
-inherit autotools pkgconfig github-releases
+inherit autotools pkgconfig github-releases ptest
 
 # FFTW and ALSA are only used in tests and examples, so they don't affect
 # normal builds. It should be safe to ignore these, but explicitly disabling
 # them adds some extra certainty that builds are deterministic.
 EXTRA_OECONF = "--disable-fftw --disable-alsa"
+do_compile:append() {
+    oe_runmake buildtest-TESTS
+}
+
+do_install_ptest() {
+    t=${D}${PTEST_PATH}
+
+    #    This lets libtool do any needed relinking and install the right binary.
+    if [ -x "${B}/libtool" ] && [ -d "${B}/tests" ]; then
+        find "${B}/tests" -maxdepth 1 -type f -perm -111 2>/dev/null \
+        | while IFS= read -r wrapper; do
+            bn=$(basename "$wrapper")
+            case "$bn" in
+                *.a|*.la|*.o|*.lo|*.la~) continue ;;
+            esac
+            [ -e "$t/$bn" ] && continue
+            # Install via libtool using the wrapper
+            "${B}/libtool" --mode=install install -c "$wrapper" "$t/$bn"
+        done
+    fi
+
+    #    install them directly.
+    if [ -d "${B}/tests/.libs" ]; then
+        find "${B}/tests/.libs" -maxdepth 1 -type f -perm -111 2>/dev/null \
+        | while IFS= read -r realbin; do
+            bn=$(basename "$realbin")
+            [ -e "$t/$bn" ] && continue
+            install -m 0755 "$realbin" "$t/$bn"
+        done
+    fi
+}
Signature · 1 line
2.34.1
#1 lore raw
Quoted 18 lines · Shaik Moin via lists.openembedded.org

Executables Description:
callback_hang_test - Verifies that callback-based processing does not hang and that the library properly returns control without deadlocks.
callback_test - Tests the callback-driven processing mode of libsamplerate (SRC's non-blocking interface).
clone_test - Ensures the SRC state objects can be cloned correctly and continue producing identical output.
downsample_test - Tests accuracy and behavior when downsampling audio (reducing sample rate).
float_short_test - Tests conversions between float and short integer sample formats.
misc_test - Runs assorted sanity and utility tests that don't fit into other categories.
multi_channel_test - Verifies correct handling of multi-channel audio (e.g., stereo, 5.1) during sample-rate conversion.
multichan_throughput_test - Measures throughput and performance for multi-channel SRC processing.
nullptr_test - Ensures libsamplerate properly rejects or handles NULL pointers and invalid state.
reset_test - Tests the reset() behavior - state clearing, flushing buffers, resetting filters.
simple_test - The most basic test of sample-rate conversion functionality - often converting a small buffer to ensure fundamental correctness.
snr_bw_test - Measures Signal - Noise Ratio (SNR) and bandwidth performance for different converter algorithms.
src-evaluate - Evaluates internal SRC filter performance, quality, and algorithmic behavior.
termination_test - Ensures end - stream / termination behavior is handled correctly without artifacts or crashes.
throughput_test - Benchmarks throughput for mono or simple use cases to measure raw processing speed.
varispeed_test - Tests variable sample-rate operation (changing SRC ratio on the fly).

Quoted 4 lines

Time taken to execute the ptest:- Approx ~3 mins

---

Hi Shaik,

Thanks for your patch.

It looks like something is off with this test. While running on the
autobuilder, no results are found:
WARNING: core-image-ptest-libsamplerate0-1.0-r0 do_testimage: There were failing ptests.
Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/qemux86-64-ptest/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
return func(*args, **kwargs)
File "/srv/pokybuild/yocto-worker/qemux86-64-ptest/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
return func(*args, **kwargs)
File "/srv/pokybuild/yocto-worker/qemux86-64-ptest/build/layers/openembedded-core/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
return func(*args, **kwargs)
File "/srv/pokybuild/yocto-worker/qemux86-64-ptest/build/layers/openembedded-core/meta/lib/oeqa/runtime/cases/ptest.py", line 27, in test_ptestrunner_expectfail

    self.do_ptestrunner()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/srv/pokybuild/yocto-worker/qemux86-64-ptest/build/layers/openembedded-core/meta/lib/oeqa/runtime/cases/ptest.py", line 120, in do_ptestrunner
    self.fail(failmsg)
    ~~~~~~~~~^^^^^^^^^

AssertionError:
ptests which had no test results:
['libsamplerate0']

https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/1124
https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/3112
https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/3153

Test results can be seen here:

https://valkyrie.yocto.io/pub/non-release/20260224-104/testresults/qemuarm64-ptest/core-image-ptest-libsamplerate0/
https://valkyrie.yocto.io/pub/non-release/20260224-104/testresults/qemuriscv64-ptest/core-image-ptest-libsamplerate0/
https://valkyrie.yocto.io/pub/non-release/20260224-104/testresults/qemux86-64-ptest/core-image-ptest-libsamplerate0/

Can you have a look at the issue?

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com