diff mbox series

[meta-oe] asio: Add ptest support

Message ID 20241009092512.3615190-1-mingli.yu@windriver.com
State Accepted
Headers show
Series [meta-oe] asio: Add ptest support | expand

Commit Message

Yu, Mingli Oct. 9, 2024, 9:25 a.m. UTC
From: Mingli Yu <mingli.yu@windriver.com>

 # ./run-ptest
PASS: address
PASS: address_v4
PASS: address_v4_iterator
PASS: address_v4_range
PASS: address_v6
PASS: address_v6_iterator
PASS: address_v6_range
PASS: any_completion_executor
PASS: any_completion_handler
PASS: any_executor
PASS: any_io_executor
PASS: append
PASS: as_tuple
PASS: associated_allocator
PASS: associated_cancellation_slot
PASS: associated_executor
PASS: associated_immediate_executor
PASS: associator
PASS: async_result
[snip]

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 meta-oe/recipes-support/asio/asio/run-ptest | 19 +++++++++++++++++++
 meta-oe/recipes-support/asio/asio_1.30.2.bb | 18 ++++++++++++++++--
 2 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-support/asio/asio/run-ptest

Comments

Khem Raj Oct. 9, 2024, 5:53 p.m. UTC | #1
Thanks for adding the tests, this is really helpful in many ways to
keep quality of recipe. I would also suggest to add it
to per package ptest image mechanism in
meta-oe/conf/include/ptest-packagelists-meta-oe.inc, if it is quick
then put it
in PTESTS_FAST_META_OE else put it in PTESTS_SLOW_META_OE

After doing this you can run the ptest for just this recipe by doing

bitbake meta-oe-image-ptest-asio

On Wed, Oct 9, 2024 at 2:25 AM Yu, Mingli via lists.openembedded.org
<mingli.yu=eng.windriver.com@lists.openembedded.org> wrote:
>
> From: Mingli Yu <mingli.yu@windriver.com>
>
>  # ./run-ptest
> PASS: address
> PASS: address_v4
> PASS: address_v4_iterator
> PASS: address_v4_range
> PASS: address_v6
> PASS: address_v6_iterator
> PASS: address_v6_range
> PASS: any_completion_executor
> PASS: any_completion_handler
> PASS: any_executor
> PASS: any_io_executor
> PASS: append
> PASS: as_tuple
> PASS: associated_allocator
> PASS: associated_cancellation_slot
> PASS: associated_executor
> PASS: associated_immediate_executor
> PASS: associator
> PASS: async_result
> [snip]
>
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
>  meta-oe/recipes-support/asio/asio/run-ptest | 19 +++++++++++++++++++
>  meta-oe/recipes-support/asio/asio_1.30.2.bb | 18 ++++++++++++++++--
>  2 files changed, 35 insertions(+), 2 deletions(-)
>  create mode 100644 meta-oe/recipes-support/asio/asio/run-ptest
>
> diff --git a/meta-oe/recipes-support/asio/asio/run-ptest b/meta-oe/recipes-support/asio/asio/run-ptest
> new file mode 100644
> index 000000000..d37db0b31
> --- /dev/null
> +++ b/meta-oe/recipes-support/asio/asio/run-ptest
> @@ -0,0 +1,19 @@
> +#!/bin/sh
> +
> +ptestdir=$(dirname "$(readlink -f "$0")")
> +cd "$ptestdir"/tests || exit
> +
> +tests=$(find * -type f -executable)
> +
> +rm -rf test.log
> +
> +for f in $tests
> +do
> +    if test -x ./"$f"; then
> +        if ./"$f" > test.log 2>&1; then
> +            echo "PASS: $f"
> +        else
> +            echo "FAIL: $f"
> +        fi
> +    fi
> +done
> diff --git a/meta-oe/recipes-support/asio/asio_1.30.2.bb b/meta-oe/recipes-support/asio/asio_1.30.2.bb
> index 6930381ec..ae0baadc6 100644
> --- a/meta-oe/recipes-support/asio/asio_1.30.2.bb
> +++ b/meta-oe/recipes-support/asio/asio_1.30.2.bb
> @@ -8,9 +8,11 @@ LICENSE = "BSL-1.0"
>
>  DEPENDS = "openssl"
>
> -SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2"
> +SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2 \
> +           file://run-ptest \
> +"
>
> -inherit autotools
> +inherit autotools ptest
>
>  ALLOW_EMPTY:${PN} = "1"
>
> @@ -22,4 +24,16 @@ PACKAGECONFIG ??= "boost"
>
>  PACKAGECONFIG[boost] = "--with-boost=${STAGING_LIBDIR},--without-boost,boost"
>
> +TESTDIR = "src/tests"
> +do_compile_ptest() {
> +    echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
> +    oe_runmake -C ${TESTDIR} buildtest-TESTS
> +}
> +
> +do_install_ptest() {
> +    install -d ${D}${PTEST_PATH}/tests
> +    # copy executables
> +    find ${B}/${TESTDIR}/unit -type f -executable -exec cp {} ${D}${PTEST_PATH}/tests/ \;
> +}
> +
>  BBCLASSEXTEND = "native nativesdk"
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#112724): https://lists.openembedded.org/g/openembedded-devel/message/112724
> Mute This Topic: https://lists.openembedded.org/mt/108905838/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Khem Raj Oct. 9, 2024, 10:42 p.m. UTC | #2
also fails to build with clang

