diff mbox series

[dunfell] alsa-lib: Enabling ptest for alsa-lib component

Message ID 20231222060422.10559-1-mail2szahir@gmail.com
State Accepted, archived
Delegated to: Steve Sakoman
Headers show
Series [dunfell] alsa-lib: Enabling ptest for alsa-lib component | expand

Commit Message

aszh07 Dec. 22, 2023, 6:04 a.m. UTC
From: Zahir Hussain <zahir.basha@kpit.com>

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.

Signed-off-by: aszh07 <mail2szahir@gmail.com>
Signed-off-by: Zahir Hussain <zahir.basha@kpit.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib_1.2.1.2.bb                  | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

Comments

Steve Sakoman Dec. 26, 2023, 2:23 p.m. UTC | #1
Sorry, this is a feature addition and not suitable for stable releases.

Steve

On Thu, Dec 21, 2023 at 8:08 PM aszh07 <mail2szahir@gmail.com> wrote:
>
> From: Zahir Hussain <zahir.basha@kpit.com>
>
> 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.
>
> Signed-off-by: aszh07 <mail2szahir@gmail.com>
> Signed-off-by: Zahir Hussain <zahir.basha@kpit.com>
> ---
>  .../distro/include/ptest-packagelists.inc     |  1 +
>  .../alsa/alsa-lib_1.2.1.2.bb                  | 19 +++++++++++++++++++
>  2 files changed, 20 insertions(+)
>
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> index 3fb7ec2657..b74e18a322 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -5,6 +5,7 @@
>  #
>  PTESTS_FAST = "\
>      acl-ptest \
> +    alsa-lib-ptest \
>      apr-ptest \
>      apr-util-ptest \
>      attr-ptest \
> diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb
> index 4867c798b9..3f772360f4 100644
> --- a/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb
> +++ b/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb
> @@ -52,3 +52,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 (#192858): https://lists.openembedded.org/g/openembedded-core/message/192858
> Mute This Topic: https://lists.openembedded.org/mt/103314286/3620601
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 3fb7ec2657..b74e18a322 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -5,6 +5,7 @@ 
 #
 PTESTS_FAST = "\
     acl-ptest \
+    alsa-lib-ptest \
     apr-ptest \
     apr-util-ptest \
     attr-ptest \
diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb
index 4867c798b9..3f772360f4 100644
--- a/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb
+++ b/meta/recipes-multimedia/alsa/alsa-lib_1.2.1.2.bb
@@ -52,3 +52,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
+}