diff --git a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb index 21d07a1a263..aef3a05392b 100644 --- a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb +++ b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb @@ -982,6 +982,7 @@ RDEPENDS:packagegroup-meta-oe-ptest-packages = "\ poco-ptest \ cmocka-ptest \ minicoredumper-ptest \ + hiredis-ptest \ " RDEPENDS:packagegroup-meta-oe-ptest-packages:append:x86 = " mcelog-ptest" RDEPENDS:packagegroup-meta-oe-ptest-packages:append:x86-64 = " mcelog-ptest" diff --git a/meta-oe/recipes-extended/hiredis/hiredis/run-ptest b/meta-oe/recipes-extended/hiredis/hiredis/run-ptest new file mode 100644 index 00000000000..59b747dbd82 --- /dev/null +++ b/meta-oe/recipes-extended/hiredis/hiredis/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +TEST_SSL=0 TEST_ASYNC=0 ./test.sh diff --git a/meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb b/meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb index ceae9a457a5..b3814afc716 100644 --- a/meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb +++ b/meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb @@ -4,16 +4,36 @@ SECTION = "libs" LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://COPYING;md5=d84d659a35c666d23233e54503aaea51" -SRC_URI = "git://github.com/redis/hiredis;protocol=https;branch=master" +SRC_URI = " \ + git://github.com/redis/hiredis;protocol=https;branch=master \ + file://run-ptest \ + " SRCREV = "c14775b4e48334e0262c9f168887578f4a368b5d" S = "${WORKDIR}/git" -inherit cmake +inherit cmake ptest -PACKAGECONFIG ??= "ssl" +# 'testssl' is not enabled by default as redis recipe does not build with ssl support +# option 'testssl' requires 'ssl' +PACKAGECONFIG ??= "ssl ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'test testasync', '', d)}" PACKAGECONFIG[ssl] = "-DENABLE_SSL=ON, -DENABLE_SSL=OFF, openssl" +PACKAGECONFIG[test] = "-DDISABLE_TESTS=OFF, -DDISABLE_TESTS=ON" +PACKAGECONFIG[testssl] = "-DENABLE_SSL_TESTS=ON, -DENABLE_SSL_TESTS=OFF, openssl" +PACKAGECONFIG[testasync] = "-DENABLE_ASYNC_TESTS=ON, -DENABLE_ASYNC_TESTS=OFF, libevent" + +do_install_ptest() { + install ${S}/test.sh ${D}${PTEST_PATH}/ + install ${B}/hiredis-test ${D}${PTEST_PATH}/ + if ${@bb.utils.contains('PACKAGECONFIG','testssl','true','false',d)}; then + sed -i 's/TEST_SSL=0/TEST_SSL=1/g' ${D}${PTEST_PATH}/run-ptest + fi + if ${@bb.utils.contains('PACKAGECONFIG','testasync','true','false',d)}; then + sed -i 's/TEST_ASYNC=0/TEST_ASYNC=1/g' ${D}${PTEST_PATH}/run-ptest + fi +} FILES:${PN}-dev += "${datadir}/hiredis_ssl ${prefix}/build" RDEPENDS:${PN} = "redis" +RDEPENDS:${PN}-ptest = "${@bb.utils.contains('PACKAGECONFIG', 'testssl', 'openssl-bin', '', d)}"