* [OE-core][PATCH] log4cplus: add ptest support
@ 2026-11-04 8:34 Pratik Farkase
2026-11-04 18:04 ` Mathieu Dubois-Briand
2026-11-05 8:18 ` [OE-core][PATCH v2] " Pratik Farkase
0 siblings, 2 replies; 3+ messages in thread
From: Pratik Farkase @ 2026-11-04 8:34 UTC (permalink / raw)
To: openembedded-core; +Cc: pratik.farkase, Pratik Farkase
Build the GNU Autotest based test suite and run it under ptest, following
the tar ptest pattern: the generated testsuite is shipped together with
atconfig/atlocal, whose build-host paths and tool locations are rewritten
to the on-target ptest directory. The test programs use libtool -no-install,
so the real binaries are installed with libtool.
The headers-compilation group is skipped as it recompiles the public
headers, which needs a toolchain that is not present in the image.
Tested on qemuriscv64 with ptest-runner.
Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
.../distro/include/ptest-packagelists.inc | 1 +
.../log4cplus/log4cplus/run-ptest | 5 ++
.../log4cplus/log4cplus_2.2.0.1.bb | 70 ++++++++++++++++++-
3 files changed, 75 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-devtools/log4cplus/log4cplus/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index d5357d8732..f8d2cb25b0 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -63,6 +63,7 @@ PTESTS_FAST = "\
libxmlb \
libxslt \
libyaml \
+ log4cplus \
logrotate \
lttng-ust \
lua \
diff --git a/meta/recipes-devtools/log4cplus/log4cplus/run-ptest b/meta/recipes-devtools/log4cplus/log4cplus/run-ptest
new file mode 100644
index 0000000000..1f346cc8b1
--- /dev/null
+++ b/meta/recipes-devtools/log4cplus/log4cplus/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd @PTEST_PATH@/tests/
+
+./testsuite --am-fmt -k '!headers-compilation'
diff --git a/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb b/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb
index a10dd175a2..ac29017a74 100644
--- a/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb
+++ b/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb
@@ -16,6 +16,74 @@ SRC_URI[sha256sum] = "374175c22fabe752eb1c20138e732b69ae191e641f92d32c9432985cd8
UPSTREAM_CHECK_URI = "https://github.com/log4cplus/log4cplus/releases"
UPSTREAM_CHECK_REGEX = "log4cplus-(?P<pver>\d+(\.\d+)+)\.tar"
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
+
+SRC_URI += "file://run-ptest"
+
+RDEPENDS:${PN}-ptest += "bash diffutils gawk grep sed ${PN}"
+
+INSANE_SKIP:${PN}-ptest += "buildpaths"
+
+LOG4CPLUS_PTEST_TESTS = " \
+ appender_test \
+ configandwatch_test \
+ customloglevel_test \
+ fileappender_test \
+ filter_test \
+ hierarchy_test \
+ loglog_test \
+ ndc_test \
+ ostream_test \
+ patternlayout_test \
+ performance_test \
+ priority_test \
+ propertyconfig_test \
+ thread_test \
+ timeformat_test \
+ unit_tests \
+"
+
+do_compile_ptest() {
+ rm -f ${S}/tests/testsuite
+ oe_runmake -C ${B} tests/testsuite
+ for t in ${LOG4CPLUS_PTEST_TESTS}; do
+ oe_runmake -C ${B} $t ${t}U
+ done
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+
+ install -m 0755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/
+
+ install -m 0644 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
+ sed -i "/^abs_/d" ${D}${PTEST_PATH}/tests/atconfig
+ cat >> ${D}${PTEST_PATH}/tests/atconfig <<EOF
+abs_builddir='${PTEST_PATH}/tests'
+abs_srcdir='${PTEST_PATH}/tests'
+abs_top_builddir='${PTEST_PATH}'
+abs_top_srcdir='${PTEST_PATH}'
+EOF
+
+ install -m 0644 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/
+ sed -i "/^PATH=/d" ${D}${PTEST_PATH}/tests/atlocal
+ sed -i "s|^: \${GREP=.*|: \${GREP='grep'}|" ${D}${PTEST_PATH}/tests/atlocal
+ sed -i "s|^: \${AWK=.*|: \${AWK='gawk'}|" ${D}${PTEST_PATH}/tests/atlocal
+ sed -i "s|^: \${SED=.*|: \${SED='sed'}|" ${D}${PTEST_PATH}/tests/atlocal
+
+ for t in ${LOG4CPLUS_PTEST_TESTS}; do
+ ${B}/libtool --mode=install install -m 0755 ${B}/$t ${D}${PTEST_PATH}/
+ [ -e ${B}/${t}U ] && ${B}/libtool --mode=install install -m 0755 ${B}/${t}U ${D}${PTEST_PATH}/
+ install -d ${D}${PTEST_PATH}/tests/$t
+ for f in expout experr log4cplus.properties.1 log4cplus.properties.2; do
+ [ -e ${S}/tests/$t/$f ] && install -m 0644 ${S}/tests/$t/$f ${D}${PTEST_PATH}/tests/$t/
+ done
+ for f in ${B}/tests/$t/*.properties; do
+ [ -e $f ] && install -m 0644 $f ${D}${PTEST_PATH}/tests/$t/
+ done
+ done
+
+ sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/run-ptest
+}
BBCLASSEXTEND = "native"
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core][PATCH] log4cplus: add ptest support
2026-11-04 8:34 [OE-core][PATCH] log4cplus: add ptest support Pratik Farkase
@ 2026-11-04 18:04 ` Mathieu Dubois-Briand
2026-11-05 8:18 ` [OE-core][PATCH v2] " Pratik Farkase
1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2026-11-04 18:04 UTC (permalink / raw)
To: Pratik Farkase, openembedded-core; +Cc: pratik.farkase
On Wed Nov 4, 2026 at 9:34 AM CET, Pratik Farkase wrote:
> Build the GNU Autotest based test suite and run it under ptest, following
> the tar ptest pattern: the generated testsuite is shipped together with
> atconfig/atlocal, whose build-host paths and tool locations are rewritten
> to the on-target ptest directory. The test programs use libtool -no-install,
> so the real binaries are installed with libtool.
>
> The headers-compilation group is skipped as it recompiles the public
> headers, which needs a toolchain that is not present in the image.
>
> Tested on qemuriscv64 with ptest-runner.
>
> Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
> ---
Hi Pratik,
It looks like the ptest recipe is failing reproducibility tests:
AssertionError: The following deb packages are different and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/deb/./x86-64-v3/log4cplus-ptest_2.2.1-r0_amd64.deb
The following ipk packages are different and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/ipk/./x86-64-v3/log4cplus-ptest_2.2.1-r0_x86-64-v3.ipk
The following rpm packages are different and not in exclusion list:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleB-extended/tmp/deploy/rpm/./x86_64_v3/log4cplus-ptest-2.2.1-r0.x86_64_v3.rpm
https://autobuilder.yoctoproject.org/valkyrie/#/builders/37/builds/5295
Diffoscope output can be found here:
https://valkyrie.yocto.io/pub/repro-fail/oe-reproducible-20261104-ggu_ffd6/packages/diff-html/
Can you have a look at the issue?
Thanks,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [OE-core][PATCH v2] log4cplus: add ptest support
2026-11-04 8:34 [OE-core][PATCH] log4cplus: add ptest support Pratik Farkase
2026-11-04 18:04 ` Mathieu Dubois-Briand
@ 2026-11-05 8:18 ` Pratik Farkase
1 sibling, 0 replies; 3+ messages in thread
From: Pratik Farkase @ 2026-11-05 8:18 UTC (permalink / raw)
To: openembedded-core; +Cc: pratik.farkase, Pratik Farkase
Build the GNU Autotest based test suite and run it under ptest, following
the tar ptest pattern: the generated testsuite is shipped together with
atconfig/atlocal, whose build-host paths and tool locations are rewritten
to the on-target ptest directory. The test programs use libtool -no-install,
so the real binaries are installed with libtool.
Tested on qemuriscv64 with ptest-runner.
Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
Notes:
v2: Trim atlocal to the variables the on-target tests need; the dropped
compiler/flags variables embedded build paths and broke ptest package
reproducibility.
.../distro/include/ptest-packagelists.inc | 1 +
.../log4cplus/log4cplus/run-ptest | 5 ++
.../log4cplus/log4cplus_2.2.0.1.bb | 74 ++++++++++++++++++-
3 files changed, 79 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-devtools/log4cplus/log4cplus/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index d5357d8732..f8d2cb25b0 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -63,6 +63,7 @@ PTESTS_FAST = "\
libxmlb \
libxslt \
libyaml \
+ log4cplus \
logrotate \
lttng-ust \
lua \
diff --git a/meta/recipes-devtools/log4cplus/log4cplus/run-ptest b/meta/recipes-devtools/log4cplus/log4cplus/run-ptest
new file mode 100644
index 0000000000..1f346cc8b1
--- /dev/null
+++ b/meta/recipes-devtools/log4cplus/log4cplus/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd @PTEST_PATH@/tests/
+
+./testsuite --am-fmt -k '!headers-compilation'
diff --git a/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb b/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb
index a10dd175a2..91b7eddcb4 100644
--- a/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb
+++ b/meta/recipes-devtools/log4cplus/log4cplus_2.2.0.1.bb
@@ -16,6 +16,78 @@ SRC_URI[sha256sum] = "374175c22fabe752eb1c20138e732b69ae191e641f92d32c9432985cd8
UPSTREAM_CHECK_URI = "https://github.com/log4cplus/log4cplus/releases"
UPSTREAM_CHECK_REGEX = "log4cplus-(?P<pver>\d+(\.\d+)+)\.tar"
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
+
+SRC_URI += "file://run-ptest"
+
+RDEPENDS:${PN}-ptest += "bash diffutils gawk grep sed ${PN}"
+
+INSANE_SKIP:${PN}-ptest += "buildpaths"
+
+LOG4CPLUS_PTEST_TESTS = " \
+ appender_test \
+ configandwatch_test \
+ customloglevel_test \
+ fileappender_test \
+ filter_test \
+ hierarchy_test \
+ loglog_test \
+ ndc_test \
+ ostream_test \
+ patternlayout_test \
+ performance_test \
+ priority_test \
+ propertyconfig_test \
+ thread_test \
+ timeformat_test \
+ unit_tests \
+"
+
+do_compile_ptest() {
+ rm -f ${S}/tests/testsuite
+ oe_runmake -C ${B} tests/testsuite
+ for t in ${LOG4CPLUS_PTEST_TESTS}; do
+ oe_runmake -C ${B} $t ${t}U
+ done
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+
+ install -m 0755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/
+
+ install -m 0644 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
+ sed -i "/^abs_/d" ${D}${PTEST_PATH}/tests/atconfig
+ cat >> ${D}${PTEST_PATH}/tests/atconfig <<EOF
+abs_builddir='${PTEST_PATH}/tests'
+abs_srcdir='${PTEST_PATH}/tests'
+abs_top_builddir='${PTEST_PATH}'
+abs_top_srcdir='${PTEST_PATH}'
+EOF
+
+ enable_threads=$(sed -n "s|^: \${ENABLE_THREADS='\(.*\)'}|\1|p" ${B}/tests/atlocal)
+ wchar_support=$(sed -n "s|^: \${BUILD_WITH_WCHAR_T_SUPPORT='\(.*\)'}|\1|p" ${B}/tests/atlocal)
+ cat > ${D}${PTEST_PATH}/tests/atlocal <<EOF
+: \${GREP='grep'}
+: \${AWK='gawk'}
+: \${SED='sed'}
+: \${ENABLE_THREADS='$enable_threads'}
+: \${BUILD_WITH_WCHAR_T_SUPPORT='$wchar_support'}
+EOF
+
+ for t in ${LOG4CPLUS_PTEST_TESTS}; do
+ ${B}/libtool --mode=install install -m 0755 ${B}/$t ${D}${PTEST_PATH}/
+ [ -e ${B}/${t}U ] && ${B}/libtool --mode=install install -m 0755 ${B}/${t}U ${D}${PTEST_PATH}/
+ install -d ${D}${PTEST_PATH}/tests/$t
+ for f in expout experr log4cplus.properties.1 log4cplus.properties.2; do
+ [ -e ${S}/tests/$t/$f ] && install -m 0644 ${S}/tests/$t/$f ${D}${PTEST_PATH}/tests/$t/
+ done
+ for f in ${B}/tests/$t/*.properties; do
+ [ -e $f ] && install -m 0644 $f ${D}${PTEST_PATH}/tests/$t/
+ done
+ done
+
+ sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/run-ptest
+}
BBCLASSEXTEND = "native"
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-05 8:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 8:34 [OE-core][PATCH] log4cplus: add ptest support Pratik Farkase
2026-11-04 18:04 ` Mathieu Dubois-Briand
2026-11-05 8:18 ` [OE-core][PATCH v2] " Pratik Farkase
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.