* [kirkstone][PATCH] libyaml: Add libyaml ptest
@ 2024-10-21 7:42 Virendra Thakur
2024-10-21 8:44 ` [OE-core] " Quentin Schulz
0 siblings, 1 reply; 3+ messages in thread
From: Virendra Thakur @ 2024-10-21 7:42 UTC (permalink / raw)
To: openembedded-core, wangmy; +Cc: Virendra Thakur
From: Virendra Thakur <virendrak@kpit.com>
Install libyaml test suite and run it as ptest.
The run-ptest script iterates through executable
files copied from the host, runs each on the target.
Signed-off-by: Virendra Thakur <virendrak@kpit.com>
---
.../distro/include/ptest-packagelists.inc | 1 +
.../libyaml/libyaml/example.yaml | 45 +++++++++++++++++++
.../recipes-support/libyaml/libyaml/run-ptest | 28 ++++++++++++
meta/recipes-support/libyaml/libyaml_0.2.5.bb | 25 ++++++++++-
4 files changed, 97 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-support/libyaml/libyaml/example.yaml
create mode 100644 meta/recipes-support/libyaml/libyaml/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 5c6a30635f..fcd509d6d2 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -42,6 +42,7 @@ PTESTS_FAST = "\
libxml-sax-base-perl-ptest \
libxml-simple-perl-ptest \
libxml2-ptest \
+ libyaml-ptest \
lua-ptest \
lzo-ptest \
m4-ptest \
diff --git a/meta/recipes-support/libyaml/libyaml/example.yaml b/meta/recipes-support/libyaml/libyaml/example.yaml
new file mode 100644
index 0000000000..107b2b1204
--- /dev/null
+++ b/meta/recipes-support/libyaml/libyaml/example.yaml
@@ -0,0 +1,45 @@
+# anchors yaml
+base: &base
+ name: Everyone has same name
+
+foo: &foo
+ <<: *base
+ age: 10
+
+bar: &bar
+ <<: *base
+ age: 20
+# global tag example
+%TAG ! tag:clarkevans.com,2002:
+--- !shape
+ # Use the ! handle for presenting
+ # tag:clarkevans.com,2002:circle
+- !circle
+ center: &ORIGIN {x: 73, y: 129}
+ radius: 7
+- !line
+ start: *ORIGIN
+ finish: { x: 89, y: 102 }
+- !label
+ start: *ORIGIN
+ color: 0xFFEEBB
+ text: Pretty vector drawing.
+# array example
+- member
+- member2
+# numbers example
+---
+string: "Hello"
+integer: 123
+float: 12.345
+boolean: No
+# strings example
+message: "YAML & JSON"
+# mapping example
+person:
+ name: "ramesh"
+ surname: "sharma"
+ age: 23
+#json example
+---
+{"key": ["value", 3]}
diff --git a/meta/recipes-support/libyaml/libyaml/run-ptest b/meta/recipes-support/libyaml/libyaml/run-ptest
new file mode 100644
index 0000000000..794b24c6ba
--- /dev/null
+++ b/meta/recipes-support/libyaml/libyaml/run-ptest
@@ -0,0 +1,28 @@
+#!/bin/sh
+for testlist in test-version test-reader run-emitter run-dumper run-parser run-scanner run-loader; do
+ case ${testlist} in
+ test-version|test-reader)
+ outputrun=$(./$testlist)
+ if ! echo ${outputrun}| grep -q "FAILURE"
+ then
+ echo "PASS: ${testlist}"
+ else
+ echo "FAIL : ${testlist}"
+ exit 1
+ fi
+ ;;
+ esac
+ case ${testlist} in
+ run-emitter|run-dumper|run-parser|run-scanner|run-loader)
+ outputrun=$(./$testlist example.yaml)
+ echo $outputrun
+ if ! echo ${outputrun}| grep "FAILURE ([1-50]"
+ then
+ echo "PASS: ${testlist}"
+ else
+ echo "FAIL : ${testlist}"
+ exit 1
+ fi
+ ;;
+ esac
+done
diff --git a/meta/recipes-support/libyaml/libyaml_0.2.5.bb b/meta/recipes-support/libyaml/libyaml_0.2.5.bb
index 514c60779c..3e8b74e5fa 100644
--- a/meta/recipes-support/libyaml/libyaml_0.2.5.bb
+++ b/meta/recipes-support/libyaml/libyaml_0.2.5.bb
@@ -7,13 +7,34 @@ SECTION = "libs/devel"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://License;md5=7bbd28caa69f81f5cd5f48647236663d"
-SRC_URI = "https://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz"
+SRC_URI = "https://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz \
+ file://run-ptest \
+ file://example.yaml \
+ "
SRC_URI[md5sum] = "bb15429d8fb787e7d3f1c83ae129a999"
SRC_URI[sha256sum] = "c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4"
+SRC_URI[run-ptest.md5sum] = "040b47d9b00d2ddbc707792ff6626243"
+SRC_URI[run-ptest.sha256sum] = "71030494ab116f1c31bf125de9d5fbe2f01aacf4daada36b44202be135a80964"
+SRC_URI[example.yaml.md5sum] = "d7f8a342650b153d219431633b0c383b"
+SRC_URI[example.yaml.sha256sum] = "d7c50b29716fcc7445e181c7d7043d70f8e58096793dc1f351c8e7f41034f813"
S = "${WORKDIR}/yaml-${PV}"
-inherit autotools
+inherit autotools ptest
+
+do_compile_ptest() {
+ sed -i "/\$(MAKE) \$(AM_MAKEFLAGS) check-TESTS/d" tests/Makefile
+ oe_runmake check
+}
+
+do_install_ptest() {
+ # install the tests dir
+ cp -rf ${B}/tests/.libs/* ${D}${PTEST_PATH}
+ install -m 755 ${WORKDIR}/example.yaml ${D}${PTEST_PATH}
+
+}
+
+RDEPENDS:${PN}-ptest += "make bash"
DISABLE_STATIC:class-nativesdk = ""
DISABLE_STATIC:class-native = ""
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [kirkstone][PATCH] libyaml: Add libyaml ptest
2024-10-21 7:42 [kirkstone][PATCH] libyaml: Add libyaml ptest Virendra Thakur
@ 2024-10-21 8:44 ` Quentin Schulz
2024-10-21 10:38 ` Alexander Kanavin
0 siblings, 1 reply; 3+ messages in thread
From: Quentin Schulz @ 2024-10-21 8:44 UTC (permalink / raw)
To: thakur.virendra1810, openembedded-core, wangmy; +Cc: Virendra Thakur
Hi Virendra,
On 10/21/24 9:42 AM, virendra thakur via lists.openembedded.org wrote:
> From: Virendra Thakur <virendrak@kpit.com>
>
> Install libyaml test suite and run it as ptest.
> The run-ptest script iterates through executable
> files copied from the host, runs each on the target.
>
Is there a reason this is targeted towards kirkstone and not master? We
have some rules for patches going into non-master branches, c.f.
https://docs.yoctoproject.org/contributor-guide/submit-changes.html#submitting-changes-to-stable-release-branches
Cheers,
Quentin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [kirkstone][PATCH] libyaml: Add libyaml ptest
2024-10-21 8:44 ` [OE-core] " Quentin Schulz
@ 2024-10-21 10:38 ` Alexander Kanavin
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kanavin @ 2024-10-21 10:38 UTC (permalink / raw)
To: quentin.schulz
Cc: thakur.virendra1810, openembedded-core, wangmy, Virendra Thakur
Also this needs to explain where example.yaml is taken from. Is there
an upstream location we could put into SRC_URI instead?
Alex
On Mon, 21 Oct 2024 at 10:44, Quentin Schulz via
lists.openembedded.org
<quentin.schulz=cherry.de@lists.openembedded.org> wrote:
>
> Hi Virendra,
>
> On 10/21/24 9:42 AM, virendra thakur via lists.openembedded.org wrote:
> > From: Virendra Thakur <virendrak@kpit.com>
> >
> > Install libyaml test suite and run it as ptest.
> > The run-ptest script iterates through executable
> > files copied from the host, runs each on the target.
> >
>
> Is there a reason this is targeted towards kirkstone and not master? We
> have some rules for patches going into non-master branches, c.f.
> https://docs.yoctoproject.org/contributor-guide/submit-changes.html#submitting-changes-to-stable-release-branches
>
> Cheers,
> Quentin
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#206098): https://lists.openembedded.org/g/openembedded-core/message/206098
> Mute This Topic: https://lists.openembedded.org/mt/109128334/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-21 10:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 7:42 [kirkstone][PATCH] libyaml: Add libyaml ptest Virendra Thakur
2024-10-21 8:44 ` [OE-core] " Quentin Schulz
2024-10-21 10:38 ` Alexander Kanavin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox