* [OE-core][kirkstone][PATCH v2 1/2] libpcre2: Enabling Ptest Support
@ 2026-02-11 7:14 Shaik Moin
2026-02-11 7:14 ` [OE-core][kirkstone][PATCH v2 2/2] libpcre2: fix RunGrepTest Failure on Busybox systems Shaik Moin
0 siblings, 1 reply; 2+ messages in thread
From: Shaik Moin @ 2026-02-11 7:14 UTC (permalink / raw)
To: openembedded-core; +Cc: careers.myinfo
Install libpcre2 test suite and run it as ptest.
Add tests for POSIX wrapper (pcre2posix_test), core PCRE2 engine (RunTest), and grep utility (RunGrepTest).
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 <moins@kpit.com>
---
.../libpcre/libpcre2/run-ptest | 37 ++++++-------------
.../recipes-support/libpcre/libpcre2_10.40.bb | 22 +++++------
2 files changed, 21 insertions(+), 38 deletions(-)
diff --git a/meta/recipes-support/libpcre/libpcre2/run-ptest b/meta/recipes-support/libpcre/libpcre2/run-ptest
index a227cdec29..2acfd17b17 100644
--- a/meta/recipes-support/libpcre/libpcre2/run-ptest
+++ b/meta/recipes-support/libpcre/libpcre2/run-ptest
@@ -1,39 +1,27 @@
#!/bin/sh
-echo "START: ptest-runner"
-date +"%Y-%m-%dT%H:%M"
-echo "BEGIN: $(pwd)"
-
-# Space-separated list of test binaries
TESTS="RunGrepTest RunTest"
-
total=0
pass=0
fail=0
-results=""
for T in $TESTS; do
- echo "Running $T"
- total=$((total + 1))
- if ./"$T"; then
- echo "PASS: $T"
- pass=$((pass + 1))
- results="${results}\nPASS: ${T}"
+ 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 "FAIL: $T"
- fail=$((fail + 1))
- results="${results}\nFAIL: ${T}"
+ echo "SKIP: $T (not found or not executable)"
fi
done
-echo "============================================================================"
-echo "Testsuite summary for PCRE"
-echo "============================================================================"
-
-if [ -n "$results" ]; then
- printf "%b\n" "$results"
-fi
-# Summary with per-test details
+# Summary
echo "============================================================================"
echo "# TOTAL: $total"
echo "# PASS: $pass"
@@ -42,4 +30,3 @@ echo "==========================================================================
# Exit code based on failures
[ "$fail" -eq 0 ] && exit 0 || exit 1
-
diff --git a/meta/recipes-support/libpcre/libpcre2_10.40.bb b/meta/recipes-support/libpcre/libpcre2_10.40.bb
index 0d7786b81c..cd9ae7563c 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.40.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.40.bb
@@ -13,7 +13,6 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=41bfb977e4933c506588724ce69bf5d2"
SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \
file://CVE-2022-41409.patch \
file://run-ptest \
- file://0001-test-Fix-head-1-Busybox.patch \
"
UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases"
@@ -61,16 +60,13 @@ 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 pcre2grep pcre2test; \
- do cp ${B}/.libs/$i $t; \
- done
- for i in RunTest RunGrepTest test-driver; \
- do cp ${S}/$i $t; \
- done
- # Skip the fr_FR locale test. If the locale fr_FR is found, it is tested.
- # If not found, the test is skipped. The test program assumes fr_FR is non-UTF-8
- # locale so the test fails if fr_FR is UTF-8 locale.
- sed -i -e 's:do3=yes:do3=no:g' ${D}${PTEST_PATH}/RunTest
+ t=${D}${PTEST_PATH}
+ cp -r ${S}/testdata $t
+
+ for i in 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
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* [OE-core][kirkstone][PATCH v2 2/2] libpcre2: fix RunGrepTest Failure on Busybox systems
2026-02-11 7:14 [OE-core][kirkstone][PATCH v2 1/2] libpcre2: Enabling Ptest Support Shaik Moin
@ 2026-02-11 7:14 ` Shaik Moin
0 siblings, 0 replies; 2+ messages in thread
From: Shaik Moin @ 2026-02-11 7:14 UTC (permalink / raw)
To: openembedded-core; +Cc: careers.myinfo
The PCRE2 RunGrepTest script uses the Gnu Coreutils form:
head -1
Busybox does not support this shorthand option and reports:
head: invalid option --'1'
which cause the grep tests fail when running ptest on yocto.
Replace head -1 with head -n 1 . This makes RunGrepTest work
correctly.
Signed-off-by: Shaik Moin <moins@kpit.com>
---
.../libpcre2/0001-test-Fix-head-1-Busybox.patch | 17 ++++++++---------
meta/recipes-support/libpcre/libpcre2_10.40.bb | 1 +
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch b/meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch
index de37888854..d17ec6a731 100644
--- a/meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch
+++ b/meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch
@@ -5,22 +5,22 @@ Subject: [PATCH] tests: Fix head options for BusyBox compatibility
BusyBox does not accept the GNU coreutils shorthand forms:
head -1
-
+
It requires:
head -n 1
-
+
This causes RunGrepTest and the grepoutput test data to fail on
Yocto-based systems that use BusyBox.
-
-Replace all occurrences of `head -1` → `head -n 1`
-
+
+Replace all occurrences of `head -1` to `head -n 1`
+
This aligns the scripts with POSIX syntax and fixes failing
grep tests in RunGrepTest (including testtrygrep).
-
+
Upstream-Status: Inappropriate [oe-specific]
Signed-off-by: Shaik Moin <moins@kpit.com>
---
-
+
diff --git a/RunGrepTest b/RunGrepTest
index 1c7bbd2..ab4f310 100755
--- a/RunGrepTest
@@ -34,5 +34,4 @@ index 1c7bbd2..ab4f310 100755
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 133 -----------------------------" >>testtrygrep
---
-2.34.1
+--
diff --git a/meta/recipes-support/libpcre/libpcre2_10.40.bb b/meta/recipes-support/libpcre/libpcre2_10.40.bb
index cd9ae7563c..1d10c2e9b8 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.40.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.40.bb
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=41bfb977e4933c506588724ce69bf5d2"
SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \
file://CVE-2022-41409.patch \
file://run-ptest \
+ file://0001-test-Fix-head-1-Busybox.patch \
"
UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases"
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-11 7:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11 7:14 [OE-core][kirkstone][PATCH v2 1/2] libpcre2: Enabling Ptest Support Shaik Moin
2026-02-11 7:14 ` [OE-core][kirkstone][PATCH v2 2/2] libpcre2: fix RunGrepTest Failure on Busybox systems Shaik Moin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox