public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0
@ 2026-02-24  2:03 Shaik Moin
  2026-02-25  7:19 ` Mathieu Dubois-Briand
  0 siblings, 1 reply; 4+ messages in thread
From: Shaik Moin @ 2026-02-24  2:03 UTC (permalink / raw)
  To: openembedded-core; +Cc: careers.myinfo

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

Signed-off-by: Shaik Moin <moins@kpit.com>
---
 .../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

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 80414f1cb8..922c341b30 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -122,6 +122,7 @@ PTESTS_SLOW = "\
     libmodule-build-perl \
     libpng \
     ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'libseccomp', '',d)} \
+    libsamplerate0 \
     lttng-tools \
     lz4 \
     openssh \
diff --git a/meta/recipes-multimedia/libsamplerate/files/run-ptest b/meta/recipes-multimedia/libsamplerate/files/run-ptest
new file mode 100644
index 0000000000..bcbe4db7ff
--- /dev/null
+++ b/meta/recipes-multimedia/libsamplerate/files/run-ptest
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+DIR="."
+
+total=0
+pass=0
+fail=0
+
+list_tmp="$(mktemp)"
+
+# Build list of test executables, excluding this runner script
+# Portable: use -perm -u+x instead of -executable
+find "$DIR" -maxdepth 1 -type f -perm -u+x 2>/dev/null \
+  ! -name "$(basename "$0")" \
+  ! -name ".*" \
+  -printf '%f\n' \
+| LC_ALL=C sort > "$list_tmp"
+
+echo "----- Executables are:-----"
+if [ -s "$list_tmp" ]; then
+    cat "$list_tmp"
+else
+    echo "(none)"
+fi
+echo "----------------------------------------------"
+
+while IFS= read -r T; do
+    [ -n "$T" ] || continue
+    echo "Running $T"
+    total=$((total + 1))
+
+    if "$DIR/$T"; then
+        echo "PASS: $T"
+        pass=$((pass + 1))
+    else
+        status=$?
+        echo "FAIL: $T (exit=$status)"
+        fail=$((fail + 1))
+    fi
+done < "$list_tmp"
+
+rm -f "$list_tmp"
+
+echo "============================================================================"
+echo "# TOTAL: $total"
+echo "# PASS:  $pass"
+echo "# FAIL:  $fail"
+echo "============================================================================"
+
+# Exit non-zero if any test failed
+[ "$fail" -eq 0 ] && exit 0 || exit 1
diff --git a/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb b/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb
index 819096878b..8a0fe4e108 100644
--- a/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb
+++ b/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb
@@ -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
+}
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0
  2026-02-24  2:03 [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0 Shaik Moin
@ 2026-02-25  7:19 ` Mathieu Dubois-Briand
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Dubois-Briand @ 2026-02-25  7:19 UTC (permalink / raw)
  To: careers.myinfo, openembedded-core