https://errors.yoctoproject.org/Errors/Details/807571/

On Wed, Oct 9, 2024 at 10:53 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> Thanks for adding the tests, this is really helpful in many ways to
> keep quality of recipe. I would also suggest to add it
> to per package ptest image mechanism in
> meta-oe/conf/include/ptest-packagelists-meta-oe.inc, if it is quick
> then put it
> in PTESTS_FAST_META_OE else put it in PTESTS_SLOW_META_OE
>
> After doing this you can run the ptest for just this recipe by doing
>
> bitbake meta-oe-image-ptest-asio
>
> On Wed, Oct 9, 2024 at 2:25 AM Yu, Mingli via lists.openembedded.org
> <mingli.yu=eng.windriver.com@lists.openembedded.org> wrote:
> >
> > From: Mingli Yu <mingli.yu@windriver.com>
> >
> >  # ./run-ptest
> > PASS: address
> > PASS: address_v4
> > PASS: address_v4_iterator
> > PASS: address_v4_range
> > PASS: address_v6
> > PASS: address_v6_iterator
> > PASS: address_v6_range
> > PASS: any_completion_executor
> > PASS: any_completion_handler
> > PASS: any_executor
> > PASS: any_io_executor
> > PASS: append
> > PASS: as_tuple
> > PASS: associated_allocator
> > PASS: associated_cancellation_slot
> > PASS: associated_executor
> > PASS: associated_immediate_executor
> > PASS: associator
> > PASS: async_result
> > [snip]
> >
> > Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > ---
> >  meta-oe/recipes-support/asio/asio/run-ptest | 19 +++++++++++++++++++
> >  meta-oe/recipes-support/asio/asio_1.30.2.bb | 18 ++++++++++++++++--
> >  2 files changed, 35 insertions(+), 2 deletions(-)
> >  create mode 100644 meta-oe/recipes-support/asio/asio/run-ptest
> >
> > diff --git a/meta-oe/recipes-support/asio/asio/run-ptest b/meta-oe/recipes-support/asio/asio/run-ptest
> > new file mode 100644
> > index 000000000..d37db0b31
> > --- /dev/null
> > +++ b/meta-oe/recipes-support/asio/asio/run-ptest
> > @@ -0,0 +1,19 @@
> > +#!/bin/sh
> > +
> > +ptestdir=$(dirname "$(readlink -f "$0")")
> > +cd "$ptestdir"/tests || exit
> > +
> > +tests=$(find * -type f -executable)
> > +
> > +rm -rf test.log
> > +
> > +for f in $tests
> > +do
> > +    if test -x ./"$f"; then
> > +        if ./"$f" > test.log 2>&1; then
> > +            echo "PASS: $f"
> > +        else
> > +            echo "FAIL: $f"
> > +        fi
> > +    fi
> > +done
> > diff --git a/meta-oe/recipes-support/asio/asio_1.30.2.bb b/meta-oe/recipes-support/asio/asio_1.30.2.bb
> > index 6930381ec..ae0baadc6 100644
> > --- a/meta-oe/recipes-support/asio/asio_1.30.2.bb
> > +++ b/meta-oe/recipes-support/asio/asio_1.30.2.bb
> > @@ -8,9 +8,11 @@ LICENSE = "BSL-1.0"
> >
> >  DEPENDS = "openssl"
> >
> > -SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2"
> > +SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2 \
> > +           file://run-ptest \
> > +"
> >
> > -inherit autotools
> > +inherit autotools ptest
> >
> >  ALLOW_EMPTY:${PN} = "1"
> >
> > @@ -22,4 +24,16 @@ PACKAGECONFIG ??= "boost"
> >
> >  PACKAGECONFIG[boost] = "--with-boost=${STAGING_LIBDIR},--without-boost,boost"
> >
> > +TESTDIR = "src/tests"
> > +do_compile_ptest() {
> > +    echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
> > +    oe_runmake -C ${TESTDIR} buildtest-TESTS
> > +}
> > +
> > +do_install_ptest() {
> > +    install -d ${D}${PTEST_PATH}/tests
> > +    # copy executables
> > +    find ${B}/${TESTDIR}/unit -type f -executable -exec cp {} ${D}${PTEST_PATH}/tests/ \;
> > +}
> > +
> >  BBCLASSEXTEND = "native nativesdk"
> > --
> > 2.34.1
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#112724): https://lists.openembedded.org/g/openembedded-devel/message/112724
> > Mute This Topic: https://lists.openembedded.org/mt/108905838/1997914
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
Yu, Mingli Oct. 10, 2024, 6:34 a.m. UTC | #3
Will sent v2.

