Skip to contentSkip to conversation

Add ptest support for libexif

PATCH RESEND In review Julien Stephan 3 participants 5 messages Aug 3, 2023 – Aug 7, 2023

lore
Share & tools
lore
#0 lore raw

cover Add ptest support for libexif

Hi all,

Resending this series. The required series [1] has been merged, so this one is now ready to be merged.

Previous message:

This series add ptest support for libexif.

This series depend on [1]. This fix is required here because one of the test program, listed in check_PROGRAMS is not listed in TESTS, because it is called through a wrapper script. So we are missing one binary and we get a runtime error.

Ptest was executed on a core-image-minimal:

root@qemux86-64:~# ptest-runner libexif
START: ptest-runner
2023-07-12T15:45
BEGIN: /usr/lib/libexif/ptest
[...]
i====================
All 13 tests passed
(1 test was not run)
====================
[...]
DURATION: 35
END: /usr/lib/libexif/ptest
2023-07-12T15:45
STOP: ptest-runner
TOTAL: 1 FAIL: 0

My working branch is [2]

Best
Julien

[1]: https://lists.openembedded.org/g/openembedded-core/message/184201
[2]: https://git.yoctoproject.org/poky-contrib/log/?h=jstephan/add-libexif-ptest-support

Julien Stephan (1):
libexif: add ptest support

 .../distro/include/ptest-packagelists.inc     |  1 +
 ...-serial-tests-config-needed-by-ptest.patch | 26 ++++++++++++++++
 .../recipes-support/libexif/libexif/run-ptest |  3 ++
 .../recipes-support/libexif/libexif_0.6.24.bb | 30 ++++++++++++++++++-
 4 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libexif/libexif/0001-Add-serial-tests-config-needed-by-ptest.patch
 create mode 100644 meta/recipes-support/libexif/libexif/run-ptest

--
2.41.0

#1 lore raw

PATCH RESEND 1/1 libexif: add ptest support

adds ptest support for libexif

Ptest was executed on a core-image-minimal:

root@qemux86-64:~# ptest-runner libexif
START: ptest-runner
2023-07-12T15:45
BEGIN: /usr/lib/libexif/ptest
[...]
i====================
All 13 tests passed
(1 test was not run)
====================
[...]
DURATION: 35
END: /usr/lib/libexif/ptest
2023-07-12T15:45
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 ...-serial-tests-config-needed-by-ptest.patch | 26 ++++++++++++++++
 .../recipes-support/libexif/libexif/run-ptest |  3 ++
 .../recipes-support/libexif/libexif_0.6.24.bb | 30 ++++++++++++++++++-
 4 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libexif/libexif/0001-Add-serial-tests-config-needed-by-ptest.patch
 create mode 100644 meta/recipes-support/libexif/libexif/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 6250cf081e0..bbbef5b0431 100644
@@ -75,6 +75,7 @@ PTESTS_FAST = "\
     slang \
     wayland \
     zlib \
+    libexif \
 "
 PTESTS_FAST:append:libc-glibc = " glibc-tests"
 PTESTS_PROBLEMS:remove:libc-glibc = "glibc-tests"
meta/recipes-support/libexif/libexif/0001-Add-serial-tests-config-needed-by-ptest.patch new file +26 -0
new file mode 100644
index 00000000000..505aa073309
@@ -0,0 +1,26 @@
+From 1ee7217c8ae724d793f9a9876c3608057a2ccbf8 Mon Sep 17 00:00:00 2001
+From: Julien Stephan <[email protected]>
+Date: Tue, 11 Jul 2023 16:07:54 +0200
+Subject: [PATCH] Add serial-tests config needed by ptest
+
+Add serial-tests support, ptest needs it.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Julien Stephan <[email protected]>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index cd48047..5413907 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -16,6 +16,7 @@ AM_INIT_AUTOMAKE([
+   dist-zip
+   check-news
+   subdir-objects
++  serial-tests
+ ])
+ AM_MAINTAINER_MODE
+ 
meta/recipes-support/libexif/libexif/run-ptest new file +3 -0
new file mode 100644
index 00000000000..2d23159eb03
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -o Makefile runtest-TESTS
meta/recipes-support/libexif/libexif_0.6.24.bb +29 -1
index 367f012f8cf..27e369a89a5 100644
@@ -11,12 +11,40 @@ def version_underscore(v):
     return "_".join(v.split("."))
 
 SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libexif-${PV}.tar.bz2 \
