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.we...@elektrobit.com> Signed-off-by: Kai Tomerius <kai.tomer...@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
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#169201): https://lists.openembedded.org/g/openembedded-core/message/169201 Mute This Topic: https://lists.openembedded.org/mt/92944223/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-