Skip to contentSkip to conversation

alsa-lib: enabling ptest for alsa-lib component

PATCH Superseded aszh07 2 participants 2 messages Oct 19, 2024 – Oct 21, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

aszh07

author
#0 lore raw

PATCH 1/1 alsa-lib: enabling ptest for alsa-lib component

This change adds ptest for alsa-lib.

1) Removed the test suite execution 'make check-TESTS' call using 'sed' command.

2) Compiled the test directory source code using "oe_runmake check" command.

3) Copied all the required binaries into PTEST_PATH using do_install_ptest() function.

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib/run-ptest                   | 15 +++++++++++++
 .../alsa/alsa-lib_1.2.11.bb                   | 21 ++++++++++++++++++-
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 5975db25cc..4fe5ce34e4 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +15 -0
new file mode 100644
index 0000000000..b991de145f
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -eux
+
+for t in config control midi_event client_event_filter client_event_filter
+do
+    if "./$t" > "alsa-lib_$t.log" 2>&1
+    then
+        echo "PASS: $t"
+    else
+        echo "FAIL: $t"
+        cat "alsa-lib_$t.log"
+    fi
+    rm "alsa-lib_$t.log"
+done
+
meta/recipes-multimedia/alsa/alsa-lib_1.2.11.bb +20 -1
index c212b17aa3..8b4f3baecc 100644
@@ -11,10 +11,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7 \
 
 SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2 \
            file://0001-topology-correct-version-script-path.patch \
+           file://run-ptest \
            "
 SRC_URI[sha256sum] = "9f3f2f69b995f9ad37359072fbc69a3a88bfba081fc83e9be30e14662795bb4d"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF += " \
     ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -44,3 +45,21 @@ RREPLACES:alsa-conf = "alsa-conf-base"
 RCONFLICTS:alsa-conf = "alsa-conf-base"
 
 BBCLASSEXTEND = "native nativesdk"
+
+do_compile_ptest() {
+        sed -i 's/^.*$(MAKE) $(AM_MAKEFLAGS) check-TESTS.*$/ /' ${S}/test/lsb/Makefile.in
+        oe_runmake check
+}
+
+do_install_ptest:append() {
+    for f in control client_event_filter namehint
+    do
+        install -m 0755 "${B}/test/.libs/$f" "${D}${PTEST_PATH}";
+    done
+
+    for f in config midi_event
+    do
+        install -m 0755 "${B}/test/lsb/.libs/$f" "${D}${PTEST_PATH}";
+    done
+}
+
Signature · 1 line
2.17.1
#1 lore raw

This needs to be accepted for master first, and that submission had comments that need to be addressed.

Alex

Quoted 102 lines · On Sat, 19 Oct 2024 at 08:48, aszh07 via lists.openembedded.org…

This change adds ptest for alsa-lib.

1) Removed the test suite execution 'make check-TESTS' call using 'sed' command.

2) Compiled the test directory source code using "oe_runmake check" command.

3) Copied all the required binaries into PTEST_PATH using do_install_ptest() function.

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib/run-ptest                   | 15 +++++++++++++
 .../alsa/alsa-lib_1.2.11.bb                   | 21 ++++++++++++++++++-
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 5975db25cc..4fe5ce34e4 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +15 -0
new file mode 100644
index 0000000000..b991de145f
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -eux
+
+for t in config control midi_event client_event_filter client_event_filter
+do
+    if "./$t" > "alsa-lib_$t.log" 2>&1
+    then
+        echo "PASS: $t"
+    else
+        echo "FAIL: $t"
+        cat "alsa-lib_$t.log"
+    fi
+    rm "alsa-lib_$t.log"
+done
+
meta/recipes-multimedia/alsa/alsa-lib_1.2.11.bb +20 -2
index c212b17aa3..8b4f3baecc 100644
@@ -11,10 +11,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7 \
 
 SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2 \
            file://0001-topology-correct-version-script-path.patch \
+           file://run-ptest \
            "
 SRC_URI[sha256sum] = "9f3f2f69b995f9ad37359072fbc69a3a88bfba081fc83e9be30e14662795bb4d"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF += " \
     ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -44,3 +45,21 @@ RREPLACES:alsa-conf = "alsa-conf-base"
 RCONFLICTS:alsa-conf = "alsa-conf-base"
 
 BBCLASSEXTEND = "native nativesdk"
+
+do_compile_ptest() {
+        sed -i 's/^.*$(MAKE) $(AM_MAKEFLAGS) check-TESTS.*$/ /' ${S}/test/lsb/Makefile.in
+        oe_runmake check
+}
+
+do_install_ptest:append() {
+    for f in control client_event_filter namehint
+    do
+        install -m 0755 "${B}/test/.libs/$f" "${D}${PTEST_PATH}";
+    done
+
+    for f in config midi_event
+    do
+        install -m 0755 "${B}/test/lsb/.libs/$f" "${D}${PTEST_PATH}";
+    done
+}
+
--

2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206081): https://lists.openembedded.org/g/openembedded-core/message/206081
Mute This Topic: https://lists.openembedded.org/mt/109097481/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-