Skip to contentSkip to conversation

libpcre2: Enable Ptest Support

PATCH In review Shaik Moin 3 participants 9 messages Feb 11 – Mar 6

lore
Share & tools
lore

Shaik Moin

author
#0 lore raw

PATCH 1/2 libpcre2: Enable 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                | 39 +++++++------------
 .../recipes-support/libpcre/libpcre2_10.43.bb | 22 +++++------
 2 files changed, 22 insertions(+), 39 deletions(-)
meta/recipes-support/libpcre/libpcre2/run-ptest +13 -26
index aefb971141..2acfd17b17 100644
@@ -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="pcre2posix_test RunGrepTest RunTest"
-
+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
-
meta/recipes-support/libpcre/libpcre2_10.43.bb +9 -13
index f250f35584..781b5f15ba 100644
@@ -12,7 +12,6 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=321a5eb46acae6b6c1ff2c7a866d836a"
 
 SRC_URI = "${GITHUB_BASE_URI}/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \
            file://run-ptest \
-           file://0001-test-Fix-head-1-Busybox.patch \
 "
 
 GITHUB_BASE_URI = "https://github.com/PCRE2Project/pcre2/releases"
@@ -58,16 +57,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 pcre2posix_test 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 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
author
#1 lore raw

PATCH 2/2 libpcre2: fix RunGrepTest Failure on Busybox systems

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.

---
 .../libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch    | 7 +++----
 meta/recipes-support/libpcre/libpcre2_10.43.bb             | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)
meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch +3 -4
index 68eaf037a9..e361418d94 100644
@@ -9,10 +9,10 @@ BusyBox does not accept the GNU coreutils shorthand forms:
 It requires:
   head -n 1
  
-This causes RunGrepTest test data to fail on
+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).
@@ -34,5 +34,4 @@ index 1c7bbd2..ab4f310 100755
  echo "RC=$?" >>testtrygrep
 
  echo "---------------------------- Test 133 -----------------------------" >>testtrygrep
--- 
-2.34.1
+
meta/recipes-support/libpcre/libpcre2_10.43.bb +1 -0
index 781b5f15ba..ec8676d166 100644
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=321a5eb46acae6b6c1ff2c7a866d836a"
 
 SRC_URI = "${GITHUB_BASE_URI}/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \
            file://run-ptest \
+           file://0001-test-Fix-head-1-Busybox.patch \
 "
 
 GITHUB_BASE_URI = "https://github.com/PCRE2Project/pcre2/releases"
Signature · 1 line
2.34.1
#2 lore raw
In reply to Shaik Moin
Quoted 8 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.

Quoted 5 lines
---
 .../libpcre/libpcre2/run-ptest                | 39 +++++++------------
 .../recipes-support/libpcre/libpcre2_10.43.bb | 22 +++++------
 2 files changed, 22 insertions(+), 39 deletions(-)

Thanks for the patches but, as I already wrote, adding ptest is not usually acceptable under the stable policy[0]. That also applies to your kirkstone patch.

[0]: https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS#Stable/LTS_Patch_Acceptance_Policies

Regards,

Signature · 2 lines
Yoann Congal
Smile ECS
author
#3 lore raw

Hi team,

I updated master branch patch. Please check.

Thanks!

Quoted 31 lines · Yoann Congal,
Quoted 3 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).

Quoted 4 lines

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.

Quoted 6 lines
---
 .../libpcre/libpcre2/run-ptest                | 39 +++++++------------
 .../recipes-support/libpcre/libpcre2_10.43.bb | 22 +++++------
 2 files changed, 22 insertions(+), 39 deletions(-)

Thanks for the patches but, as I already wrote, adding ptest is not usually acceptable under the stable policy[0]. That also applies to your kirkstone patch.

[0]:
https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS#Stable/LTS_Patch_Acceptance_Policies

Regards,
--
Yoann Congal
Smile ECS

#4 lore raw
Quoted 3 lines · Shaik Moin via lists.openembedded.org

