Re: [PATCH] jq: add ptest

Qiu, Zheng

On 15 Sep 2022, at 12:45, Ross Burton via wrote:
On 15 Sep 2022, at 16:11, Qiu, Zheng via <> 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.

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

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

+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:

+do_install_ptest() {
+ cp -rf ${B}/tests ${D}${PTEST_PATH}
+ cp -rf ${B}/.libs ${D}${PTEST_PATH}
+ #* is packaged in the main jq component, so remove it from ptest
+ rm -f ${D}${PTEST_PATH}/.libs/*
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:
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.


Join { to automatically receive all group messages.