openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] json-c: Add ptest for json-c
@ 2022-08-10 19:39 Simone Weiss
  2022-08-11  8:23 ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 5+ messages in thread
From: Simone Weiss @ 2022-08-10 19:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Simone Weiss, Kai Tomerius

Adapt json-c recipe to compile and deploy a ptest for json-c.
Also add a small script for executing the tests.
All tests were successful on a trial

Signed-off-by: Simone Weiß <simone.weiss@elektrobit.com>
Signed-off-by: Kai Tomerius <kai.tomerius@elektrobit.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 meta/recipes-devtools/json-c/json-c/run-ptest | 20 +++++++++++++++++++
 meta/recipes-devtools/json-c/json-c_0.16.bb   | 16 +++++++++++++--
 3 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/json-c/json-c/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 6c4339e3e1..ec82df65a2 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -87,6 +87,7 @@ PTESTS_SLOW = "\
     findutils-ptest \
     glib-2.0-ptest \
     gstreamer1.0-ptest \
+    json-c-ptest \
     libevent-ptest \
     libgcrypt-ptest \
     lttng-tools-ptest \
diff --git a/meta/recipes-devtools/json-c/json-c/run-ptest b/meta/recipes-devtools/json-c/json-c/run-ptest
new file mode 100644
index 0000000000..9ee6095ea2
--- /dev/null
+++ b/meta/recipes-devtools/json-c/json-c/run-ptest
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# This script is used to run json-c test suites
+cd tests
+
+ret_val=0
+for i in test*.test; do
+    # test_basic is not an own testcase, just
+    # contains common code of other tests
+    if [ "$i" != "test_basic.test" ]; then
+        if ./$i > json-c_test.log 2>&1 ; then
+            echo PASS: $i
+        else
+            ret_val=1
+            echo FAIL: $i
+        fi
+    fi
+done
+
+exit $ret_val
diff --git a/meta/recipes-devtools/json-c/json-c_0.16.bb b/meta/recipes-devtools/json-c/json-c_0.16.bb
index fdec5ec9af..50431081bb 100644
--- a/meta/recipes-devtools/json-c/json-c_0.16.bb
+++ b/meta/recipes-devtools/json-c/json-c_0.16.bb
@@ -4,7 +4,10 @@ HOMEPAGE = "https://github.com/json-c/json-c/wiki"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
 
-SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz"
+SRC_URI = " \
+    https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
+    file://run-ptest \
+"
 
 SRC_URI[sha256sum] = "8e45ac8f96ec7791eaf3bb7ee50e9c2100bbbc87b8d0f1d030c5ba8a0288d96b"
 
@@ -13,6 +16,15 @@ UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+)-\d+"
 
 RPROVIDES:${PN} = "libjson"
 
