mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-01 01:30:23 +00:00
openjpeg: add ptest support
Add ptest support to enable runtime testing of openjpeg library. Only unit tests are included, excluding tests that require external data files (NR-/CONF-/ETS-/testjp2). Tested on intel-x86-64: all 29 unit tests passed. Signed-off-by: sjiao <Shilong.Jiao@windriver.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
@@ -50,6 +50,7 @@ PTESTS_FAST_META_OE = "\
|
|||||||
nlohmann-json \
|
nlohmann-json \
|
||||||
nodejs \
|
nodejs \
|
||||||
onig \
|
onig \
|
||||||
|
openjpeg \
|
||||||
oprofile \
|
oprofile \
|
||||||
pegtl \
|
pegtl \
|
||||||
pv \
|
pv \
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Only run unit tests, exclude nonregression and conformance tests that need external data files
|
||||||
|
ctest -E "(NR-|CONF-|ETS-|testjp2)" -V | sed -u 's/\*\*\*/ /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
|
||||||
@@ -9,14 +9,48 @@ SRC_URI = "git://github.com/uclouvain/openjpeg.git;branch=master;protocol=https
|
|||||||
file://0001-Do-not-ask-cmake-to-export-binaries-they-don-t-make-.patch \
|
file://0001-Do-not-ask-cmake-to-export-binaries-they-don-t-make-.patch \
|
||||||
file://CVE-2023-39327.patch \
|
file://CVE-2023-39327.patch \
|
||||||
file://CVE-2026-6192.patch \
|
file://CVE-2026-6192.patch \
|
||||||
|
file://run-ptest \
|
||||||
"
|
"
|
||||||
SRCREV = "6c4a29b00211eb0430fa0e5e890f1ce5c80f409f"
|
SRCREV = "6c4a29b00211eb0430fa0e5e890f1ce5c80f409f"
|
||||||
|
|
||||||
inherit cmake
|
inherit cmake ptest
|
||||||
|
|
||||||
# for multilib
|
# for multilib
|
||||||
EXTRA_OECMAKE += "-DOPENJPEG_INSTALL_LIB_DIR=${@d.getVar('baselib').replace('/', '')}"
|
EXTRA_OECMAKE += "-DOPENJPEG_INSTALL_LIB_DIR=${@d.getVar('baselib').replace('/', '')}"
|
||||||
|
|
||||||
|
EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DBUILD_TESTING=ON', '', d)}"
|
||||||
|
|
||||||
FILES:${PN} += "${libdir}/openjpeg*"
|
FILES:${PN} += "${libdir}/openjpeg*"
|
||||||
|
|
||||||
|
do_install_ptest() {
|
||||||
|
install -d ${D}${PTEST_PATH}
|
||||||
|
|
||||||
|
# Install test binaries only
|
||||||
|
if [ -d ${B}/bin ]; then
|
||||||
|
install -d ${D}${PTEST_PATH}/bin
|
||||||
|
find ${B}/bin -maxdepth 1 -type f -executable ! -name "*.so*" \
|
||||||
|
-exec install -m 0755 {} ${D}${PTEST_PATH}/bin/ \;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install CTest configuration files with proper structure
|
||||||
|
if [ -d ${B}/tests ]; then
|
||||||
|
cp -r ${B}/tests ${D}${PTEST_PATH}/
|
||||||
|
fi
|
||||||
|
if [ -f ${B}/CTestTestfile.cmake ]; then
|
||||||
|
install -m 0644 ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}/
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fix all build paths in cmake files to point to ptest installation
|
||||||
|
find ${D}${PTEST_PATH} \( -name "*.cmake" -o -name "*.ctest" \) -type f -exec sed -i \
|
||||||
|
-e "s#${B}/bin#${PTEST_PATH}/bin#g" \
|
||||||
|
-e "s#${B}#${PTEST_PATH}#g" \
|
||||||
|
-e "s#${S}#${PTEST_PATH}#g" \
|
||||||
|
-e "s#${TMPDIR}#/tmp#g" \
|
||||||
|
-e "s#${STAGING_DIR_NATIVE}##g" \
|
||||||
|
-e "s#/tmp/work/[^/]*/[^/]*/[^/]*/recipe-sysroot-native/usr/bin/cmake#/usr/bin/cmake#g" \
|
||||||
|
{} +
|
||||||
|
}
|
||||||
|
|
||||||
|
RDEPENDS:${PN}-ptest += "${PN} bash cmake"
|
||||||
|
|
||||||
BBCLASSEXTEND = "native nativesdk"
|
BBCLASSEXTEND = "native nativesdk"
|
||||||
|
|||||||
Reference in New Issue
Block a user