Skip to contentSkip to conversation

alsa-lib: Enabling ptest for alsa-lib component

PATCH In review aszh07 3 participants 3 messages Feb 12, 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) Adding CFLAGS change for include the header file path for resolving below compilation issue;
In file included from ../../../alsa-lib-1.2.1.2/test/lsb/config.c:4:
../../../alsa-lib-1.2.1.2/test/lsb/test.h:5:10: fatal error:
alsa/asoundlib.h: No such file or directory
5 | #include <alsa/asoundlib.h>

2) Removed the test suite execution 'make' call using 'sed' command.

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

4) Copied all the required binaries into PTEST path using do_install_ptest() function.

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib_1.2.10.bb                   | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 9057c12b09..78b4920996 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib-ptest \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib_1.2.10.bb +19 -0
index 83bc6877d2..f3a4693a45 100644
@@ -44,3 +44,22 @@ RREPLACES:alsa-conf = "alsa-conf-base"
 RCONFLICTS:alsa-conf = "alsa-conf-base"
 
 BBCLASSEXTEND = "native nativesdk"
+
+EXTRA_OEMAKE:append = " AM_CPPFLAGS=-I${S}/include"
+
+do_compile:append() {
+        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 seems *very* incomplete. How was it tested, and can you show the output of the test that was performed?

Alex

Quoted 74 lines · On Mon, 12 Feb 2024 at 14:47, aszh07 <[email protected]> wrote:

This change adds ptest for alsa-lib.

1) Adding CFLAGS change for include the header file path for resolving below compilation issue;
In file included from ../../../alsa-lib-1.2.1.2/test/lsb/config.c:4:
../../../alsa-lib-1.2.1.2/test/lsb/test.h:5:10: fatal error:
alsa/asoundlib.h: No such file or directory
5 | #include <alsa/asoundlib.h>

2) Removed the test suite execution 'make' call using 'sed' command.

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

4) Copied all the required binaries into PTEST path using do_install_ptest() function.

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib_1.2.10.bb                   | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 9057c12b09..78b4920996 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib-ptest \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib_1.2.10.bb +19 -1
index 83bc6877d2..f3a4693a45 100644
@@ -44,3 +44,22 @@ RREPLACES:alsa-conf = "alsa-conf-base"
 RCONFLICTS:alsa-conf = "alsa-conf-base"
 
 BBCLASSEXTEND = "native nativesdk"
+
+EXTRA_OEMAKE:append = " AM_CPPFLAGS=-I${S}/include"
+
+do_compile:append() {
+        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 (#195320): https://lists.openembedded.org/g/openembedded-core/message/195320
Mute This Topic: https://lists.openembedded.org/mt/104311177/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
In reply to aszh07
Quoted 3 lines · On 12 Feb 2024, at 13:46, aszh07 via lists.openembedded.org…

.../distro/include/ptest-packagelists.inc | 1 +
.../alsa/alsa-lib_1.2.10.bb | 19 +++++++++++++++++++

2 files changed, 20 insertions(+)

I don’t see a run-ptest script, which is pretty important for a ptest-enabled package.

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

Quoted 4 lines
meta/recipes-multimedia/alsa/alsa-lib_1.2.10.bb +4 -0
+do_compile:append() {
+        sed -i 's/^.*$(MAKE) $(AM_MAKEFLAGS) check-TESTS.*$/ /' ${S}/test/lsb/Makefile.in
+        oe_runmake check
+}

We patch automake, so you can just do “oe_runmake buildtest-TESTS” here.

Ross