On Tue Feb 24, 2026 at 3:03 AM CET, Shaik Moin via lists.openembedded.org wrote:
> 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
>
> Signed-off-by: Shaik Moin <moins@kpit.com>
> ---

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

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0
@ 2026-04-16 11:05 Shaik Moin
  2026-04-30 10:14 ` Ross Burton
  0 siblings, 1 reply; 4+ messages in thread
From: Shaik Moin @ 2026-04-16 11:05 UTC (permalink / raw)
  To: openembedded-core; +Cc: careers.myinfo

From: Shaik Moin <careers.myinfo@gmail.com>

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

Signed-off-by: Shaik Moin <careers.myinfo@gmail.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../libsamplerate/files/run-ptest             | 47 +++++++++++++++++++
 .../libsamplerate/libsamplerate0_0.2.2.bb     | 16 ++++++-
 3 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-multimedia/libsamplerate/files/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 11a894accf..b5b536bb92 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -127,6 +127,7 @@ PTESTS_SLOW = "\
     libmodule-build-perl \
     libpng \
     ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'libseccomp', '',d)} \
+    libsamplerate0 \
     lttng-tools \
     lz4 \
     openssh \
diff --git a/meta/recipes-multimedia/libsamplerate/files/run-ptest b/meta/recipes-multimedia/libsamplerate/files/run-ptest
new file mode 100644
index 0000000000..9fc9739b7c
--- /dev/null
+++ b/meta/recipes-multimedia/libsamplerate/files/run-ptest
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+set -e
+
+TESTDIR="$(dirname "$0")/tests"
+
+total=0
+pass=0
+fail=0
+
+if [ ! -d "$TESTDIR" ]; then
+    echo "(tests directory missing)"
+    exit 1
+fi
+
+echo "----- Executables are: -----"
+
+for t in "$TESTDIR"/*; do
+    [ -x "$t" ] || continue
+    echo "$(basename "$t")"
+done
+
+echo "----------------------------------------------"
+
+for t in "$TESTDIR"/*; do
+    [ -x "$t" ] || continue
+
+    name="$(basename "$t")"
+    echo "Running $name"
+    total=$((total + 1))
+
+    if "$t"; then
+        echo "PASS: $name"
+        pass=$((pass + 1))
+    else
+        status=$?
+        echo "FAIL: $name (exit=$status)"
+        fail=$((fail + 1))
+	fi
+done
+
+echo "============================================================================"
+echo "# TOTAL: $total"
+echo "# PASS:  $pass"
+echo "# FAIL:  $fail"
+echo "============================================================================"
+[ "$fail" -eq 0 ]
diff --git a/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb b/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb
index 819096878b..52ff7f313d 100644
--- a/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb
+++ b/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.2.2.bb
@@ -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,22 @@ 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() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    for t in $(makefile-getvar ${B}/Makefile check_PROGRAMS); do
+        [ -x "${B}/$t" ] || continue
+        "${B}/libtool" --mode=install install -c \
+            "${B}/$t" "${D}${PTEST_PATH}/tests/$(basename "$t")"
+    done
+}
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0
  2026-04-16 11:05 Shaik Moin
@ 2026-04-30 10:14 ` Ross Burton
  0 siblings, 0 replies; 4+ messages in thread
From: Ross Burton @ 2026-04-30 10:14 UTC (permalink / raw)
  To: careers.myinfo@gmail.com; +Cc: openembedded-core@lists.openembedded.org

On 16 Apr 2026, at 12:05, Shaik Moin via lists.openembedded.org <careers.myinfo=gmail.com@lists.openembedded.org> wrote:
> +echo "----- Executables are: -----"
> +
> +for t in "$TESTDIR"/*; do
> +    [ -x "$t" ] || continue
> +    echo "$(basename "$t")"
> +done

This block is redundant as you print the names in the next loop, remove.

> +for t in "$TESTDIR"/*; do
> +    [ -x "$t" ] || continue

Everything you installed is executable so drop this.

> EXTRA_OECONF = "--disable-fftw --disable-alsa"

Add a newline here

> +do_compile:append() {
> +    oe_runmake buildtest-TESTS
> +}

> +do_install_ptest() {
> +    install -d ${D}${PTEST_PATH}/tests
> +
> +    for t in $(makefile-getvar ${B}/Makefile check_PROGRAMS); do
> +        [ -x "${B}/$t" ] || continue

Programs are executable so this is excessively defensive?

> +        "${B}/libtool" --mode=install install -c \
> +            "${B}/$t" "${D}${PTEST_PATH}/tests/$(basename "$t")"
> +    done
> +}

The manpage for "install -c” says just “(ignored)” so why are you passing -c?

Ross


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-30 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24  2:03 [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0 Shaik Moin
2026-02-25  7:19 ` Mathieu Dubois-Briand
  -- strict thread matches above, loose matches on Subject: below --
2026-04-16 11:05 Shaik Moin
2026-04-30 10:14 ` Ross Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox