Date
1 - 1 of 1
[meta-oe][PATCH v3] jq: add ptest
Qiu, Zheng
Add run-ptest to run the 7 tests provided by jq.
In do_install_ptest, add a soft link to jq in the ptest directory to avoid
having to patch the jq setup script.
While the jq tests can use valgrind, it is out of scope for integration
testing.
Signed-off-by: Zheng Qiu <zheng.qiu@...>
Signed-off-by: Randy MacLeod <randy.macleod@...>
---
meta-oe/recipes-devtools/jq/jq/run-ptest | 11 +++++++++++
meta-oe/recipes-devtools/jq/jq_git.bb | 11 ++++++++++-
2 files changed, 21 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..0e4c707e9
--- /dev/null
+++ b/meta-oe/recipes-devtools/jq/jq/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+for test in optionaltest mantest jqtest onigtest shtest utf8test base64test; do
+ ./tests/${test}
+ if [ $? -eq 0 ]; then
+ echo "PASS: ${test}"
+ else
+ echo "FAIL: ${test}"
+ fi
+done
+
diff --git a/meta-oe/recipes-devtools/jq/jq_git.bb b/meta-oe/recipes-devtools/jq/jq_git.bb
index f69b435e5..c6634cd30 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"
@@ -28,4 +29,12 @@ EXTRA_OECONF += " \
--disable-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.*
+ ln -sf ${bindir}/jq ${D}${PTEST_PATH}
+}
+
BBCLASSEXTEND = "native"
--
2.33.0
In do_install_ptest, add a soft link to jq in the ptest directory to avoid
having to patch the jq setup script.
While the jq tests can use valgrind, it is out of scope for integration
testing.
Signed-off-by: Zheng Qiu <zheng.qiu@...>
Signed-off-by: Randy MacLeod <randy.macleod@...>
---
meta-oe/recipes-devtools/jq/jq/run-ptest | 11 +++++++++++
meta-oe/recipes-devtools/jq/jq_git.bb | 11 ++++++++++-
2 files changed, 21 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..0e4c707e9
--- /dev/null
+++ b/meta-oe/recipes-devtools/jq/jq/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+for test in optionaltest mantest jqtest onigtest shtest utf8test base64test; do
+ ./tests/${test}
+ if [ $? -eq 0 ]; then
+ echo "PASS: ${test}"
+ else
+ echo "FAIL: ${test}"
+ fi
+done
+
diff --git a/meta-oe/recipes-devtools/jq/jq_git.bb b/meta-oe/recipes-devtools/jq/jq_git.bb
index f69b435e5..c6634cd30 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"
@@ -28,4 +29,12 @@ EXTRA_OECONF += " \
--disable-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.*
+ ln -sf ${bindir}/jq ${D}${PTEST_PATH}
+}
+
BBCLASSEXTEND = "native"
--
2.33.0