From: Poonam Jadhav Date: Mon, 16 Jun 2025 04:52:36 +0000 (+0530) Subject: libpng: Improve ptest X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5835b803acc255c227213670588dd01c5168c266;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git libpng: Improve ptest Install libpng test-suite to run it as a ptest. As the test-suite takes more than 30 seconds to run, add libpng-ptest to PTESTS_SLOW in ptest-packagelists.inc Signed-off-by: Poonam Jadhav Signed-off-by: Steve Sakoman --- diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index 5c6a30635fb..53c023bb816 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc @@ -29,7 +29,6 @@ PTESTS_FAST = "\ libnl-ptest \ libmodule-build-perl-ptest \ libpcre-ptest \ - libpng-ptest \ libssh2-ptest \ libtimedate-perl-ptest \ libtest-needs-perl-ptest \ @@ -88,6 +87,7 @@ PTESTS_SLOW = "\ glib-2.0-ptest \ gstreamer1.0-ptest \ libevent-ptest \ + libpng-ptest \ lttng-tools-ptest \ openssh-ptest \ openssl-ptest \ diff --git a/meta/recipes-multimedia/libpng/files/run-ptest b/meta/recipes-multimedia/libpng/files/run-ptest index 9ab5d0c1f4d..85051a59f52 100644 --- a/meta/recipes-multimedia/libpng/files/run-ptest +++ b/meta/recipes-multimedia/libpng/files/run-ptest @@ -2,28 +2,6 @@ set -eux -./pngfix pngtest.png &> log.txt 2>&1 +cd src -if grep -i "OK" log.txt 2>&1 ; then - echo "PASS: pngfix passed" -else - echo "FAIL: pngfix failed" -fi -rm -f log.txt - -./pngtest pngtest.png &> log.txt 2>&1 - -if grep -i "PASS" log.txt 2>&1 ; then - echo "PASS: pngtest passed" -else - echo "FAIL: pngtest failed" -fi -rm -f log.txt - -for i in pngstest timepng; do - if "./${i}" pngtest.png 2>&1; then - echo "PASS: $i" - else - echo "FAIL: $i" - fi -done +make check-TESTS diff --git a/meta/recipes-multimedia/libpng/libpng_1.6.39.bb b/meta/recipes-multimedia/libpng/libpng_1.6.39.bb index 94db1d3f6b6..011eec94a2b 100644 --- a/meta/recipes-multimedia/libpng/libpng_1.6.39.bb +++ b/meta/recipes-multimedia/libpng/libpng_1.6.39.bb @@ -13,7 +13,7 @@ LIBV = "16" SRC_URI = "\ ${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz \ file://run-ptest \ - " +" SRC_URI[sha256sum] = "1f4696ce70b4ee5f85f1e1623dc1229b210029fa4b7aee573df3e2ba7b036937" @@ -32,15 +32,42 @@ PACKAGES =+ "${PN}-tools" FILES:${PN}-tools = "${bindir}/png-fix-itxt ${bindir}/pngfix ${bindir}/pngcp" -BBCLASSEXTEND = "native nativesdk" - # CVE-2019-17371 is actually a memory leak in gif2png 2.x CVE_CHECK_IGNORE += "CVE-2019-17371" +RDEPENDS:${PN}-ptest += "make bash gawk" + do_install_ptest() { - install -m644 "${S}/pngtest.png" "${D}${PTEST_PATH}" - install -m755 "${B}/.libs/pngfix" "${D}${PTEST_PATH}" - install -m755 "${B}/.libs/pngtest" "${D}${PTEST_PATH}" - install -m755 "${B}/.libs/pngstest" "${D}${PTEST_PATH}" - install -m755 "${B}/.libs/timepng" "${D}${PTEST_PATH}" + # Install test scripts to ptest path + install -d ${D}${PTEST_PATH}/src/tests + install -m 755 ${S}/tests/* ${D}${PTEST_PATH}/src/tests + install -m 755 ${S}/test-driver ${D}${PTEST_PATH}/src + install -d ${D}${PTEST_PATH}/src/tests/scripts + install -m 755 ${S}/scripts/*.awk ${D}${PTEST_PATH}/src/tests/scripts + install -m 644 ${S}/scripts/pnglib* ${S}/scripts/*.c ${S}/scripts/*.def ${S}/scripts/macro.lst ${D}${PTEST_PATH}/src/tests/scripts + install -m 644 ${S}/scripts/pnglibconf.h.prebuilt ${D}${PTEST_PATH}/src/tests/scripts/pnglibconf.h + install -d ${D}${PTEST_PATH}/src/contrib/tools + install -m 755 ${S}/contrib/tools/*.sh ${D}${PTEST_PATH}/src/contrib/tools + install -m 644 ${S}/contrib/tools/*.c ${S}/contrib/tools/*.h ${D}${PTEST_PATH}/src/contrib/tools + + # Install .libs directory binaries to ptest path + install -m 755 ${B}/.libs/pngtest ${B}/.libs/pngstest ${B}/.libs/pngimage ${B}/.libs/pngunknown ${B}/.libs/pngvalid ${D}${PTEST_PATH}/src + + # Copy png files to ptest path + cd ${S} && find contrib -name '*.png' | cpio -pd ${D}${PTEST_PATH}/src + + # Install Makefile and png files + install -m 644 ${S}/pngtest.png ${D}${PTEST_PATH}/src + install -m 644 ${S}/*.png ${S}/*.h ${S}/*.c ${S}/*.dfa ${B}/pnglibconf.out ${S}/Makefile.am ${S}/Makefile.in ${D}${PTEST_PATH}/src/tests + + sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./' \ + -e 's/^top_srcdir = ..*/top_srcdir = \.\./' \ + -e 's/^srcdir = ..*/srcdir = \./' \ + -e 's/^Makefile: ..*/Makefile: /' \ + -e 's/check-TESTS: $(check_PROGRAMS)/check-TESTS:/g' \ + ${B}/Makefile > ${D}${PTEST_PATH}/src/Makefile + + sed -e 's|#!/bin/awk|#!/usr/bin/awk|g' -i ${D}${PTEST_PATH}/src/tests/scripts/*.awk } + +BBCLASSEXTEND = "native nativesdk"