diff mbox series

[dunfell] alsa-lib: Add ptest

Message ID 20230801102534.60770-1-ppjadhav456@gmail.com
State Accepted, archived
Headers show
Series [dunfell] alsa-lib: Add ptest | expand

Commit Message

Poonam Jadhav Aug. 1, 2023, 10:25 a.m. UTC
From: Poonam Jadhav <Poonam.Jadhav@kpit.com>

Alsa-lib is a user space library that provides audio
and MIDI functionality apis for simplifying application
programming and provide higher level functionality

ptest executes below binaries on target:
1.config
2.control
3.client_event_filter
4.midi_event
5.namehint

Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib/run-ptest                   | 14 ++++++++++++++
 .../alsa/alsa-lib_1.2.1.2.bb                  | 19 ++++++++++++++++++-
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest

Comments

Alexander Kanavin Aug. 1, 2023, 10:33 a.m. UTC | #1
What do the tests do, and why they should be run? Are they actually
useful to run when assembling a custom distribution, and would they
help uncover integration issues? If it's merely testing the component
itself, and it is regularly run by upstream, there is little benefit
to adding them to yocto qa.

The tests should be built via upstream makefiles, not via a manually
hardcoded list (which is also incomplete compared to the makefile, and
there's no explanation for that).

Alex

On Tue, 1 Aug 2023 at 12:25, Poonam Jadhav <ppjadhav456@gmail.com> wrote:
>
> From: Poonam Jadhav <Poonam.Jadhav@kpit.com>
>
> Alsa-lib is a user space library that provides audio
> and MIDI functionality apis for simplifying application
> programming and provide higher level functionality
>
> ptest executes below binaries on target:
> 1.config
> 2.control
> 3.client_event_filter
> 4.midi_event
> 5.namehint
>
> Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
> ---
>  .../distro/include/ptest-packagelists.inc     |  1 +
>  .../alsa/alsa-lib/run-ptest                   | 14 ++++++++++++++
>  .../alsa/alsa-lib_1.2.1.2.bb                  | 19 ++++++++++++++++++-
>  3 files changed, 33 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest
>
> 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/run-ptest b/meta/recipes-multimedia/alsa/alsa-lib/run-ptest
> new file mode 100644
> index 0000000000..8fbf9f140a
> --- /dev/null
> +++ b/meta/recipes-multimedia/alsa/alsa-lib/run-ptest
> @@ -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
> 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..192e35ba3a 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
> @@ -18,11 +18,12 @@ SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2 \
>             file://0005-ucm-Do-not-fail-to-parse-configs-on-cards-with-an-em.patch \
>             file://0001-Fix-alsa-sound-.h-for-external-programs.patch \
>             file://0001-uapi-Move-typedefs-from-uapi-to-sound.patch \
> +           file://run-ptest \
>             "
>  SRC_URI[md5sum] = "82ddd3698469beec147e4f4a67134ea0"
>  SRC_URI[sha256sum] = "958e260e3673f1f6ff6b2d2c0df3fc2e469bea5b2957163ce96ce17f23e87943"
>
> -inherit autotools pkgconfig
> +inherit autotools pkgconfig ptest
>
>  EXTRA_OECONF += " \
>      ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
> @@ -52,3 +53,19 @@ RREPLACES_alsa-conf = "alsa-conf-base"
>  RCONFLICTS_alsa-conf = "alsa-conf-base"
>
>  BBCLASSEXTEND = "native nativesdk"
> +
> +do_compile:append() {
> +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/lsb/config.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o config
> +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/control.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o control
> +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/client_event"_filter.c -I "${S}/include" -L "${B}/src/.libs/" -lasound -o client_event_filter
> +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/namehint.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o namehint
> +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/lsb/midi_event.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o midi_event
> +}
> +
> +do_install_ptest:append() {
> +    install -m 0755 "${B}/config" "${D}${PTEST_PATH}"
> +    install -m 0755 "${B}/control" "${D}${PTEST_PATH}"
> +    install -m 0755 "${B}/client_event_filter" "${D}${PTEST_PATH}"
> +    install -m 0755 "${B}/midi_event" "${D}${PTEST_PATH}"
> +    install -m 0755 "${B}/namehint" "${D}${PTEST_PATH}"
> +}
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#185236): https://lists.openembedded.org/g/openembedded-core/message/185236
> Mute This Topic: https://lists.openembedded.org/mt/100480016/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexander Kanavin Aug. 1, 2023, 10:34 a.m. UTC | #2
Oh, and: any new feature must be submitted for master branch first,
then backported to stable branches.

Alex

On Tue, 1 Aug 2023 at 12:33, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> What do the tests do, and why they should be run? Are they actually
> useful to run when assembling a custom distribution, and would they
> help uncover integration issues? If it's merely testing the component
> itself, and it is regularly run by upstream, there is little benefit
> to adding them to yocto qa.
>
> The tests should be built via upstream makefiles, not via a manually
> hardcoded list (which is also incomplete compared to the makefile, and
> there's no explanation for that).
>
> Alex
>
> On Tue, 1 Aug 2023 at 12:25, Poonam Jadhav <ppjadhav456@gmail.com> wrote:
> >
> > From: Poonam Jadhav <Poonam.Jadhav@kpit.com>
> >
> > Alsa-lib is a user space library that provides audio
> > and MIDI functionality apis for simplifying application
> > programming and provide higher level functionality
> >
> > ptest executes below binaries on target:
> > 1.config
> > 2.control
> > 3.client_event_filter
> > 4.midi_event
> > 5.namehint
> >
> > Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com>
> > ---
> >  .../distro/include/ptest-packagelists.inc     |  1 +
> >  .../alsa/alsa-lib/run-ptest                   | 14 ++++++++++++++
> >  .../alsa/alsa-lib_1.2.1.2.bb                  | 19 ++++++++++++++++++-
> >  3 files changed, 33 insertions(+), 1 deletion(-)
> >  create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest
> >
> > 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/run-ptest b/meta/recipes-multimedia/alsa/alsa-lib/run-ptest
> > new file mode 100644
> > index 0000000000..8fbf9f140a
> > --- /dev/null
> > +++ b/meta/recipes-multimedia/alsa/alsa-lib/run-ptest
> > @@ -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
> > 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..192e35ba3a 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
> > @@ -18,11 +18,12 @@ SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2 \
> >             file://0005-ucm-Do-not-fail-to-parse-configs-on-cards-with-an-em.patch \
> >             file://0001-Fix-alsa-sound-.h-for-external-programs.patch \
> >             file://0001-uapi-Move-typedefs-from-uapi-to-sound.patch \
> > +           file://run-ptest \
> >             "
> >  SRC_URI[md5sum] = "82ddd3698469beec147e4f4a67134ea0"
> >  SRC_URI[sha256sum] = "958e260e3673f1f6ff6b2d2c0df3fc2e469bea5b2957163ce96ce17f23e87943"
> >
> > -inherit autotools pkgconfig
> > +inherit autotools pkgconfig ptest
> >
> >  EXTRA_OECONF += " \
> >      ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
> > @@ -52,3 +53,19 @@ RREPLACES_alsa-conf = "alsa-conf-base"
> >  RCONFLICTS_alsa-conf = "alsa-conf-base"
> >
> >  BBCLASSEXTEND = "native nativesdk"
> > +
> > +do_compile:append() {
> > +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/lsb/config.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o config
> > +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/control.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o control
> > +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/client_event"_filter.c -I "${S}/include" -L "${B}/src/.libs/" -lasound -o client_event_filter
> > +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/namehint.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o namehint
> > +    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/lsb/midi_event.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o midi_event
> > +}
> > +
> > +do_install_ptest:append() {
> > +    install -m 0755 "${B}/config" "${D}${PTEST_PATH}"
> > +    install -m 0755 "${B}/control" "${D}${PTEST_PATH}"
> > +    install -m 0755 "${B}/client_event_filter" "${D}${PTEST_PATH}"
> > +    install -m 0755 "${B}/midi_event" "${D}${PTEST_PATH}"
> > +    install -m 0755 "${B}/namehint" "${D}${PTEST_PATH}"
> > +}
> > --
> > 2.25.1
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#185236): https://lists.openembedded.org/g/openembedded-core/message/185236
> > Mute This Topic: https://lists.openembedded.org/mt/100480016/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.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/run-ptest b/meta/recipes-multimedia/alsa/alsa-lib/run-ptest
new file mode 100644
index 0000000000..8fbf9f140a
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-lib/run-ptest
@@ -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
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..192e35ba3a 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
@@ -18,11 +18,12 @@  SRC_URI = "https://www.alsa-project.org/files/pub/lib/${BP}.tar.bz2 \
            file://0005-ucm-Do-not-fail-to-parse-configs-on-cards-with-an-em.patch \
            file://0001-Fix-alsa-sound-.h-for-external-programs.patch \
            file://0001-uapi-Move-typedefs-from-uapi-to-sound.patch \
+           file://run-ptest \
            "
 SRC_URI[md5sum] = "82ddd3698469beec147e4f4a67134ea0"
 SRC_URI[sha256sum] = "958e260e3673f1f6ff6b2d2c0df3fc2e469bea5b2957163ce96ce17f23e87943"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF += " \
     ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -52,3 +53,19 @@  RREPLACES_alsa-conf = "alsa-conf-base"
 RCONFLICTS_alsa-conf = "alsa-conf-base"
 
 BBCLASSEXTEND = "native nativesdk"
+
+do_compile:append() {
+    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/lsb/config.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o config
+    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/control.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o control
+    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/client_event"_filter.c -I "${S}/include" -L "${B}/src/.libs/" -lasound -o client_event_filter
+    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/namehint.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o namehint
+    ${CC} ${CFLAGS} ${LDFLAGS} "${S}/test/lsb/midi_event.c" -I "${S}/include" -L "${B}/src/.libs/" -lasound -o midi_event
+}
+
+do_install_ptest:append() {
+    install -m 0755 "${B}/config" "${D}${PTEST_PATH}"
+    install -m 0755 "${B}/control" "${D}${PTEST_PATH}"
+    install -m 0755 "${B}/client_event_filter" "${D}${PTEST_PATH}"
+    install -m 0755 "${B}/midi_event" "${D}${PTEST_PATH}"
+    install -m 0755 "${B}/namehint" "${D}${PTEST_PATH}"
+}