diff options
| -rwxr-xr-x | meta-oe/recipes-devtools/nlohmann-json/files/run-ptest | 12 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.10.5.bb | 20 |
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 | |||
| 3 | cd tests | ||
| 4 | for 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 | ||
| 12 | done | ||
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" | |||
| 7 | CVE_PRODUCT = "json-for-modern-cpp" | 7 | CVE_PRODUCT = "json-for-modern-cpp" |
| 8 | 8 | ||
| 9 | SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \ | 9 | SRC_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 | ||
| 12 | SRCREV = "4f8fba14066156b73f1189a2b8bd568bde5284c5" | 14 | SRCREV = "4f8fba14066156b73f1189a2b8bd568bde5284c5" |
| 15 | SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37" | ||
| 16 | |||
| 17 | SRCREV_FORMAT = "json-test-data" | ||
| 13 | 18 | ||
| 14 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
| 15 | 20 | ||
| 16 | inherit cmake | 21 | inherit cmake ptest |
| 17 | 22 | ||
| 18 | EXTRA_OECMAKE += "-DJSON_BuildTests=OFF" | 23 | EXTRA_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. |
| 21 | ALLOW_EMPTY:${PN} = "1" | 26 | ALLOW_EMPTY:${PN} = "1" |
| 22 | RDEPENDS:${PN}-dev = "" | 27 | RDEPENDS:${PN}-dev = "" |
| 28 | RDEPENDS:${PN}-ptest = "perl" | ||
| 23 | 29 | ||
| 24 | BBCLASSEXTEND = "native nativesdk" | 30 | BBCLASSEXTEND = "native nativesdk" |
| 25 | 31 | ||
| 32 | |||
| 33 | do_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 |
| 28 | do_install:append() { | 42 | do_install:append() { |
