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
+}
