Skip to contentSkip to conversation

alsa-lib: Add ptest

PATCH In review Poonam Jadhav 3 participants 4 messages Aug 1, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-lib: Add ptest

From: Poonam Jadhav <[email protected]>

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

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib/run-ptest                   | 14 ++++++++++++
 .../recipes-multimedia/alsa/alsa-lib_1.2.9.bb | 22 +++++++++++++++++--
 3 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 6250cf081e..99f09132ae 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib/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
meta/recipes-multimedia/alsa/alsa-lib_1.2.9.bb +20 -2
index d482e27683..8dcd7c4448 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] = "dc9c643fdc4ccfd0572cc685858dd41e08afb583f30460b317e4188275f615b2"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF += " \
     ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -42,3 +44,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}"
+}
Signature · 1 line
2.25.1
#1 lore raw

This doesn't address the points I raised previously. So it's still a no.

Alex

Quoted 105 lines · Poonam Jadhav

From: Poonam Jadhav <[email protected]>

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

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../alsa/alsa-lib/run-ptest                   | 14 ++++++++++++
 .../recipes-multimedia/alsa/alsa-lib_1.2.9.bb | 22 +++++++++++++++++--
 3 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 6250cf081e..99f09132ae 100644
@@ -5,6 +5,7 @@
 #
 PTESTS_FAST = "\
     acl \
+    alsa-lib \
     apr-util \
     attr \
     babeltrace \
meta/recipes-multimedia/alsa/alsa-lib/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
meta/recipes-multimedia/alsa/alsa-lib_1.2.9.bb +20 -3
index d482e27683..8dcd7c4448 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] = "dc9c643fdc4ccfd0572cc685858dd41e08afb583f30460b317e4188275f615b2"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 EXTRA_OECONF += " \
     ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -42,3 +44,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 (#185246): https://lists.openembedded.org/g/openembedded-core/message/185246
Mute This Topic: https://lists.openembedded.org/mt/100483753/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
In reply to Poonam Jadhav
Quoted 39 lines · Poonam Jadhav

From: Poonam Jadhav <[email protected]>

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

---
  .../distro/include/ptest-packagelists.inc     |  1 +
  .../alsa/alsa-lib/run-ptest                   | 14 ++++++++++++
  .../recipes-multimedia/alsa/alsa-lib_1.2.9.bb | 22 +++++++++++++++++--
  3 files changed, 35 insertions(+), 2 deletions(-)

create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest

meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 6250cf081e..99f09132ae 100644
@@ -5,6 +5,7 @@
  #
  PTESTS_FAST = "\
      acl \
+    alsa-lib \
      apr-util \
      attr \
      babeltrace \
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +0 -0
new file mode 100644
index 0000000000..8fbf9f140a

meta/recipes-multimedia/alsa/alsa-lib/run-ptest line 4

Quoted 4 lines
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +4 -0
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -eux
+
+for t in config control midi_event client_event_filter client_event_filter

It will be good to derive this list from the sources so it remains in sync with future additions/deletions.

Quoted 60 lines
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +10 -0
+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.9.bb +20 -3
index d482e27683..8dcd7c4448 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] = "dc9c643fdc4ccfd0572cc685858dd41e08afb583f30460b317e4188275f615b2"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
  EXTRA_OECONF += " \
      ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -42,3 +44,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}"
+}
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

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

#3 lore raw

The actual list is defined in the makefile:

https://github.com/alsa-project/alsa-lib/blob/master/test/Makefile.am

I had asked why the patch builds and runs only a hardcoded subset, but got no response. Also the need for doing this as a ptest should be justified to begin with.

Alex

Quoted 112 lines · Khem Raj
Quoted 39 lines · Poonam Jadhav

From: Poonam Jadhav <[email protected]>

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

---
  .../distro/include/ptest-packagelists.inc     |  1 +
  .../alsa/alsa-lib/run-ptest                   | 14 ++++++++++++
  .../recipes-multimedia/alsa/alsa-lib_1.2.9.bb | 22 +++++++++++++++++--
  3 files changed, 35 insertions(+), 2 deletions(-)

create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/run-ptest

meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 6250cf081e..99f09132ae 100644
@@ -5,6 +5,7 @@
  #
  PTESTS_FAST = "\
      acl \
+    alsa-lib \
      apr-util \
      attr \
      babeltrace \
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +0 -0
new file mode 100644
index 0000000000..8fbf9f140a

meta/recipes-multimedia/alsa/alsa-lib/run-ptest line 4

Quoted 4 lines
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +4 -0
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -eux
+
+for t in config control midi_event client_event_filter client_event_filter

It will be good to derive this list from the sources so it remains in sync with future additions/deletions.

Quoted 44 lines
meta/recipes-multimedia/alsa/alsa-lib/run-ptest new file +10 -0
+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.9.bb +10 -2
index d482e27683..8dcd7c4448 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] = "dc9c643fdc4ccfd0572cc685858dd41e08afb583f30460b317e4188275f615b2"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
  EXTRA_OECONF += " \
      ${@bb.utils.contains('TARGET_FPU', 'soft', '--with-softfloat', '', d)} \
@@ -42,3 +44,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

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

Quoted 10 lines
meta/recipes-multimedia/alsa/alsa-lib_1.2.9.bb +10 -0
+    ${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}"
+}

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