Hi team,

I updated master branch patch. Please check.

Hello,

Sorry, but this patch is not acceptable on stable branches under the policy[0] regarless to its master merging status.

[0]: https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS#Stable/LTS_Patch_Acceptance_Policies

Regards,

Quoted 36 lines

Thanks!

Quoted 31 lines · Yoann Congal,
Quoted 3 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).

Quoted 4 lines

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.

Quoted 6 lines
---
 .../libpcre/libpcre2/run-ptest                | 39 +++++++------------
 .../recipes-support/libpcre/libpcre2_10.43.bb | 22 +++++------
 2 files changed, 22 insertions(+), 39 deletions(-)

Thanks for the patches but, as I already wrote, adding ptest is not usually acceptable under the stable policy[0]. That also applies to your kirkstone patch.

[0]:
https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS#Stable/LTS_Patch_Acceptance_Policies

Regards,
--
Yoann Congal
Smile ECS

Signature · 2 lines
Yoann Congal
Smile ECS
#5 lore raw

Could we add "adding/improving tests" to the allowed LTS backport items? I think we're shooting ourselves in the foot here.

Peter

Quoted 67 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Yoann Congal via lists.openembedded.org
Sent: Wednesday, February 18, 2026 9:02
To: [email protected]; [email protected]
Subject: Re: [OE-core][scarthgap][PATCH 1/2] libpcre2: Enable Ptest Support

Quoted 3 lines · Shaik Moin via lists.openembedded.org

Hi team,

I updated master branch patch. Please check.

Hello,

Sorry, but this patch is not acceptable on stable branches under the policy[0] regarless to its master merging status.

[0]:
https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS#Stable/LTS_Patch_Acc
eptance_Policies

Regards,

Quoted 29 lines

Thanks!

Quoted 24 lines · Yoann Congal,
Quoted 3 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).

Quoted 4 lines

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.

Quoted 6 lines
---
 .../libpcre/libpcre2/run-ptest                | 39 +++++++------------
 .../recipes-support/libpcre/libpcre2_10.43.bb | 22 +++++------
 2 files changed, 22 insertions(+), 39 deletions(-)

Thanks for the patches but, as I already wrote, adding ptest is not usually acceptable under the stable policy[0]. That also applies to your kirkstone patch.

[0]:

https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS#Stable/LTS_Patch_Acc
eptance_Policies

Quoted 7 lines
Quoted 7 lines

Regards,
--
Yoann Congal
Smile ECS

--
Yoann Congal
Smile ECS

#6 lore raw
Quoted 2 lines · Peter Marko

Could we add "adding/improving tests" to the allowed LTS backport items? I think we're shooting ourselves in the foot here.

FYI, I've asked the Yocto Project TSC about this.

Regards,

Signature · 2 lines
Yoann Congal
Smile ECS
author
#7 lore raw

Hi Yoann,

We are not going including this patch as per policy. I have addressed the comments of master branch and informed that here. Please review that patch.

Thanks,
Moin

Quoted 12 lines · Yoann Congal,
Quoted 2 lines · Peter Marko

Could we add "adding/improving tests" to the allowed LTS backport items? I think we're shooting ourselves in the foot here.

FYI, I've asked the Yocto Project TSC about this.

Regards,
--
Yoann Congal
Smile ECS

#8 lore raw
In reply to Yoann Congal
Quoted 5 lines · Yoann Congal
Quoted 2 lines · Peter Marko

Could we add "adding/improving tests" to the allowed LTS backport items? I think we're shooting ourselves in the foot here.

FYI, I've asked the Yocto Project TSC about this.

Hello,

I'm sorry but we decided that standalone tests like this one are not acceptable for stable inclusion.

For more detail, see "Clarification on ptest/selftest backports for stable branches"
https://lore.kernel.org/openembedded-core/[email protected]/T/#u

Regards,

Signature · 2 lines
Yoann Congal
Smile ECS