diff mbox series

[master] libpng: Add ptest for libpng

Message ID 20250103104625.2945957-1-sanakazi720@gmail.com
State New
Headers show
Series [master] libpng: Add ptest for libpng | expand

Commit Message

Sana Kazi Jan. 3, 2025, 10:46 a.m. UTC
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.

Signed-off-by: Sana Kazi <sanakazi720@gmail.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-multimedia/libpng/files/run-ptest | 29 +++++++++++++++++++
 .../libpng/libpng_1.6.44.bb                   | 14 +++++++--
 3 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-multimedia/libpng/files/run-ptest

Comments

Mathieu Dubois-Briand Jan. 3, 2025, 6:25 p.m. UTC | #1
On Fri Jan 3, 2025 at 11:46 AM CET, Sana Kazi via lists.openembedded.org wrote:
> 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.
>
> Signed-off-by: Sana Kazi <sanakazi720@gmail.com>
> ---

Hi,

Thanks for your patch.

It looks like something is wrong with it, as we have issues on the
autobuilder, but I fail to understand what is going on so far.

All I get is the following error message. I tried to run the same
command manually on the worker, and indeed, opkg segfaults without any
error.

ERROR: core-image-sato-1.0-r0 do_rootfs: Unable to install packages. Command '/srv/pokybuild/yocto-worker/pkgman-non-rpm/build/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /srv/pokybuild/yocto-worker/pkgman-non-rpm/build/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0/opkg.conf -t /srv/pokybuild/yocto-worker/pkgman-non-rpm/build/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0/temp/ipktemp/ -o /srv/pokybuild/yocto-worker/pkgman-non-rpm/build/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0/rootfs  --force_postinstall --prefer-arch-to-version   install locale-base-c locale-base-en-gb locale-base-en-us' returned -11:

https://valkyrie.yoctoproject.org/#/builders/67/builds/756/steps/11/logs/stdio

I believe this only happens with pkgman-non-rpm build and has reproduced
every times with this build.
diff mbox series

Patch

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index e2a90c1c2e..7b02c5fb74 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -32,6 +32,7 @@  PTESTS_FAST = "\
     libgpg-error\
     libnl \
     libpcre \
+    libpng \
     libssh2 \
     libtest-fatal-perl \
     libtest-needs-perl \
diff --git a/meta/recipes-multimedia/libpng/files/run-ptest b/meta/recipes-multimedia/libpng/files/run-ptest
new file mode 100644
index 0000000000..9ab5d0c1f4
--- /dev/null
+++ b/meta/recipes-multimedia/libpng/files/run-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
diff --git a/meta/recipes-multimedia/libpng/libpng_1.6.44.bb b/meta/recipes-multimedia/libpng/libpng_1.6.44.bb
index dce4fadc47..50f689eec4 100644
--- a/meta/recipes-multimedia/libpng/libpng_1.6.44.bb
+++ b/meta/recipes-multimedia/libpng/libpng_1.6.44.bb
@@ -10,7 +10,9 @@  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[sha256sum] = "60c4da1d5b7f0aa8d158da48e8f8afa9773c1c8baa5d21974df61f1886b8ce8e"
 
 MIRRORS += "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}${LIBV}/ ${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}${LIBV}/older-releases/"
@@ -19,7 +21,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
 ARMNEON = "${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off", d)}"
@@ -30,4 +32,12 @@  PACKAGES =+ "${PN}-tools"
 
 FILES:${PN}-tools = "${bindir}/png-fix-itxt ${bindir}/pngfix ${bindir}/pngcp"
 
+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}"
+}
+
 BBCLASSEXTEND = "native nativesdk"