| Message ID | 20250818081557.776364-1-semc.2042@gmail.com |
|---|---|
| State | New |
| Headers | show |
| Series | libmd: add ptest for 'libmd' | expand |
> On 18 Aug 2025, at 10:15, rajmohan r via lists.openembedded.org <semc.2042=gmail.com@lists.openembedded.org> wrote: > +do_install_ptest() { > + # install the test dir > + cp -rf ${B}/test/.libs/* ${D}${PTEST_PATH} > +} Instead of copying files from .libs/ (which is a libtool-specific implementation detail, and may not exist), can you use “libtool —mode install install <source> <dest>” to copy the files? This ensures that the files get relinked if needed and doesn’t rely on the internal details of how libtool is building. Ross
Hello, Le 18/08/2025 à 10:15, rajmohan r via lists.openembedded.org a écrit : > Adapt the compile 'test' phony target from Makefile and deploy as > ptest for libmd. > It takes less than 30seconds for ptest completion. > > Signed-off-by: rajmohan r <semc.2042@gmail.com> > --- > meta/conf/distro/include/ptest-packagelists.inc | 1 + > meta/recipes-support/libmd/libmd/run-ptest | 13 +++++++++++++ > meta/recipes-support/libmd/libmd_1.1.0.bb | 16 ++++++++++++++-- > 3 files changed, 28 insertions(+), 2 deletions(-) > create mode 100644 meta/recipes-support/libmd/libmd/run-ptest > > diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc > index e3099439f4..6cfafdca5a 100644 > --- a/meta/conf/distro/include/ptest-packagelists.inc > +++ b/meta/conf/distro/include/ptest-packagelists.inc > @@ -31,6 +31,7 @@ PTESTS_FAST = "\ > libconvert-asn1-perl \ > libexif \ > libgpg-error\ > + libmd \ > libnl \ > libpcre \ > libssh2 \ > diff --git a/meta/recipes-support/libmd/libmd/run-ptest b/meta/recipes-support/libmd/libmd/run-ptest > new file mode 100644 > index 0000000000..871b6a0102 > --- /dev/null > +++ b/meta/recipes-support/libmd/libmd/run-ptest > @@ -0,0 +1,13 @@ > +#!/bin/sh > + > +for testFile in $(ls); do > + if [ "$testFile" = "run-ptest" ]; then > + continue > + else > + if ./${testFile}; then > + echo "PASS: ${testFile}" > + else > + echo "FAIL: ${testFile}" > + fi > + fi > +done You should explicitly return 0 (if all tests succeeded) or 1 (if any test failed). If I read correctly, your script will always return 0 (success) because the last command run is an 'echo'. See https://docs.yoctoproject.org/dev/test-manual/ptest.html#running-ptest (that was added recently) Thanks! > diff --git a/meta/recipes-support/libmd/libmd_1.1.0.bb b/meta/recipes-support/libmd/libmd_1.1.0.bb > index dc588a0f95..223f1f1418 100644 > --- a/meta/recipes-support/libmd/libmd_1.1.0.bb > +++ b/meta/recipes-support/libmd/libmd_1.1.0.bb > @@ -8,9 +8,21 @@ HOMEPAGE = "https://www.hadrons.org/software/libmd/" > LICENSE = "BSD-3-Clause & BSD-2-Clause" > LIC_FILES_CHKSUM = "file://COPYING;md5=0436d4fb62a71f661d6e8b7812f9e1df" > > -SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz" > +SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz \ > + file://run-ptest \ > +" > SRC_URI[sha256sum] = "1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332" > > -inherit autotools > +inherit autotools ptest > + > +do_compile_ptest() { > + sed -i "/\$(MAKE) \$(AM_MAKEFLAGS) check-TESTS/d" test/Makefile > + oe_runmake check > +} > + > +do_install_ptest() { > + # install the test dir > + cp -rf ${B}/test/.libs/* ${D}${PTEST_PATH} > +} > > BBCLASSEXTEND = "native nativesdk" > > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#222035): https://lists.openembedded.org/g/openembedded-core/message/222035 > Mute This Topic: https://lists.openembedded.org/mt/114760002/4316185 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [yoann.congal@smile.fr] > -=-=-=-=-=-=-=-=-=-=-=- >
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index e3099439f4..6cfafdca5a 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc @@ -31,6 +31,7 @@ PTESTS_FAST = "\ libconvert-asn1-perl \ libexif \ libgpg-error\ + libmd \ libnl \ libpcre \ libssh2 \ diff --git a/meta/recipes-support/libmd/libmd/run-ptest b/meta/recipes-support/libmd/libmd/run-ptest new file mode 100644 index 0000000000..871b6a0102 --- /dev/null +++ b/meta/recipes-support/libmd/libmd/run-ptest @@ -0,0 +1,13 @@ +#!/bin/sh + +for testFile in $(ls); do + if [ "$testFile" = "run-ptest" ]; then + continue + else + if ./${testFile}; then + echo "PASS: ${testFile}" + else + echo "FAIL: ${testFile}" + fi + fi +done diff --git a/meta/recipes-support/libmd/libmd_1.1.0.bb b/meta/recipes-support/libmd/libmd_1.1.0.bb index dc588a0f95..223f1f1418 100644 --- a/meta/recipes-support/libmd/libmd_1.1.0.bb +++ b/meta/recipes-support/libmd/libmd_1.1.0.bb @@ -8,9 +8,21 @@ HOMEPAGE = "https://www.hadrons.org/software/libmd/" LICENSE = "BSD-3-Clause & BSD-2-Clause" LIC_FILES_CHKSUM = "file://COPYING;md5=0436d4fb62a71f661d6e8b7812f9e1df" -SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz" +SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz \ + file://run-ptest \ +" SRC_URI[sha256sum] = "1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332" -inherit autotools +inherit autotools ptest + +do_compile_ptest() { + sed -i "/\$(MAKE) \$(AM_MAKEFLAGS) check-TESTS/d" test/Makefile + oe_runmake check +} + +do_install_ptest() { + # install the test dir + cp -rf ${B}/test/.libs/* ${D}${PTEST_PATH} +} BBCLASSEXTEND = "native nativesdk"
Adapt the compile 'test' phony target from Makefile and deploy as ptest for libmd. It takes less than 30seconds for ptest completion. Signed-off-by: rajmohan r <semc.2042@gmail.com> --- meta/conf/distro/include/ptest-packagelists.inc | 1 + meta/recipes-support/libmd/libmd/run-ptest | 13 +++++++++++++ meta/recipes-support/libmd/libmd_1.1.0.bb | 16 ++++++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-support/libmd/libmd/run-ptest