libpcre2: Enabling Ptest support
PATCH v2 1/1 libpcre2: Enabling Ptest support
Install libpcre2 test suite and run it as ptest.
Add tests for POSIX wrapper (pcre2posix_test), core PCRE2 engine (RunTest), and grep utility (RunGrepTest).
pcre2posix_test: Verifies the POSIX wrapper API
RunTest: Executes the core PCRE2 test suite through pcre2test
RunGrepTest: Checks pcre2grep to ensure its grepping style matching works as expected with various patterns and input files.
--- .../libpcre/libpcre2/run-ptest | 32 +++++++++++++++++++ .../recipes-support/libpcre/libpcre2_10.47.bb | 18 +++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-support/libpcre/libpcre2/run-ptest
meta/recipes-support/libpcre/libpcre2/run-ptest new file +32 -0
@@ -0,0 +1,32 @@ +#!/bin/sh + +TESTS="RunGrepTest RunTest" +total=0 +pass=0 +fail=0 + +for T in $TESTS; do + if [ -x "./$T" ]; then + echo "Running $T" + total=$((total + 1)) + if "./$T"; then + echo "PASS: $T" + pass=$((pass + 1)) + else + echo "FAIL: $T" + fail=$((fail + 1)) + fi + else + echo "SKIP: $T (not found or not executable)" + fi +done + +# Summary +echo "============================================================================" +echo "# TOTAL: $total" +echo "# PASS: $pass" +echo "# FAIL: $fail" +echo "============================================================================" + +# Exit code based on failures +[ "$fail" -eq 0 ] && exit 0 || exit 1
meta/recipes-support/libpcre/libpcre2_10.47.bb +16 -2
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://LICENCE.md;md5=6720bf3bcff57543b915c2b22e526df0 \ file://deps/sljit/LICENSE;md5=97268427d235c41c0be238ce8e5fda17 \ " -SRC_URI = "${GITHUB_BASE_URI}/download/pcre2-${PV}/pcre2-${PV}.tar.bz2" +SRC_URI = "${GITHUB_BASE_URI}/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \ + file://run-ptest \ +" GITHUB_BASE_URI = "https://github.com/PCRE2Project/pcre2/releases" UPSTREAM_CHECK_REGEX = "releases/tag/pcre2-(?P<pver>\d+(\.\d+)+)$"
@@ -28,7 +30,7 @@ DEPENDS += "bzip2 zlib" BINCONFIG = "${bindir}/pcre2-config" -inherit autotools binconfig-disabled github-releases +inherit autotools binconfig-disabled github-releases ptest EXTRA_OECONF = "\ --enable-newline-is-lf \
@@ -57,3 +59,15 @@ FILES:pcre2test = "${bindir}/pcre2test" FILES:pcre2test-doc = "${mandir}/man1/pcre2test.1" BBCLASSEXTEND = "native nativesdk" + +do_install_ptest() { + t=${D}${PTEST_PATH} + cp -r ${S}/testdata $t + + for i in pcre2posix_test pcre2grep pcre2test; do + "${B}/libtool" --mode=install install "${B}/$i" "$t" + done + for i in RunTest RunGrepTest test-driver; \ + do cp ${S}/$i $t; \ + done +}
Signature · 1 line
2.34.1
Quoted 10 lines · Shaik Moin via lists.openembedded.org
Install libpcre2 test suite and run it as ptest.
Add tests for POSIX wrapper (
pcre2posix_test), core PCRE2 engine (RunTest), and grep utility (RunGrepTest).
pcre2posix_test: Verifies the POSIX wrapper API
RunTest: Executes the core PCRE2 test suite through pcre2test
RunGrepTest: Checks pcre2grep to ensure its grepping style matching works as expected with various patterns and input files.Signed-off-by Shaik Moin <[email protected]>---
Hi Shaik,
Thanks for your patch.
This is causing some build issue:
ERROR: libpcre2-10.47-r0 do_package_qa: QA Issue: supports ptests but is not included in oe-core's ptest-packagelists.inc [missing-ptest]
ERROR: libpcre2-10.47-r0 do_package_qa: Fatal QA errors were found, failing task.
https://autobuilder.yoctoproject.org/valkyrie/#/builders/19/builds/3408
https://autobuilder.yoctoproject.org/valkyrie/#/builders/11/builds/3370
Can you have a look at it?
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com