mirror of
https://git.yoctoproject.org/poky
synced 2026-02-10 18:53:13 +01:00
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 (From OE-Core rev: 5835b803acc255c227213670588dd01c5168c266) Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
91d538d055
commit
0101023c28
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user