public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Shaik Moin <careers.myinfo@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: careers.myinfo@gmail.com
Subject: [OE-core][scarthgap][PATCH 1/2] libpcre2: Enable Ptest Support
Date: Wed, 11 Feb 2026 12:53:21 +0530	[thread overview]
Message-ID: <20260211072322.79206-1-moins@kpit.com> (raw)

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                | 39 +++++++------------
 .../recipes-support/libpcre/libpcre2_10.43.bb | 22 +++++------
 2 files changed, 22 insertions(+), 39 deletions(-)

diff --git a/meta/recipes-support/libpcre/libpcre2/run-ptest b/meta/recipes-support/libpcre/libpcre2/run-ptest
index aefb971141..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"
@@ -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.43.bb b/meta/recipes-support/libpcre/libpcre2_10.43.bb
index f250f35584..781b5f15ba 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.43.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.43.bb
@@ -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
 }
-- 
2.34.1



             reply	other threads:[~2026-02-11  7:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11  7:23 Shaik Moin [this message]
2026-02-11  7:23 ` [OE-core][scarthgap][PATCH 2/2] libpcre2: fix RunGrepTest Failure on Busybox systems Shaik Moin
2026-02-11  8:53 ` [OE-core][scarthgap][PATCH 1/2] libpcre2: Enable Ptest Support Yoann Congal
2026-02-18  5:30   ` Shaik Moin
2026-02-18  8:01     ` Yoann Congal
2026-02-18  8:16       ` Marko, Peter
2026-02-19 14:35         ` Yoann Congal
2026-02-20  6:29           ` Shaik Moin
2026-03-06 18:52           ` Yoann Congal
  -- strict thread matches above, loose matches on Subject: below --
2026-01-20  7:36 Shaik Moin
2026-02-08 23:30 ` Yoann Congal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260211072322.79206-1-moins@kpit.com \
    --to=careers.myinfo@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox