summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Weiss <simone.weiss@elektrobit.com>2022-08-12 11:39:24 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-11 11:31:52 +0100
commit34d843dada61f91ddce07bb900f71a145ebe886f (patch)
treed2179ed7ff5dad75b28ff8fa4e01c7f6486fafed
parentb28cef7e747d6a8750cb24642df60a8a3d508677 (diff)
downloadpoky-34d843dada61f91ddce07bb900f71a145ebe886f.tar.gz
json-c: Add ptest for json-c
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 and took around 20 seconds. (From OE-Core rev: 7d588d0727d49dcf04d7c3d8a4ec23ca2f6cc56d) Signed-off-by: Simone Weiß <simone.weiss@elektrobit.com> Signed-off-by: Kai Tomerius <kai.tomerius@elektrobit.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 757a5fbdeed58573c40d6e21475cc516aa49fd1c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/conf/distro/include/ptest-packagelists.inc1
-rw-r--r--meta/recipes-devtools/json-c/json-c/run-ptest20
-rw-r--r--meta/recipes-devtools/json-c/json-c_0.15.bb16
3 files changed, 35 insertions, 2 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index a65c048984..5bcff83093 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -22,6 +22,7 @@ PTESTS_FAST = "\
22 gettext-ptest \ 22 gettext-ptest \
23 glib-networking-ptest \ 23 glib-networking-ptest \
24 gzip-ptest \ 24 gzip-ptest \
25 json-c-ptest \
25 json-glib-ptest \ 26 json-glib-ptest \
26 libconvert-asn1-perl-ptest \ 27 libconvert-asn1-perl-ptest \
27 liberror-perl-ptest \ 28 liberror-perl-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 @@
1#!/bin/sh
2
3# This script is used to run json-c test suites
4cd tests
5
6ret_val=0
7for i in test*.test; do
8 # test_basic is not an own testcase, just
9 # contains common code of other tests
10 if [ "$i" != "test_basic.test" ]; then
11 if ./$i > json-c_test.log 2>&1 ; then
12 echo PASS: $i
13 else
14 ret_val=1
15 echo FAIL: $i
16 fi
17 fi
18done
19
20exit $ret_val
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..7cbed55b3b 100644
--- a/meta/recipes-devtools/json-c/json-c_0.15.bb
+++ b/meta/recipes-devtools/json-c/json-c_0.15.bb
@@ -4,7 +4,10 @@ HOMEPAGE = "https://github.com/json-c/json-c/wiki"
4LICENSE = "MIT" 4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2" 5LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
6 6
7SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz" 7SRC_URI = " \
8 https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
9 file://run-ptest \
10"
8 11
9SRC_URI[sha256sum] = "b8d80a1ddb718b3ba7492916237bbf86609e9709fb007e7f7d4322f02341a4c6" 12SRC_URI[sha256sum] = "b8d80a1ddb718b3ba7492916237bbf86609e9709fb007e7f7d4322f02341a4c6"
10 13
@@ -13,6 +16,15 @@ UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+)-\d+"
13 16
14RPROVIDES:${PN} = "libjson" 17RPROVIDES:${PN} = "libjson"
15 18
16inherit cmake 19inherit cmake ptest
20
21do_install_ptest() {
22 install -d ${D}/${PTEST_PATH}/tests
23 install ${B}/tests/test* ${D}/${PTEST_PATH}/tests
24 install ${S}/tests/*.test ${D}/${PTEST_PATH}/tests
25 install ${S}/tests/*.expected ${D}/${PTEST_PATH}/tests
26 install ${S}/tests/test-defs.sh ${D}/${PTEST_PATH}/tests
27 install ${S}/tests/valid*json ${D}/${PTEST_PATH}/tests
28}
17 29
18BBCLASSEXTEND = "native nativesdk" 30BBCLASSEXTEND = "native nativesdk"