Thanks,

On 10/10/24 06:42, Khem Raj wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> also fails to build with clang
> 
> https://errors.yoctoproject.org/Errors/Details/807571/
> 
> On Wed, Oct 9, 2024 at 10:53 AM Khem Raj <raj.khem@gmail.com> wrote:
>>
>> Thanks for adding the tests, this is really helpful in many ways to
>> keep quality of recipe. I would also suggest to add it
>> to per package ptest image mechanism in
>> meta-oe/conf/include/ptest-packagelists-meta-oe.inc, if it is quick
>> then put it
>> in PTESTS_FAST_META_OE else put it in PTESTS_SLOW_META_OE
>>
>> After doing this you can run the ptest for just this recipe by doing
>>
>> bitbake meta-oe-image-ptest-asio
>>
>> On Wed, Oct 9, 2024 at 2:25 AM Yu, Mingli via lists.openembedded.org
>> <mingli.yu=eng.windriver.com@lists.openembedded.org> wrote:
>>>
>>> From: Mingli Yu <mingli.yu@windriver.com>
>>>
>>>   # ./run-ptest
>>> PASS: address
>>> PASS: address_v4
>>> PASS: address_v4_iterator
>>> PASS: address_v4_range
>>> PASS: address_v6
>>> PASS: address_v6_iterator
>>> PASS: address_v6_range
>>> PASS: any_completion_executor
>>> PASS: any_completion_handler
>>> PASS: any_executor
>>> PASS: any_io_executor
>>> PASS: append
>>> PASS: as_tuple
>>> PASS: associated_allocator
>>> PASS: associated_cancellation_slot
>>> PASS: associated_executor
>>> PASS: associated_immediate_executor
>>> PASS: associator
>>> PASS: async_result
>>> [snip]
>>>
>>> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>>> ---
>>>   meta-oe/recipes-support/asio/asio/run-ptest | 19 +++++++++++++++++++
>>>   meta-oe/recipes-support/asio/asio_1.30.2.bb | 18 ++++++++++++++++--
>>>   2 files changed, 35 insertions(+), 2 deletions(-)
>>>   create mode 100644 meta-oe/recipes-support/asio/asio/run-ptest
>>>
>>> diff --git a/meta-oe/recipes-support/asio/asio/run-ptest b/meta-oe/recipes-support/asio/asio/run-ptest
>>> new file mode 100644
>>> index 000000000..d37db0b31
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-support/asio/asio/run-ptest
>>> @@ -0,0 +1,19 @@
>>> +#!/bin/sh
>>> +
>>> +ptestdir=$(dirname "$(readlink -f "$0")")
>>> +cd "$ptestdir"/tests || exit
>>> +
>>> +tests=$(find * -type f -executable)
>>> +
>>> +rm -rf test.log
>>> +
>>> +for f in $tests
>>> +do
>>> +    if test -x ./"$f"; then
>>> +        if ./"$f" > test.log 2>&1; then
>>> +            echo "PASS: $f"
>>> +        else
>>> +            echo "FAIL: $f"
>>> +        fi
>>> +    fi
>>> +done
>>> diff --git a/meta-oe/recipes-support/asio/asio_1.30.2.bb b/meta-oe/recipes-support/asio/asio_1.30.2.bb
>>> index 6930381ec..ae0baadc6 100644
>>> --- a/meta-oe/recipes-support/asio/asio_1.30.2.bb
>>> +++ b/meta-oe/recipes-support/asio/asio_1.30.2.bb
>>> @@ -8,9 +8,11 @@ LICENSE = "BSL-1.0"
>>>
>>>   DEPENDS = "openssl"
>>>
>>> -SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2"
>>> +SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2 \
>>> +           file://run-ptest \
>>> +"
>>>
>>> -inherit autotools
>>> +inherit autotools ptest
>>>
>>>   ALLOW_EMPTY:${PN} = "1"
>>>
>>> @@ -22,4 +24,16 @@ PACKAGECONFIG ??= "boost"
>>>
>>>   PACKAGECONFIG[boost] = "--with-boost=${STAGING_LIBDIR},--without-boost,boost"
>>>
>>> +TESTDIR = "src/tests"
>>> +do_compile_ptest() {
>>> +    echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
>>> +    oe_runmake -C ${TESTDIR} buildtest-TESTS
>>> +}
>>> +
>>> +do_install_ptest() {
>>> +    install -d ${D}${PTEST_PATH}/tests
>>> +    # copy executables
>>> +    find ${B}/${TESTDIR}/unit -type f -executable -exec cp {} ${D}${PTEST_PATH}/tests/ \;
>>> +}
>>> +
>>>   BBCLASSEXTEND = "native nativesdk"
>>> --
>>> 2.34.1
>>>
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>> Links: You receive all messages sent to this group.
>>> View/Reply Online (#112724): https://lists.openembedded.org/g/openembedded-devel/message/112724
>>> Mute This Topic: https://lists.openembedded.org/mt/108905838/1997914
>>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/asio/asio/run-ptest b/meta-oe/recipes-support/asio/asio/run-ptest
new file mode 100644
index 000000000..d37db0b31
--- /dev/null
+++ b/meta-oe/recipes-support/asio/asio/run-ptest
@@ -0,0 +1,19 @@ 
+#!/bin/sh
+
+ptestdir=$(dirname "$(readlink -f "$0")")
+cd "$ptestdir"/tests || exit
+
+tests=$(find * -type f -executable)
+
+rm -rf test.log
+
+for f in $tests
+do
+    if test -x ./"$f"; then
+        if ./"$f" > test.log 2>&1; then
+            echo "PASS: $f"
+        else
+            echo "FAIL: $f"
+        fi
+    fi
+done
diff --git a/meta-oe/recipes-support/asio/asio_1.30.2.bb b/meta-oe/recipes-support/asio/asio_1.30.2.bb
index 6930381ec..ae0baadc6 100644
--- a/meta-oe/recipes-support/asio/asio_1.30.2.bb
+++ b/meta-oe/recipes-support/asio/asio_1.30.2.bb
@@ -8,9 +8,11 @@  LICENSE = "BSL-1.0"
 
 DEPENDS = "openssl"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2"
+SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2 \
+           file://run-ptest \
+"
 
-inherit autotools
+inherit autotools ptest
 
 ALLOW_EMPTY:${PN} = "1"
 
@@ -22,4 +24,16 @@  PACKAGECONFIG ??= "boost"
 
 PACKAGECONFIG[boost] = "--with-boost=${STAGING_LIBDIR},--without-boost,boost"
 
+TESTDIR = "src/tests"
+do_compile_ptest() {
+    echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
+    oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    # copy executables
+    find ${B}/${TESTDIR}/unit -type f -executable -exec cp {} ${D}${PTEST_PATH}/tests/ \;
+}
+
 BBCLASSEXTEND = "native nativesdk"