json-c: Add ptest for json-c

Message ID 36681a90-b7d3-4332-8860-b24dd9b7a35d@denue6es011.ebgroup.elektrobit.com
State New
Headers show
Series json-c: Add ptest for json-c | expand

Commit Message

Simone Weiss May 30, 2022, 9:36 a.m. UTC
Also add a script for executing the ptests. All tests were sucessful on a trial
run.

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

Comments

Richard Purdie May 30, 2022, 9:38 a.m. UTC | #1
On Mon, 2022-05-30 at 11:36 +0200, Simone Weiss wrote:
> Also add a script for executing the ptests. All tests were sucessful on a trial
> run.
> 
> Signed-off-by: Simone Weiß <simone.weiss@elektrobit.com>
> Signed-off-by: Kai Tomerius <kai.tomerius@elektrobit.com>
> ---
>  meta/conf/distro/include/ptest-packagelists.inc |  1 +
>  meta/recipes-devtools/json-c/json-c_0.16.bb     | 15 +++++++++++++--
>  2 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> index a1ead90649..0bfcb60c76 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -22,6 +22,7 @@ PTESTS_FAST = "\
>      gettext-ptest \
>      glib-networking-ptest \
>      gzip-ptest \
> +    json-c-ptest \
>      json-glib-ptest \
>      libconvert-asn1-perl-ptest \
>      liberror-perl-ptest \
> 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..3fa5ce2c49 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,14 @@ UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+)-\d+"
>  
>  RPROVIDES:${PN} = "libjson"
>  
> -inherit cmake
> +inherit cmake ptest
> +
> +do_install_ptest() {
> +    cp -r ${B}/tests ${D}/${PTEST_PATH}
> +    cp -r ${S}/tests/*.test ${D}/${PTEST_PATH}/tests
> +    cp -r ${S}/tests/*.expected ${D}/${PTEST_PATH}/tests
> +    cp -r ${S}/tests/test-defs.sh ${D}/${PTEST_PATH}/tests
> +    cp -r ${S}/tests/valid*json ${D}/${PTEST_PATH}/tests
> +}
>  
>  BBCLASSEXTEND = "native nativesdk"


I like the idea, thanks for the patch. I think it is missing the run-
ptest file?

Cheers,

Richard
Khem Raj May 31, 2022, 3:50 p.m. UTC | #2
On Mon, May 30, 2022 at 2:36 AM Simone Weiss
<simone.weiss@elektrobit.com> wrote:
>
> Also add a script for executing the ptests. All tests were sucessful on a trial
> run.
>
> Signed-off-by: Simone Weiß <simone.weiss@elektrobit.com>
> Signed-off-by: Kai Tomerius <kai.tomerius@elektrobit.com>
> ---
>  meta/conf/distro/include/ptest-packagelists.inc |  1 +
>  meta/recipes-devtools/json-c/json-c_0.16.bb     | 15 +++++++++++++--
>  2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> index a1ead90649..0bfcb60c76 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -22,6 +22,7 @@ PTESTS_FAST = "\
>      gettext-ptest \
>      glib-networking-ptest \
>      gzip-ptest \
> +    json-c-ptest \
>      json-glib-ptest \
>      libconvert-asn1-perl-ptest \
>      liberror-perl-ptest \
> 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..3fa5ce2c49 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,14 @@ UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+)-\d+"
>
>  RPROVIDES:${PN} = "libjson"
>
> -inherit cmake
> +inherit cmake ptest
> +
> +do_install_ptest() {
> +    cp -r ${B}/tests ${D}/${PTEST_PATH}
> +    cp -r ${S}/tests/*.test ${D}/${PTEST_PATH}/tests
> +    cp -r ${S}/tests/*.expected ${D}/${PTEST_PATH}/tests
> +    cp -r ${S}/tests/test-defs.sh ${D}/${PTEST_PATH}/tests
> +    cp -r ${S}/tests/valid*json ${D}/${PTEST_PATH}/tests
> +}

cp -r may have permission issues its better to install using install utility

>
>  BBCLASSEXTEND = "native nativesdk"
> --
> 2.17.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#166275): https://lists.openembedded.org/g/openembedded-core/message/166275
> Mute This Topic: https://lists.openembedded.org/mt/91427504/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

Patch

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index a1ead90649..0bfcb60c76 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -22,6 +22,7 @@  PTESTS_FAST = "\
     gettext-ptest \
     glib-networking-ptest \
     gzip-ptest \
+    json-c-ptest \
     json-glib-ptest \
     libconvert-asn1-perl-ptest \
     liberror-perl-ptest \
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..3fa5ce2c49 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,14 @@  UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+)-\d+"
 
 RPROVIDES:${PN} = "libjson"
 
-inherit cmake
+inherit cmake ptest
+
+do_install_ptest() {
+    cp -r ${B}/tests ${D}/${PTEST_PATH}
+    cp -r ${S}/tests/*.test ${D}/${PTEST_PATH}/tests
+    cp -r ${S}/tests/*.expected ${D}/${PTEST_PATH}/tests
+    cp -r ${S}/tests/test-defs.sh ${D}/${PTEST_PATH}/tests
+    cp -r ${S}/tests/valid*json ${D}/${PTEST_PATH}/tests
+}
 
 BBCLASSEXTEND = "native nativesdk"