aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZheng Qiu <zheng.qiu@windriver.com>2022-10-18 16:48:51 -0400
committerKhem Raj <raj.khem@gmail.com>2022-10-18 15:06:37 -0700
commit3eaf01fcd4fef7f37d75e2fc5b42be88186b3cbf (patch)
tree57042ce0de079bc9ff0b250d8cb19dbb151732ef
parent19963d1f5fc96b25187d69152c0d76182bd71573 (diff)
downloadmeta-openembedded-contrib-3eaf01fcd4fef7f37d75e2fc5b42be88186b3cbf.tar.gz
jq: improve ptest and disable valgrind by default
Improve ptest result formatting. In run-ptest, setting a flag to disable valgrind image unless enabled by "valgrind" PACKAGECONFIG. Requested jq for seprating make check, so in the future it can be changed to utilize Makefile and reduce redudancy. Signed-off-by: Zheng Qiu <zheng.qiu@windriver.com> Signed-off-by: Randy MacLeod <randy.macleod@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rwxr-xr-x[-rw-r--r--]meta-oe/recipes-devtools/jq/jq/run-ptest28
-rw-r--r--meta-oe/recipes-devtools/jq/jq_git.bb11
2 files changed, 34 insertions, 5 deletions
diff --git a/meta-oe/recipes-devtools/jq/jq/run-ptest b/meta-oe/recipes-devtools/jq/jq/run-ptest
index 0e4c707e96..a813958b5a 100644..100755
--- a/meta-oe/recipes-devtools/jq/jq/run-ptest
+++ b/meta-oe/recipes-devtools/jq/jq/run-ptest
@@ -1,11 +1,37 @@
#!/bin/sh
+JQ_LIB=@libdir@/jq
+LOG="${JQ_LIB}/ptest/jq_ptest_$(date +%Y%m%d-%H%M%S).log"
+
+# clean up the log file to avoid a file has the same name and has existing content
+echo "" > ${LOG}
+
+# The purpose of ptest is doing intergration test, so disable valgrind by default
+# change PACKAGECOFIG to enable valgrind.
+#export NO_VALGRIND=1
+# The --enable-valgrind configure option for jq only can be used within Makefiles,
+# and it cannot be utilized here since it also checks compile, which cannot be avoid
+# Requested enhancement to jq: https://github.com/stedolan/jq/issues/2493
+
for test in optionaltest mantest jqtest onigtest shtest utf8test base64test; do
- ./tests/${test}
+ ./tests/${test} >> ${LOG} 2>> ${LOG}
if [ $? -eq 0 ]; then
echo "PASS: ${test}"
+ echo "PASS: ${test}" >> ${LOG}
else
echo "FAIL: ${test}"
+ echo "FAIL: ${test}" >> ${LOG}
fi
done
+passed=`grep PASS: ${LOG}|wc -l`
+failed=`grep FAIL: ${LOG}|wc -l`
+skipped=`grep SKIP: ${LOG}|wc -l`
+all=$((passed + failed + skipped))
+
+( echo "=== Test Summary ==="
+ echo "TOTAL: ${all}"
+ echo "PASSED: ${passed}"
+ echo "FAILED: ${failed}"
+ echo "SKIPPED: ${skipped}"
+) | tee -a /${LOG}
diff --git a/meta-oe/recipes-devtools/jq/jq_git.bb b/meta-oe/recipes-devtools/jq/jq_git.bb
index c6634cd300..4fa98aa44f 100644
--- a/meta-oe/recipes-devtools/jq/jq_git.bb
+++ b/meta-oe/recipes-devtools/jq/jq_git.bb
@@ -24,10 +24,8 @@ PACKAGECONFIG ?= "oniguruma"
PACKAGECONFIG[docs] = "--enable-docs,--disable-docs,ruby-native"
PACKAGECONFIG[maintainer-mode] = "--enable-maintainer-mode,--disable-maintainer-mode,flex-native bison-native"
PACKAGECONFIG[oniguruma] = "--with-oniguruma,--without-oniguruma,onig"
-
-EXTRA_OECONF += " \
- --disable-valgrind \
-"
+# enable if you want ptest running under valgrind
+PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind"
do_install_ptest() {
cp -rf ${B}/tests ${D}${PTEST_PATH}
@@ -35,6 +33,11 @@ do_install_ptest() {
# 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}
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', 'true', 'false', d)}" = "false" ]; then
+ sed -i 's:#export NO_VALGRIND=1:export NO_VALGRIND=1:g' ${D}${PTEST_PATH}/run-ptest
+ fi
+ # handle multilib
+ sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
}
BBCLASSEXTEND = "native"