Re: [PATCH] jq: add ptest


Qiu, Zheng
 

On 15 Sep 2022, at 12:45, Ross Burton via lists.openembedded.org wrote:
On 15 Sep 2022, at 16:11, Qiu, Zheng via lists.openembedded.org <Zheng.Qiu=windriver.com@...> wrote:
+cd /usr/lib/jq/ptest
Typically ptests assume they’ve been cd’d into here already. Also, if libdir is changed, this path is wrong.
OK.


+ln -sf /usr/bin/jq .
Much easier to just ship this symlink instead of generating it.
Seems sensible.


+./tests/optionaltest
+if [ $? -eq 0 ]; then
+ echo 'PASS: optionaltest'
+else
+ echo 'FAIL: optionaltest'
+fi
Do this as a loop to avoid repeating the same script.
Sure.


+RDEPENDS:${PN}-ptest += " valgrind"
Not sure this is useful for us: we want t to use ptest for integration testing, not development regression testing.
That seems to be true in general since there are few ptest that are depend on valgrind.
Randy and I talked about this, and in the case of running ptest after running fixing CVEs, valgrind could be useful.
Perhaps we should introduce a new DISTRO_FEATURES that enables valgrind and other memory check tools.
For now I will drop the valgrind dependency and I confirmed all tests still pass and still do useful checks.

We created an enhancement request, to track the idea:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14914


+do_install_ptest() {
+ cp -rf ${B}/tests ${D}${PTEST_PATH}
+ cp -rf ${B}/.libs ${D}${PTEST_PATH}
+ # libjq.so.* is packaged in the main jq component, so remove it from ptest
+ rm -f ${D}${PTEST_PATH}/.libs/libjq.so.*
+}
You’ll find it easier to patch the makefile to install the binaries. instead of assuming knowledge of how libtool
has built the binaries. If you’re lucky, upstream will take a patch to add an install-the-tests option.
True, but this is my first commit and what we have works. ;-)

I've looked at what I think is a good example of what you are talking about:
recipes-support/xmlsec1/xmlsec1_1.2.34.bb
do_install_ptest () {
oe_runmake -C ${S}/examples DESTDIR=${D}${PTEST_PATH} ${PTEST_EXTRA_ARGS} install-ptest
}
Randy and I will commit to working on this as a follow up patch, since meta-oe doesn't have a bug tracker.


Ross

Join {openembedded-devel@lists.openembedded.org to automatically receive all group messages.