libpcre2: Enabling Ptest support
PATCH 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 | 38 +++++++------------ .../recipes-support/libpcre/libpcre2_10.47.bb | 25 ++++++------ 2 files changed, 24 insertions(+), 39 deletions(-)
meta/recipes-support/libpcre/libpcre2/run-ptest +13 -25
@@ -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"
meta/recipes-support/libpcre/libpcre2_10.47.bb +11 -14
@@ -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 }
Signature · 1 line
2.34.1
Hi team,
Can I get update on this?
Regards,
Moin
Quoted 129 lines · Shaik Moin,
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]>--- .../libpcre/libpcre2/run-ptest | 38 +++++++------------ .../recipes-support/libpcre/libpcre2_10.47.bb | 25 ++++++------ 2 files changed, 24 insertions(+), 39 deletions(-)meta/recipes-support/libpcre/libpcre2/run-ptest +12
-18@@ -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"============================================================================"
meta/recipes-support/libpcre/libpcre2/run-ptest +0
-2-echo "Testsuite summary for PCRE" -echo"============================================================================"
meta/recipes-support/libpcre/libpcre2/run-ptest +1
-5- -if [ -n "$results" ]; then - printf "%b\n" "$results" -fi -# Summary with per-test details +# Summary echo"============================================================================"
echo "# TOTAL: $total"
echo "# PASS: $pass"meta/recipes-support/libpcre/libpcre2_10.47.bb +1
-1@@ -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 \"
meta/recipes-support/libpcre/libpcre2_10.47.bb +1
-10@@ -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 istested.
- # If not found, the test is skipped. The test program assumesfr_FRis non-UTF-8meta/recipes-support/libpcre/libpcre2_10.47.bb +9
-3- # 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
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.
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
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 12 lines · Mathieu Dubois-Briand via lists.openembedded.org
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]>---
Quoted 7 lines
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]:
Quoted 5 lines
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
[0]: https://lore.kernel.org/all/[email protected]/
Regards,
Signature · 2 lines
Yoann Congal Smile ECS