public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [OE-core][master][PATCH] libpcre2: Enabling Ptest support
@ 2026-01-20  7:39 Shaik Moin
  2026-01-26 12:44 ` Ross Burton
  0 siblings, 1 reply; 6+ messages in thread
From: Shaik Moin @ 2026-01-20  7:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: careers.myinfo

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 grep‑style matching works as expected with various patterns and input files.

Signed-off-by: Shaik Moin <moins@kpit.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../libpcre/libpcre2/run-ptest                | 44 +++++++++++++++++++
 .../recipes-support/libpcre/libpcre2_10.47.bb | 21 ++++++++-
 3 files changed, 64 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/libpcre/libpcre2/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index fff2947177..66fc15daf7 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -34,6 +34,7 @@ PTESTS_FAST = "\
     libgpg-error\
     libnl \
     libpcre \
+    libpcre2 \
     librsvg \
     libssh2 \
     libtest-fatal-perl \
diff --git a/meta/recipes-support/libpcre/libpcre2/run-ptest b/meta/recipes-support/libpcre/libpcre2/run-ptest
new file mode 100644
index 0000000000..d7c79827bf
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre2/run-ptest
@@ -0,0 +1,44 @@
+#!/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"
+
+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}"
+    else
+        echo "FAIL: $T"
+        fail=$((fail + 1))
+        results="${results}\nFAIL:  ${T}"
+    fi
+done
+echo "============================================================================"
+echo "Testsuite summary for PCRE"
+echo "============================================================================"
+
+if [ -n "$results" ]; then
+    printf "%b\n" "$results"
+fi
+
+# Summary with per-test details
+echo "============================================================================"
+echo "# TOTAL: $total"
+echo "# PASS:  $pass"
+echo "# FAIL:  $fail"
+echo "============================================================================"
+
+# Exit code based on failures
+[ "$fail" -eq 0 ] && exit 0 || exit 1
diff --git a/meta/recipes-support/libpcre/libpcre2_10.47.bb b/meta/recipes-support/libpcre/libpcre2_10.47.bb
index 2ac249f05b..e2aa998aab 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.47.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.47.bb
@@ -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 \
@@ -56,3 +58,18 @@ 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 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
+}
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core][master][PATCH] libpcre2: Enabling Ptest support
  2026-01-20  7:39 [OE-core][master][PATCH] libpcre2: Enabling Ptest support Shaik Moin
@ 2026-01-26 12:44 ` Ross Burton
  0 siblings, 0 replies; 6+ messages in thread
From: Ross Burton @ 2026-01-26 12:44 UTC (permalink / raw)
  To: careers.myinfo@gmail.com; +Cc: openembedded-core@lists.openembedded.org

On 20 Jan 2026, at 07:39, Shaik Moin via lists.openembedded.org <careers.myinfo=gmail.com@lists.openembedded.org> wrote:
> +echo "START: ptest-runner"
> +date +"%Y-%m-%dT%H:%M"
> +echo "BEGIN: $(pwd)"


This isn’t ptest-runner, this is libpcre. You can drop these lines.

> +if [ -n "$results" ]; then
> +    printf "%b\n" "$results"
> +fi

This has already been printed, not sure I see the value of printing it again.

> +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; \

This assumes that libtool is putting temporary files in specific location. Instead, use libtool to install libtool-built binaries:

${B}/libtool —mode=install install ${B}/$i $t

> +        # 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

Probably worth filing an upstream bug about that assumption.

Ross


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [OE-core][master][PATCH] libpcre2: Enabling Ptest support
@ 2026-02-11  8:01 Shaik Moin
  2026-03-16  4:43 ` Shaik Moin
  2026-03-16  7:01 ` Mathieu Dubois-Briand
  0 siblings, 2 replies; 6+ messages in thread
From: Shaik Moin @ 2026-02-11  8:01 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).

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 <moins@kpit.com>
---
 .../libpcre/libpcre2/run-ptest                | 38 +++++++------------
 .../recipes-support/libpcre/libpcre2_10.47.bb | 25 ++++++------
 2 files changed, 24 insertions(+), 39 deletions(-)

diff --git a/meta/recipes-support/libpcre/libpcre2/run-ptest b/meta/recipes-support/libpcre/libpcre2/run-ptest
index d7c79827bf..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="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"
diff --git a/meta/recipes-support/libpcre/libpcre2_10.47.bb b/meta/recipes-support/libpcre/libpcre2_10.47.bb
index d73e8fea05..70079e0b65 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.47.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.47.bb
@@ -12,7 +12,7 @@ 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 \
 "
 
@@ -58,19 +58,16 @@ FILES:pcre2grep-doc = "${mandir}/man1/pcre2grep.1"
 FILES:pcre2test = "${bindir}/pcre2test"
 FILES:pcre2test-doc = "${mandir}/man1/pcre2test.1"
 