+           file://0001-Add-serial-tests-config-needed-by-ptest.patch \
+           file://run-ptest \
            "
 
 SRC_URI[sha256sum] = "d47564c433b733d83b6704c70477e0a4067811d184ec565258ac563d8223f6ae"
 
-inherit autotools gettext github-releases
+inherit autotools gettext github-releases ptest
 
 EXTRA_OECONF += "--disable-docs"
 
+do_compile_ptest() {
+    oe_runmake -C test buildtest-TESTS
+}
+
+do_install_ptest() {
+    install ${B}/test/test*[!\.o] ${D}${PTEST_PATH}
+    for f in ${D}${PTEST_PATH}/test*; do
+        sed -i "s/\(LD_LIBRARY_PATH=\).*\(:\$LD_LIBRARY_PATH\)\"/\1.\2/" $f
+    done
+
+    install ${B}/test/Makefile ${D}${PTEST_PATH}
+    sed -i -e "/^srcdir/c srcdir = \$\{PWD\}" ${D}${PTEST_PATH}/Makefile
+
+    install -d ${D}${PTEST_PATH}/nls
+    install ${B}/test/nls/*[!\.o] ${D}${PTEST_PATH}/nls
+    install -d ${D}${PTEST_PATH}/.libs
+    install ${B}/test/.libs/* ${D}${PTEST_PATH}/.libs
+
+    install ${S}/test/*.sh ${D}${PTEST_PATH}
+
+    install -d ${D}${PTEST_PATH}/testdata
+    install ${S}/test/testdata/* ${D}${PTEST_PATH}/testdata
+}
+
+RDEPENDS:${PN}-ptest += "make bash"
+
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.41.0
#2 lore raw

Re: [OE-core] [RESEND 1/1] libexif: add ptest support

What do the tests actually do? If they test libexif functionality in isolation, is there a need to run them, if upstream does this anyway? ptests are primarily meant for integration testing, e.g. exposing issues that arise in a complete customized system.

Alex

Quoted 141 lines · Julien Stephan

adds ptest support for libexif

Ptest was executed on a core-image-minimal:

root@qemux86-64:~# ptest-runner libexif
START: ptest-runner
2023-07-12T15:45
BEGIN: /usr/lib/libexif/ptest
[...]
i====================
All 13 tests passed
(1 test was not run)
====================
[...]
DURATION: 35
END: /usr/lib/libexif/ptest
2023-07-12T15:45
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 ...-serial-tests-config-needed-by-ptest.patch | 26 ++++++++++++++++
 .../recipes-support/libexif/libexif/run-ptest |  3 ++
 .../recipes-support/libexif/libexif_0.6.24.bb | 30 ++++++++++++++++++-
 4 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libexif/libexif/0001-Add-serial-tests-config-needed-by-ptest.patch
 create mode 100644 meta/recipes-support/libexif/libexif/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 6250cf081e0..bbbef5b0431 100644
@@ -75,6 +75,7 @@ PTESTS_FAST = "\
     slang \
     wayland \
     zlib \
+    libexif \
 "
 PTESTS_FAST:append:libc-glibc = " glibc-tests"
 PTESTS_PROBLEMS:remove:libc-glibc = "glibc-tests"
meta/recipes-support/libexif/libexif/0001-Add-serial-tests-config-needed-by-ptest.patch new file +26 -0
new file mode 100644
index 00000000000..505aa073309
@@ -0,0 +1,26 @@
+From 1ee7217c8ae724d793f9a9876c3608057a2ccbf8 Mon Sep 17 00:00:00 2001
+From: Julien Stephan <[email protected]>
+Date: Tue, 11 Jul 2023 16:07:54 +0200
+Subject: [PATCH] Add serial-tests config needed by ptest
+
+Add serial-tests support, ptest needs it.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Julien Stephan <[email protected]>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index cd48047..5413907 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -16,6 +16,7 @@ AM_INIT_AUTOMAKE([
+   dist-zip
+   check-news
+   subdir-objects
++  serial-tests
+ ])
+ AM_MAINTAINER_MODE
+
meta/recipes-support/libexif/libexif/run-ptest new file +3 -0
new file mode 100644
index 00000000000..2d23159eb03
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -o Makefile runtest-TESTS
meta/recipes-support/libexif/libexif_0.6.24.bb +29 -2
index 367f012f8cf..27e369a89a5 100644
@@ -11,12 +11,40 @@ def version_underscore(v):
     return "_".join(v.split("."))
 
 SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libexif-${PV}.tar.bz2 \
+           file://0001-Add-serial-tests-config-needed-by-ptest.patch \
+           file://run-ptest \
            "
 
 SRC_URI[sha256sum] = "d47564c433b733d83b6704c70477e0a4067811d184ec565258ac563d8223f6ae"
 
-inherit autotools gettext github-releases
+inherit autotools gettext github-releases ptest
 
 EXTRA_OECONF += "--disable-docs"
 
+do_compile_ptest() {
+    oe_runmake -C test buildtest-TESTS
+}
+
+do_install_ptest() {
+    install ${B}/test/test*[!\.o] ${D}${PTEST_PATH}
+    for f in ${D}${PTEST_PATH}/test*; do
+        sed -i "s/\(LD_LIBRARY_PATH=\).*\(:\$LD_LIBRARY_PATH\)\"/\1.\2/" $f
+    done
+
+    install ${B}/test/Makefile ${D}${PTEST_PATH}
+    sed -i -e "/^srcdir/c srcdir = \$\{PWD\}" ${D}${PTEST_PATH}/Makefile
+
+    install -d ${D}${PTEST_PATH}/nls
+    install ${B}/test/nls/*[!\.o] ${D}${PTEST_PATH}/nls
+    install -d ${D}${PTEST_PATH}/.libs
+    install ${B}/test/.libs/* ${D}${PTEST_PATH}/.libs
+
+    install ${S}/test/*.sh ${D}${PTEST_PATH}
+
+    install -d ${D}${PTEST_PATH}/testdata
+    install ${S}/test/testdata/* ${D}${PTEST_PATH}/testdata
+}
+
+RDEPENDS:${PN}-ptest += "make bash"
+
 BBCLASSEXTEND = "native nativesdk"
--

2.41.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#185477): https://lists.openembedded.org/g/openembedded-core/message/185477
Mute This Topic: https://lists.openembedded.org/mt/100525801/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Re: [OE-core] [RESEND 1/1] libexif: add ptest support

Quoted 7 lines · Alexander Kanavin

What do the tests actually do? If they test libexif functionality in isolation, is there a need to run them, if upstream does this anyway? ptests are primarily meant for integration testing, e.g. exposing issues that arise in a complete customized system.

Alex

Hi Alexander,

Didn't catch this before, makes sense. I thought we would like to have ptest enabled for as many packages as possible.
From libexif github pages:

Quoted 7 lines

The short test programs in the test directory illustrates how to create valid EXIF data from scratch, how to save EXIF data and how to load EXIF data from data in memory. To run the test programs, just run make check. There are also a few simple example programs available in the contrib/examples/ directory. Don't hesitate to contact
us at <[email protected]> if you have any questions on how to use libexif.

So what should we do about this patch? just drop it? Best

Julien

Quoted 143 lines · Julien Stephan
Quoted 141 lines

adds ptest support for libexif

Ptest was executed on a core-image-minimal:

root@qemux86-64:~# ptest-runner libexif
START: ptest-runner
2023-07-12T15:45
BEGIN: /usr/lib/libexif/ptest
[...]
i====================
All 13 tests passed
(1 test was not run)
====================
[...]
DURATION: 35
END: /usr/lib/libexif/ptest
2023-07-12T15:45
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 ...-serial-tests-config-needed-by-ptest.patch | 26 ++++++++++++++++
 .../recipes-support/libexif/libexif/run-ptest |  3 ++
 .../recipes-support/libexif/libexif_0.6.24.bb | 30 ++++++++++++++++++-
 4 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libexif/libexif/0001-Add-serial-tests-config-needed-by-ptest.patch
 create mode 100644 meta/recipes-support/libexif/libexif/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 6250cf081e0..bbbef5b0431 100644
@@ -75,6 +75,7 @@ PTESTS_FAST = "\
     slang \
     wayland \
     zlib \
+    libexif \
 "
 PTESTS_FAST:append:libc-glibc = " glibc-tests"
 PTESTS_PROBLEMS:remove:libc-glibc = "glibc-tests"
meta/recipes-support/libexif/libexif/0001-Add-serial-tests-config-needed-by-ptest.patch new file +26 -0
new file mode 100644
index 00000000000..505aa073309
@@ -0,0 +1,26 @@
+From 1ee7217c8ae724d793f9a9876c3608057a2ccbf8 Mon Sep 17 00:00:00 2001
+From: Julien Stephan <[email protected]>
+Date: Tue, 11 Jul 2023 16:07:54 +0200
+Subject: [PATCH] Add serial-tests config needed by ptest
+
+Add serial-tests support, ptest needs it.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Julien Stephan <[email protected]>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index cd48047..5413907 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -16,6 +16,7 @@ AM_INIT_AUTOMAKE([
+   dist-zip
+   check-news
+   subdir-objects
++  serial-tests
+ ])
+ AM_MAINTAINER_MODE
+
meta/recipes-support/libexif/libexif/run-ptest new file +3 -0
new file mode 100644
index 00000000000..2d23159eb03
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -o Makefile runtest-TESTS
meta/recipes-support/libexif/libexif_0.6.24.bb +29 -2
index 367f012f8cf..27e369a89a5 100644
@@ -11,12 +11,40 @@ def version_underscore(v):
     return "_".join(v.split("."))
 
 SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/libexif-${PV}.tar.bz2 \
+           file://0001-Add-serial-tests-config-needed-by-ptest.patch \
+           file://run-ptest \
            "
 
 SRC_URI[sha256sum] = "d47564c433b733d83b6704c70477e0a4067811d184ec565258ac563d8223f6ae"
 
-inherit autotools gettext github-releases
+inherit autotools gettext github-releases ptest
 
 EXTRA_OECONF += "--disable-docs"
 
+do_compile_ptest() {
+    oe_runmake -C test buildtest-TESTS
+}
+
+do_install_ptest() {
+    install ${B}/test/test*[!\.o] ${D}${PTEST_PATH}
+    for f in ${D}${PTEST_PATH}/test*; do
+        sed -i "s/\(LD_LIBRARY_PATH=\).*\(:\$LD_LIBRARY_PATH\)\"/\1.\2/" $f
+    done
+
+    install ${B}/test/Makefile ${D}${PTEST_PATH}
+    sed -i -e "/^srcdir/c srcdir = \$\{PWD\}" ${D}${PTEST_PATH}/Makefile
+
+    install -d ${D}${PTEST_PATH}/nls
+    install ${B}/test/nls/*[!\.o] ${D}${PTEST_PATH}/nls
+    install -d ${D}${PTEST_PATH}/.libs
+    install ${B}/test/.libs/* ${D}${PTEST_PATH}/.libs
+
+    install ${S}/test/*.sh ${D}${PTEST_PATH}
+
+    install -d ${D}${PTEST_PATH}/testdata
+    install ${S}/test/testdata/* ${D}${PTEST_PATH}/testdata
+}
+
+RDEPENDS:${PN}-ptest += "make bash"
+
 BBCLASSEXTEND = "native nativesdk"
--

2.41.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#185477): https://lists.openembedded.org/g/openembedded-core/message/185477
Mute This Topic: https://lists.openembedded.org/mt/100525801/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw

Re: [OE-core] [RESEND 1/1] libexif: add ptest support

In reply to Alexander Kanavin
Quoted 4 lines · Alexander Kanavin

What do the tests actually do? If they test libexif functionality in isolation, is there a need to run them, if upstream does this anyway? ptests are primarily meant for integration testing, e.g. exposing issues that arise in a complete customized system.

I've noticed a few replies about this and I do disagree slightly.

ptests are useful to ensure that the recipes in question actually work. I'm sure most upstreams do test things but probably not on weirder targets like mips/powerpc or with musl.

For something like libexif, if the ptests test the library functions properly, returning the right test data for a sample for example, then that is a useful for us.

Cheers,

Richard