diff options
| author | Zeming LIU <zeming.liu@windriver.com> | 2026-04-16 10:53:05 +0800 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-15 22:45:58 -0700 |
| commit | f23c00b163f3980c78e815dc78c7cc3c86ed99e6 (patch) | |
| tree | ba87c614bcb3ba09e2ee2c1dd603ef381e031c6d | |
| parent | 2f1a9776c7af323eea2a1d99ef260d45a5b7fa4a (diff) | |
| download | meta-openembedded-f23c00b163f3980c78e815dc78c7cc3c86ed99e6.tar.gz | |
jsoncpp: add ptest support
Add ptest support for jsoncpp to enable automated testing of the
JSON C++ library functionality.
Note:
- Tested on: WRLinux master-wr (based on meta-openembedded master)
- jsoncpp version: 1.9.7
- Unable to test on pure upstream due to poky/meta-oe branch mismatch
Test Result:
root@qemux86-64:~# ptest-runner jsoncpp
START: ptest-runner
2026-04-15T14:04
BEGIN: /usr/lib64/jsoncpp/ptest
PASS: jsoncpp_readerwriter
PASS: jsoncpp_readerwriter_json_checker
PASS: jsoncpp_test
DURATION: 122
END: /usr/lib64/jsoncpp/ptest
2026-04-15T14:06
STOP: ptest-runner
TOTAL: 1 FAIL: 0
Signed-off-by: Zeming LIU <zeming.liu@windriver.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
| -rw-r--r-- | meta-oe/conf/include/ptest-packagelists-meta-oe.inc | 1 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/files/run-ptest | 4 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb | 34 |
3 files changed, 33 insertions, 6 deletions
diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc index 0e63c6af10..0763e218bb 100644 --- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc +++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc | |||
| @@ -74,6 +74,7 @@ PTESTS_SLOW_META_OE = "\ | |||
| 74 | c-ares \ | 74 | c-ares \ |
| 75 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'freerdp', '', d)} \ | 75 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'freerdp', '', d)} \ |
| 76 | fftw \ | 76 | fftw \ |
| 77 | jsoncpp \ | ||
| 77 | libusb-compat \ | 78 | libusb-compat \ |
| 78 | mariadb \ | 79 | mariadb \ |
| 79 | postgresql \ | 80 | postgresql \ |
diff --git a/meta-oe/recipes-devtools/jsoncpp/files/run-ptest b/meta-oe/recipes-devtools/jsoncpp/files/run-ptest new file mode 100644 index 0000000000..2cb892b187 --- /dev/null +++ b/meta-oe/recipes-devtools/jsoncpp/files/run-ptest | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | cd src | ||
| 4 | ctest --force-new-ctest-process | sed -u 's/\*\*\*/ /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}' | ||
diff --git a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb index b70a84304f..797f093f33 100644 --- a/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb +++ b/meta-oe/recipes-devtools/jsoncpp/jsoncpp_1.9.7.bb | |||
| @@ -14,11 +14,33 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5d73c165a0f9e86a1342f32d19ec5926" | |||
| 14 | PE = "1" | 14 | PE = "1" |
| 15 | 15 | ||
| 16 | SRCREV = "3455302847cf1e4671f1d8f5fa953fd46a7b1404" | 16 | SRCREV = "3455302847cf1e4671f1d8f5fa953fd46a7b1404" |
| 17 | SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https;tag=${PV}" | 17 | SRC_URI = "git://github.com/open-source-parsers/jsoncpp;branch=master;protocol=https;tag=${PV} \ |
| 18 | 18 | file://run-ptest \ | |
| 19 | 19 | " | |
| 20 | inherit cmake | 20 | |
| 21 | 21 | inherit cmake ptest | |
| 22 | EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DBUILD_OBJECT_LIBS=OFF -DJSONCPP_WITH_TESTS=OFF" | 22 | |
| 23 | EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DBUILD_OBJECT_LIBS=OFF \ | ||
| 24 | ${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSONCPP_WITH_TESTS=ON -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF', '-DJSONCPP_WITH_TESTS=OFF', d)} \ | ||
| 25 | " | ||
| 26 | |||
| 27 | DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)}" | ||
| 28 | RDEPENDS:${PN}-ptest += "cmake python3-core" | ||
| 29 | |||
| 30 | do_install_ptest () { | ||
| 31 | cp -r ${B}/bin ${D}${PTEST_PATH} | ||
| 32 | cp -r ${S}/test ${D}${PTEST_PATH} | ||
| 33 | |||
| 34 | rsync -a ${B}/src ${D}${PTEST_PATH} \ | ||
| 35 | --exclude CMakeFiles \ | ||
| 36 | --exclude cmake_install.cmake \ | ||
| 37 | --exclude Makefile \ | ||
| 38 | --exclude generated | ||
| 39 | sed -i -e 's#${B}#${PTEST_PATH}#g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake` | ||
| 40 | sed -i -e 's#${S}#${PTEST_PATH}#g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake` | ||
| 41 | sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake` | ||
| 42 | sed -i -e 's#${PYTHON}#/usr/bin/python3#g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake` | ||
| 43 | sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake` | ||
| 44 | } | ||
| 23 | 45 | ||
| 24 | BBCLASSEXTEND = "native nativesdk" | 46 | BBCLASSEXTEND = "native nativesdk" |