-inherit cmake
+inherit cmake ptest
+
+do_install_ptest() {
+    install -d ${D}/${PTEST_PATH}/tests
+    install ${B}/tests/test* ${D}/${PTEST_PATH}/tests
+    install ${S}/tests/*.test ${D}/${PTEST_PATH}/tests
+    install ${S}/tests/*.expected ${D}/${PTEST_PATH}/tests
+    install ${S}/tests/test-defs.sh ${D}/${PTEST_PATH}/tests
+    install ${S}/tests/valid*json ${D}/${PTEST_PATH}/tests
+}
 
 BBCLASSEXTEND = "native nativesdk"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH v2] json-c: Add ptest for json-c
  2022-08-10 19:39 [PATCH v2] json-c: Add ptest for json-c Simone Weiss
@ 2022-08-11  8:23 ` Alexander Kanavin
  2022-08-11 15:26   ` Weiß, Simone
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2022-08-11  8:23 UTC (permalink / raw)
  To: Simone Weiss; +Cc: OE-core, Kai Tomerius

On Wed, 10 Aug 2022 at 21:40, Simone Weiss <simone.weiss@elektrobit.com> wrote:
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -87,6 +87,7 @@ PTESTS_SLOW = "\
>      findutils-ptest \
>      glib-2.0-ptest \
>      gstreamer1.0-ptest \
> +    json-c-ptest \
>      libevent-ptest \
>      libgcrypt-ptest \
>      lttng-tools-ptest \

How long do the tests take to execute? Do they have to be added to the
slow list?

Alex


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH v2] json-c: Add ptest for json-c
  2022-08-11  8:23 ` [OE-core] " Alexander Kanavin
@ 2022-08-11 15:26   ` Weiß, Simone
  2022-08-11 15:41     ` Alexander Kanavin
  0 siblings, 1 reply; 5+ messages in thread
From: Weiß, Simone @ 2022-08-11 15:26 UTC (permalink / raw)
  To: alex.kanavin; +Cc: openembedded-core, Tomerius, Kai

Hi,

For me it took around ~500 seconds. I considered it as slow, as
`PTESTS_FAST` should take around ~30 seconds according to the comment
on ptest-packagelists.inc.

Simone
On Thu, 2022-08-11 at 10:23 +0200, Alexander Kanavin via
lists.openembedded.org wrote:
> CAUTION: This email originated from outside of the Elektrobit
> organization. Do not click links or open attachments unless you
> recognize the sender and know the content is safe.
> 
> 
> On Wed, 10 Aug 2022 at 21:40, Simone Weiss <
> simone.weiss@elektrobit.com> wrote:
> > --- a/meta/conf/distro/include/ptest-packagelists.inc
> > +++ b/meta/conf/distro/include/ptest-packagelists.inc
> > @@ -87,6 +87,7 @@ PTESTS_SLOW = "\
> >      findutils-ptest \
> >      glib-2.0-ptest \
> >      gstreamer1.0-ptest \
> > +    json-c-ptest \
> >      libevent-ptest \
> >      libgcrypt-ptest \
> >      lttng-tools-ptest \
> 
> How long do the tests take to execute? Do they have to be added to
> the
> slow list?
> 
> Alex
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#169236): 
> https://lists.openembedded.org/g/openembedded-core/message/169236
> Mute This Topic: https://lists.openembedded.org/mt/92944223/6639279
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
>  [simone.weiss@elektrobit.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH v2] json-c: Add ptest for json-c
  2022-08-11 15:26   ` Weiß, Simone
@ 2022-08-11 15:41     ` Alexander Kanavin
  2022-08-11 20:08       ` Weiß, Simone
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2022-08-11 15:41 UTC (permalink / raw)
  To: Weiß, Simone; +Cc: openembedded-core, Tomerius, Kai

Just to be sure, did you use qemu with kvm option? I find it odd that
json library tests would take this long. Can you double check what
they do? We can't afford to extend ptest run time indefinitely, it's
already close to 4 hours.

Alex

On Thu, 11 Aug 2022 at 17:26, Weiß, Simone <Simone.Weiss@elektrobit.com> wrote:
>
> Hi,
>
> For me it took around ~500 seconds. I considered it as slow, as
> `PTESTS_FAST` should take around ~30 seconds according to the comment
> on ptest-packagelists.inc.
>
> Simone
> On Thu, 2022-08-11 at 10:23 +0200, Alexander Kanavin via
> lists.openembedded.org wrote:
> > CAUTION: This email originated from outside of the Elektrobit
> > organization. Do not click links or open attachments unless you
> > recognize the sender and know the content is safe.
> >
> >
> > On Wed, 10 Aug 2022 at 21:40, Simone Weiss <
> > simone.weiss@elektrobit.com> wrote:
> > > --- a/meta/conf/distro/include/ptest-packagelists.inc
> > > +++ b/meta/conf/distro/include/ptest-packagelists.inc
> > > @@ -87,6 +87,7 @@ PTESTS_SLOW = "\
> > >      findutils-ptest \
> > >      glib-2.0-ptest \
> > >      gstreamer1.0-ptest \
> > > +    json-c-ptest \
> > >      libevent-ptest \
> > >      libgcrypt-ptest \
> > >      lttng-tools-ptest \
> >
> > How long do the tests take to execute? Do they have to be added to
> > the
> > slow list?
> >
> > Alex
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#169236):
> > https://lists.openembedded.org/g/openembedded-core/message/169236
> > Mute This Topic: https://lists.openembedded.org/mt/92944223/6639279
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
> >  [simone.weiss@elektrobit.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH v2] json-c: Add ptest for json-c
  2022-08-11 15:41     ` Alexander Kanavin
@ 2022-08-11 20:08       ` Weiß, Simone
  0 siblings, 0 replies; 5+ messages in thread
From: Weiß, Simone @ 2022-08-11 20:08 UTC (permalink / raw)
  To: alex.kanavin; +Cc: openembedded-core, Tomerius, Kai

Hi,

thanks for asking this, I started qemu by using runqemu directly and
without any further arguments. With kvm the test took around 20
seconds. I'll send a new patch with adding json-c-ptest to PTEST_SLOW.

Simone
On Thu, 2022-08-11 at 17:41 +0200, Alexander Kanavin wrote:
> CAUTION: This email originated from outside of the Elektrobit
> organization. Do not click links or open attachments unless you
> recognize the sender and know the content is safe.
> 
> 
> Just to be sure, did you use qemu with kvm option? I find it odd that
> json library tests would take this long. Can you double check what
> they do? We can't afford to extend ptest run time indefinitely, it's
> already close to 4 hours.
> 
> Alex
> 
> On Thu, 11 Aug 2022 at 17:26, Weiß, Simone <
> Simone.Weiss@elektrobit.com> wrote:
> > Hi,
> > 
> > For me it took around ~500 seconds. I considered it as slow, as
> > `PTESTS_FAST` should take around ~30 seconds according to the
> > comment
> > on ptest-packagelists.inc.
> > 
> > Simone
> > On Thu, 2022-08-11 at 10:23 +0200, Alexander Kanavin via
> > lists.openembedded.org wrote:
> > > CAUTION: This email originated from outside of the Elektrobit
> > > organization. Do not click links or open attachments unless you
> > > recognize the sender and know the content is safe.
> > > 
> > > 
> > > On Wed, 10 Aug 2022 at 21:40, Simone Weiss <
> > > simone.weiss@elektrobit.com> wrote:
> > > > --- a/meta/conf/distro/include/ptest-packagelists.inc
> > > > +++ b/meta/conf/distro/include/ptest-packagelists.inc
> > > > @@ -87,6 +87,7 @@ PTESTS_SLOW = "\
> > > >      findutils-ptest \
> > > >      glib-2.0-ptest \
> > > >      gstreamer1.0-ptest \
> > > > +    json-c-ptest \
> > > >      libevent-ptest \
> > > >      libgcrypt-ptest \
> > > >      lttng-tools-ptest \
> > > 
> > > How long do the tests take to execute? Do they have to be added
> > > to
> > > the
> > > slow list?
> > > 
> > > Alex
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > Links: You receive all messages sent to this group.
> > > View/Reply Online (#169236):
> > > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.openembedded.org%2Fg%2Fopenembedded-core%2Fmessage%2F169236&amp;data=05%7C01%7C%7C74b1edadfdd144f2130608da7baffb68%7Ce764c36b012e4216910d8fd16283182d%7C0%7C0%7C637958293028921611%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=4c5U6ANVgo%2B33l1BZvhVwoCjhHKiyZZ4YKzbcLfuidY%3D&amp;reserved=0
> > > Mute This Topic: 
> > > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.openembedded.org%2Fmt%2F92944223%2F6639279&amp;data=05%7C01%7C%7C74b1edadfdd144f2130608da7baffb68%7Ce764c36b012e4216910d8fd16283182d%7C0%7C0%7C637958293028921611%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=6StEHNyTK0pteRJcUAWl5S0CqoT8BGoGZc3W%2FLEifyc%3D&amp;reserved=0
> > > Group Owner: openembedded-core+owner@lists.openembedded.org
> > > Unsubscribe: 
> > > https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.openembedded.org%2Fg%2Fopenembedded-core%2Funsub&amp;data=05%7C01%7C%7C74b1edadfdd144f2130608da7baffb68%7Ce764c36b012e4216910d8fd16283182d%7C0%7C0%7C637958293028921611%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=dpeI90EmyL5yEQ1X%2BqilpTit7xiQIKWdnikK78hp8b8%3D&amp;reserved=0
> > >  [simone.weiss@elektrobit.com]
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-11 20:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 19:39 [PATCH v2] json-c: Add ptest for json-c Simone Weiss
2022-08-11  8:23 ` [OE-core] " Alexander Kanavin
2022-08-11 15:26   ` Weiß, Simone
2022-08-11 15:41     ` Alexander Kanavin
2022-08-11 20:08       ` Weiß, Simone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).