-BBCLASSEXTEND = "native nativesdk"+
+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
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core][master][PATCH] libpcre2: Enabling Ptest support
  2026-02-11  8:01 Shaik Moin
@ 2026-03-16  4:43 ` Shaik Moin
  2026-03-16  7:01 ` Mathieu Dubois-Briand
  1 sibling, 0 replies; 6+ messages in thread
From: Shaik Moin @ 2026-03-16  4:43 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 4315 bytes --]

Hi team,

Can I get update on this?

Regards,
Moin

On Wed, 11 Feb 2026, 1:32 pm Shaik Moin, <careers.myinfo@gmail.com> wrote:

> 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 <moins@kpit.com>
> ---
>  .../libpcre/libpcre2/run-ptest                | 38 +++++++------------
>  .../recipes-support/libpcre/libpcre2_10.47.bb | 25 ++++++------
>  2 files changed, 24 insertions(+), 39 deletions(-)
>
> diff --git a/meta/recipes-support/libpcre/libpcre2/run-ptest
> b/meta/recipes-support/libpcre/libpcre2/run-ptest
> index d7c79827bf..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="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"
> diff --git a/meta/recipes-support/libpcre/libpcre2_10.47.bb
> b/meta/recipes-support/libpcre/libpcre2_10.47.bb
> index d73e8fea05..70079e0b65 100644
> --- a/meta/recipes-support/libpcre/libpcre2_10.47.bb
> +++ b/meta/recipes-support/libpcre/libpcre2_10.47.bb
> @@ -12,7 +12,7 @@ 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 \
>  "
>
> @@ -58,19 +58,16 @@ FILES:pcre2grep-doc = "${mandir}/man1/pcre2grep.1"
>  FILES:pcre2test = "${bindir}/pcre2test"
>  FILES:pcre2test-doc = "${mandir}/man1/pcre2test.1"
>
> -BBCLASSEXTEND = "native nativesdk"+
> +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
>  }
> --
> 2.34.1
>
>

[-- Attachment #2: Type: text/html, Size: 6162 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core][master][PATCH] libpcre2: Enabling Ptest support
  2026-02-11  8:01 Shaik Moin
  2026-03-16  4:43 ` Shaik Moin
@ 2026-03-16  7:01 ` Mathieu Dubois-Briand
  2026-03-16  7:21   ` Yoann Congal
  1 sibling, 1 reply; 6+ messages in thread
From: Mathieu Dubois-Briand @ 2026-03-16  7:01 UTC (permalink / raw)
  To: careers.myinfo, openembedded-core

On Wed Feb 11, 2026 at 9:01 AM CET, Shaik Moin via lists.openembedded.org wrote:
> 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 <moins@kpit.com>
> ---

Hi Shaik,

Thanks for your patch.

Can you confirm the oe-core version your are based on? I believe the
modified file does not exist in master branch:
https://git.openembedded.org/openembedded-core/tree/meta/recipes-support/libpcre

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core][master][PATCH] libpcre2: Enabling Ptest support
  2026-03-16  7:01 ` Mathieu Dubois-Briand
@ 2026-03-16  7:21   ` Yoann Congal
  0 siblings, 0 replies; 6+ messages in thread
From: Yoann Congal @ 2026-03-16  7:21 UTC (permalink / raw)
  To: mathieu.dubois-briand, careers.myinfo, openembedded-core

On Mon Mar 16, 2026 at 8:01 AM CET, Mathieu Dubois-Briand via lists.openembedded.org wrote:
> On Wed Feb 11, 2026 at 9:01 AM CET, Shaik Moin via lists.openembedded.org wrote:
>> 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 <moins@kpit.com>
>> ---
>
> Hi Shaik,
>
> Thanks for your patch.
>
> Can you confirm the oe-core version your are based on? I believe the
> modified file does not exist in master branch:
> https://git.openembedded.org/openembedded-core/tree/meta/recipes-support/libpcre

Hello,

For stable branches, I answered[0]:
> 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/DGVX4XQ6VLWT.1HOMXA78ZXLBG@smile.fr/T/#u

[0]: https://lore.kernel.org/all/DGVXD029L9TG.2EMNRFUGNCBVF@smile.fr/

Regards,
-- 
Yoann Congal
Smile ECS



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-16  7:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-20  7:39 [OE-core][master][PATCH] libpcre2: Enabling Ptest support Shaik Moin
2026-01-26 12:44 ` Ross Burton
  -- strict thread matches above, loose matches on Subject: below --
2026-02-11  8:01 Shaik Moin
2026-03-16  4:43 ` Shaik Moin
2026-03-16  7:01 ` Mathieu Dubois-Briand
2026-03-16  7:21   ` Yoann Congal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox