From: Shaik Moin <careers.myinfo@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: careers.myinfo@gmail.com
Subject: [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0
Date: Thu, 16 Apr 2026 16:35:25 +0530 [thread overview]
Message-ID: <20260416110525.1048871-1-moin.shaik@partner.bmwgroup.com> (raw)
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
next reply other threads:[~2026-04-16 14:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 11:05 Shaik Moin [this message]
2026-04-30 10:14 ` [OE-core][master][PATCH] libsamplerate0: Adding ptest for libsamplerate0 Ross Burton
-- strict thread matches above, loose matches on Subject: below --
2026-02-24 2:03 Shaik Moin
2026-02-25 7:19 ` Mathieu Dubois-Briand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260416110525.1048871-1-moin.shaik@partner.bmwgroup.com \
--to=careers.myinfo@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox