summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmeta-oe/recipes-devtools/nlohmann-json/files/run-ptest12
-rw-r--r--meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.10.5.bb20
2 files changed, 29 insertions, 3 deletions
diff --git a/meta-oe/recipes-devtools/nlohmann-json/files/run-ptest b/meta-oe/recipes-devtools/nlohmann-json/files/run-ptest
new file mode 100755
index 0000000000..2f00267d50
--- /dev/null
+++ b/meta-oe/recipes-devtools/nlohmann-json/files/run-ptest
@@ -0,0 +1,12 @@
1#!/bin/sh
2
3cd tests
4for atest in test-* ; do
5 rm -rf tests.log
6 ./${atest} > tests.log 2>&1
7 if [ $? = 0 ] ; then
8 echo "PASS: ${atest}"
9 else
10 echo "FAIL: ${atest}"
11 fi
12done
diff --git a/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.10.5.bb b/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.10.5.bb
index 7a1a7a9dbf..8c45949142 100644
--- a/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.10.5.bb
+++ b/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.10.5.bb
@@ -7,22 +7,36 @@ LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588"
7CVE_PRODUCT = "json-for-modern-cpp" 7CVE_PRODUCT = "json-for-modern-cpp"
8 8
9SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \ 9SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \
10 " 10 git://github.com/nlohmann/json_test_data.git;destsuffix=git/json_test_data;name=json-test-data;branch=master;protocol=https \
11 file://run-ptest \
12"
11 13
12SRCREV = "4f8fba14066156b73f1189a2b8bd568bde5284c5" 14SRCREV = "4f8fba14066156b73f1189a2b8bd568bde5284c5"
15SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37"
16
17SRCREV_FORMAT = "json-test-data"
13 18
14S = "${WORKDIR}/git" 19S = "${WORKDIR}/git"
15 20
16inherit cmake 21inherit cmake ptest
17 22
18EXTRA_OECMAKE += "-DJSON_BuildTests=OFF" 23EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSON_BuildTests=ON -DJSON_TestDataDirectory=${PTEST_PATH}/json_test_data', '-DJSON_BuildTests=OFF', d)}"
19 24
20# nlohmann-json is a header only C++ library, so the main package will be empty. 25# nlohmann-json is a header only C++ library, so the main package will be empty.
21ALLOW_EMPTY:${PN} = "1" 26ALLOW_EMPTY:${PN} = "1"
22RDEPENDS:${PN}-dev = "" 27RDEPENDS:${PN}-dev = ""
28RDEPENDS:${PN}-ptest = "perl"
23 29
24BBCLASSEXTEND = "native nativesdk" 30BBCLASSEXTEND = "native nativesdk"
25 31
32
33do_install_ptest () {
34 install -d ${D}${PTEST_PATH}/tests
35 cp -r ${S}/json_test_data/ ${D}${PTEST_PATH}/
36 cp -r ${B}/test/test-* ${D}${PTEST_PATH}/tests
37}
38
39
26# other packages commonly reference the file directly as "json.hpp" 40# other packages commonly reference the file directly as "json.hpp"
27# create symlink to allow this usage 41# create symlink to allow this usage
28do_install:append() { 42do_install:append() {