1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

libpng: Add ptest for libpng

libpng is a platform-independent library which
supports all PNG features.
This ptest executes the below binaries, parses
the png image and prints the image features.

1. pngfix - provides information about PNG image
copyrights details.

2. pngtest - tests, optimizes and optionally fixes
the zlib header in PNG files.

3. pngstest - verifies the integrity of PNG image by
dumping chunk level information.

4. timepng - provides details about PNG image chunks.

(From OE-Core rev: 843803bcc248b18cdefb29d610a1371e32e815ce)

Signed-off-by: Nikhil R <nikhil.r@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Nikhil R
2023-07-10 16:49:47 +05:30
committed by Steve Sakoman
parent 5de95d9c29
commit 7ac47c90cc
3 changed files with 43 additions and 2 deletions
@@ -26,6 +26,7 @@ PTESTS_FAST = "\
liberror-perl-ptest \
libmodule-build-perl-ptest \
libpcre-ptest \
libpng-ptest \
libtimedate-perl-ptest \
libtest-needs-perl-ptest \
liburi-perl-ptest \
@@ -0,0 +1,29 @@
#!/bin/sh
set -eux
./pngfix pngtest.png &> log.txt 2>&1
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
@@ -10,7 +10,10 @@ DEPENDS = "zlib"
LIBV = "16"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz"
SRC_URI = "\
${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz \
file://run-ptest \
"
SRC_URI[md5sum] = "015e8e15db1eecde5f2eb9eb5b6e59e9"
SRC_URI[sha256sum] = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca"
@@ -20,7 +23,7 @@ UPSTREAM_CHECK_URI = "http://libpng.org/pub/png/libpng.html"
BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
inherit autotools binconfig-disabled pkgconfig
inherit autotools binconfig-disabled pkgconfig ptest
# Work around missing symbols
EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
@@ -33,3 +36,11 @@ BBCLASSEXTEND = "native nativesdk"
# CVE-2019-17371 is actually a memory leak in gif2png 2.x
CVE_CHECK_WHITELIST += "CVE-2019-17371"
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}"
}