Add run-ptest to explicitly call 7 tests provided by jq.
In run-ptest, add a soft link to jq in ptest directory to avoid to
having patch the jq setup script, then remove the soft link before
exiting.
Signed-off-by: Zheng Qiu <zheng.qiu@...>
Signed-off-by: Randy MacLeod <randy.macleod@...>
---
meta-oe/recipes-devtools/jq/jq/run-ptest | 48 ++++++++++++++++++++++++
meta-oe/recipes-devtools/jq/jq_git.bb | 12 +++++-
2 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 meta-oe/recipes-devtools/jq/jq/run-ptest
diff --git a/meta-oe/recipes-devtools/jq/jq/run-ptest b/meta-oe/recipes-devtools/jq/jq/run-ptest
new file mode 100644
index 000000000..791179936
--- /dev/null
+++ b/meta-oe/recipes-devtools/jq/jq/run-ptest
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+cd /usr/lib/jq/ptest
+ln -sf /usr/bin/jq .
+./tests/optionaltest
+if [ $? -eq 0 ]; then
+ echo 'PASS: optionaltest'
+else
+ echo 'FAIL: optionaltest'
+fi
+./tests/mantest
+if [ $? -eq 0 ]; then
+ echo 'PASS: mantest'
+else
+ echo 'FAIL: mantest'
+fi
+./tests/jqtest
+if [ $? -eq 0 ]; then
+ echo 'PASS: jqtest'
+else
+ echo 'FAIL: jqtest'
+fi
+./tests/onigtest
+if [ $? -eq 0 ]; then
+ echo 'PASS: onigtest'
+else
+ echo 'FAIL: onigtest'
+fi
+./tests/shtest
+if [ $? -eq 0 ]; then
+ echo 'PASS: shtest'
+else
+ echo 'FAIL: shtest'
+fi
+./tests/utf8test
+if [ $? -eq 0 ]; then
+ echo 'PASS: utf8test'
+else
+ echo 'FAIL: utf8test'
+fi
+./tests/base64test
+if [ $? -eq 0 ]; then
+ echo 'PASS: base64test'
+else
+ echo 'FAIL: base64test'
+fi
+
+rm /usr/lib/jq/ptest/jq
diff --git a/meta-oe/recipes-devtools/jq/jq_git.bb b/meta-oe/recipes-devtools/jq/jq_git.bb
index f69b435e5..3e4f60348 100644
--- a/meta-oe/recipes-devtools/jq/jq_git.bb
+++ b/meta-oe/recipes-devtools/jq/jq_git.bb
@@ -12,11 +12,12 @@ PV = "1.6+git${SRCPV}"
SRC_URI = "git://github.com/stedolan/jq;protocol=https;branch=master \
file://0001-configure-Pass-_XOPEN_SOURCE-when-checking-for-strpt.patch \
file://0002-builtin-Replace-_BSD_SOURCE-with-_DEFAULT_SOURCE.patch \
+ file://run-ptest \
"
SRCREV = "cff5336ec71b6fee396a95bb0e4bea365e0cd1e8"
S = "${WORKDIR}/git"
-inherit autotools-brokensep
+inherit autotools-brokensep ptest
PACKAGECONFIG ?= "oniguruma"
@@ -27,5 +28,14 @@ PACKAGECONFIG[oniguruma] = "--with-oniguruma,--without-oniguruma,onig"
EXTRA_OECONF += " \
--disable-valgrind \
"
+RDEPENDS:${PN}-ptest += " valgrind"
+
+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.*
+}
+
BBCLASSEXTEND = "native"
--
2.33.0