From: Chi Xu <chi...@windriver.com>

Test results:
root@qemux86-64:~# ptest-runner re2 -t 7200
START: ptest-runner
2023-10-16T08:36
BEGIN: /usr/lib/re2/ptest
PASS: charclass_test
PASS: compile_test
PASS: filtered_re2_test
PASS: mimics_pcre_test
PASS: parse_test
PASS: possible_match_test
PASS: re2_test
PASS: re2_arg_test
PASS: regexp_test
PASS: required_prefix_test
PASS: search_test
PASS: set_test
PASS: simplify_test
PASS: string_generator_test
PASS: dfa_test
PASS: exhaustive1_test
PASS: exhaustive2_test
PASS: exhaustive3_test
PASS: exhaustive_test
PASS: random_test
DURATION: 2085
END: /usr/lib/re2/ptest
2023-10-16T09:11
STOP: ptest-runner
TOTAL: 1 FAIL: 0

And add re2 ptest to PTESTS_SLOW_META_OE.

Signed-off-by: Chi Xu <chi...@windriver.com>
---
 .../conf/include/ptest-packagelists-meta-oe.inc  |  1 +
 meta-oe/recipes-support/re2/re2/run-ptest        |  3 +++
 meta-oe/recipes-support/re2/re2_2023.03.01.bb    | 16 +++++++++++++---
 3 files changed, 17 insertions(+), 3 deletions(-)
 create mode 100644 meta-oe/recipes-support/re2/re2/run-ptest

diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc 
b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
index a2b2ce4bc..92a5fdbc6 100644
--- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
+++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
@@ -49,6 +49,7 @@ PTESTS_SLOW_META_OE = "\
     libusb-compat \
     rsyslog \
     mariadb \
+    re2 \
 "
 PTESTS_SLOW_META_OE:append:x86 = " kernel-selftest"
 PTESTS_SLOW_META_OE:append:x86-64 = " kernel-selftest"
diff --git a/meta-oe/recipes-support/re2/re2/run-ptest 
b/meta-oe/recipes-support/re2/re2/run-ptest
new file mode 100644
index 000000000..8bd5fd1ef
--- /dev/null
+++ b/meta-oe/recipes-support/re2/re2/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test 
+#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print 
$6": "$4; fflush();}'
diff --git a/meta-oe/recipes-support/re2/re2_2023.03.01.bb 
b/meta-oe/recipes-support/re2/re2_2023.03.01.bb
index 78bf695a4..fe210d510 100644
--- a/meta-oe/recipes-support/re2/re2_2023.03.01.bb
+++ b/meta-oe/recipes-support/re2/re2_2023.03.01.bb
@@ -6,17 +6,27 @@ LIC_FILES_CHKSUM = 
"file://LICENSE;md5=3b5c31eb512bdf3cb11ffd5713963760"
 # tag 2023-03-01
 SRCREV = "241e2e430836e80f93d704d1f06cd3e7fe3100f5"
 
-SRC_URI = "git://github.com/google/re2.git;branch=main;protocol=https"
+SRC_URI = "git://github.com/google/re2.git;branch=main;protocol=https \
+           ${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', 
d)} \
+          "
 
 S = "${WORKDIR}/git"
 
-inherit cmake
+inherit cmake ptest
+RDEPENDS:${PN}-ptest += "cmake sed"
 
 EXTRA_OECMAKE += " \
        -DBUILD_SHARED_LIBS=ON \
-       -DRE2_BUILD_TESTING=OFF \
+        ${@bb.utils.contains('PTEST_ENABLED', '1', '-DRE2_BUILD_TESTING=ON', 
'-DRE2_BUILD_TESTING=OFF', d)} \
 "
 
+do_install_ptest () {
+    cp -r ${B}/*_test ${D}${PTEST_PATH}
+    cp -r ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}
+    sed -i -e 's#${B}#${PTEST_PATH}#g' `find ${D}${PTEST_PATH} -name 
CTestTestfile.cmake`
+    sed -i -e 's#${S}#${PTEST_PATH}#g' `find ${D}${PTEST_PATH} -name 
CTestTestfile.cmake`
+}
+
 # ignore .so in /usr/lib64
 FILES:${PN} = "${libdir}"
 INSANE_SKIP:${PN} += "dev-so"
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#105548): 
https://lists.openembedded.org/g/openembedded-devel/message/105548
Mute This Topic: https://lists.openembedded.org/mt/102010876/21656
Group Owner: openembedded-devel+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to