Skip to contentSkip to conversation

alsa-lib: enabling ptest for alsa-lib component

PATCH In review aszh07 3 participants 3 messages Oct 16, 2024

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_1.2.12.bb                   | 23 +++++++++++++++++--
 meta/recipes-multimedia/alsa/files/run-ptest  | 14 +++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-multimedia/alsa/files/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 4a48188562..f0ffe11347 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib_1.2.12.bb +21 -2
index d9136052b7..1aa19dac6d 100644
@@ -9,10 +9,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7 \
                     file://src/socket.c;md5=285675b45e83f571c6a957fe4ab79c93;beginline=9;endline=24 \
                     "
 
-SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2"
+SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2 \
+           file://run-ptest \
+	  "
 SRC_URI[sha256sum] = "4868cd908627279da5a634f468701625be8cc251d84262c7e5b6a218391ad0d2"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF += " \
     ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -42,3 +44,20 @@ 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
+}
meta/recipes-multimedia/alsa/files/run-ptest new file +14 -0
new file mode 100644
index 0000000000..8fbf9f140a
@@ -0,0 +1,14 @@
+#!/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
Signature · 1 line
2.17.1
#1 lore raw
Quoted 50 lines · On Wed, Oct 16, 2024 at 10:17 AM 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_1.2.12.bb                   | 23 +++++++++++++++++--
 meta/recipes-multimedia/alsa/files/run-ptest  | 14 +++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-multimedia/alsa/files/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 4a48188562..f0ffe11347 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib_1.2.12.bb +4 -2
index d9136052b7..1aa19dac6d 100644
@@ -9,10 +9,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7 \
                     file://src/socket.c;md5=285675b45e83f571c6a957fe4ab79c93;beginline=9;endline=24 \
                     "
 
-SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2"
+SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2 \
+           file://run-ptest \
+         "
 SRC_URI[sha256sum] = "4868cd908627279da5a634f468701625be8cc251d84262c7e5b6a218391ad0d2"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF += " \
     ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \

meta/recipes-multimedia/alsa/alsa-lib_1.2.12.bb RREPLACES:alsa-conf = "alsa-conf-base" · line 49

Quoted 6 lines
meta/recipes-multimedia/alsa/alsa-lib_1.2.12.bb +3 -0
@@ -42,3 +44,20 @@ 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

Can we do this sed operation as a patch and apply it unconditionally, since it's only editing
tests makefile, it seems harmless for the rest of the component.

Quoted 46 lines
meta/recipes-multimedia/alsa/alsa-lib_1.2.12.bb +14 -0
+        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
+}
meta/recipes-multimedia/alsa/files/run-ptest new file +14 -1
new file mode 100644
index 0000000000..8fbf9f140a
@@ -0,0 +1,14 @@
+#!/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
--

2.17.1

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

#2 lore raw
In reply to aszh07

meta/recipes-multimedia/alsa/alsa-lib_1.2.12.bb RREPLACES:alsa-conf = "alsa-conf-base" · line 62

Quoted 9 lines · On Wed, 16 Oct 2024 at 19:17, aszh07 via lists.openembedded.org…
meta/recipes-multimedia/alsa/alsa-lib_1.2.12.bb +9 -0
+    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

Can these be wildcards, or maybe the output of the find command? Hardcoded lists like these are prone to become outdated and incomplete on version upgrades.

meta/recipes-multimedia/alsa/files/run-ptest line 6

Quoted 3 lines
meta/recipes-multimedia/alsa/files/run-ptest new file +3 -0
+for t in config control midi_event client_event_filter client_event_filter
+do
+    if "./$t" > "alsa-lib_$t.log" 2>&1

Here you can simply use a wildcard as nothing else is installed. Again avoids the use of hardcoded lists.

Alex