public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: pawan <badganchipv@gmail.com>
To: openembedded-core@lists.openembedded.org, badganchipv@gmail.com
Cc: ranjitsinh.rathod@kpit.com, Anuj Chougule <Anuj.Chougule@kpit.com>
Subject: [meta][dunfell][PATCH] json-c: Add ptest
Date: Mon,  3 Apr 2023 21:56:50 +0530	[thread overview]
Message-ID: <20230403162650.695076-1-badganchipv@gmail.com> (raw)

From: Anuj Chougule <Anuj.Chougule@kpit.com>

Re-used implicit test suite and converted it into ptest.

Signed-off-by: pawan <badganchipv@gmail.com>
---
 meta/recipes-devtools/json-c/json-c/run-ptest | 14 +++++++++++++
 meta/recipes-devtools/json-c/json-c_0.15.bb   | 21 ++++++++++++++++---
 2 files changed, 32 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/json-c/json-c/run-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..570aac4588
--- /dev/null
+++ b/meta/recipes-devtools/json-c/json-c/run-ptest
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -eux
+cd tests
+for t in test1 test2 test4
+do
+    echo "Running $t.test..."
+    if "./$t.test"
+    then
+        echo "PASS:$t"
+    else
+        echo "FAIL:$t"
+    fi
+done
diff --git a/meta/recipes-devtools/json-c/json-c_0.15.bb b/meta/recipes-devtools/json-c/json-c_0.15.bb
index a4673a2f0e..4070078089 100644
--- a/meta/recipes-devtools/json-c/json-c_0.15.bb
+++ b/meta/recipes-devtools/json-c/json-c_0.15.bb
@@ -4,8 +4,9 @@ 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] = "b8d80a1ddb718b3ba7492916237bbf86609e9709fb007e7f7d4322f02341a4c6"
 
 UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/tags"
@@ -13,6 +14,20 @@ UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+)-\d+"
 
 RPROVIDES:${PN} = "libjson"
 
-inherit cmake
+inherit cmake ptest
 
 BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS_${PN}-ptest += "bash"
+
+do_compile_ptest() {
+        oe_runmake -C tests test1 test2 test4
+}
+
+do_install_ptest() {
+    mkdir "${D}${PTEST_PATH}/tests"
+    for t in test1 test2 test4; do
+        cp "${S}/tests/$t"* "${D}${PTEST_PATH}/tests/"
+    done
+    cp "${S}/tests/test-defs.sh" "${D}${PTEST_PATH}/tests/"
+}
-- 
2.38.1



             reply	other threads:[~2023-04-03 16:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 16:26 pawan [this message]
2023-04-03 16:29 ` [meta][dunfell][PATCH] json-c: Add ptest Pawan Badganchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230403162650.695076-1-badganchipv@gmail.com \
    --to=badganchipv@gmail.com \
    --cc=Anuj.Chougule@kpit.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ranjitsinh.rathod@kpit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox