From: <changqing.li@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH] procps: support ptest
Date: Wed, 14 Jan 2026 12:43:19 +0800 [thread overview]
Message-ID: <20260114044319.2830540-1-changqing.li@windriver.com> (raw)
From: Changqing Li <changqing.li@windriver.com>
support ptest for procps, procps's testsuite use DejaGnu test framework.
The testsuite is expected to run during build time, this implementation
create the same folder structure as the testsuite expected to make it
can work well.
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
.../distro/include/ptest-packagelists.inc | 1 +
meta/recipes-extended/procps/procps/run-ptest | 7 +++
meta/recipes-extended/procps/procps_4.0.5.bb | 50 ++++++++++++++++++-
3 files changed, 56 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-extended/procps/procps/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index fff2947177..0a4ff49ee3 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -57,6 +57,7 @@ PTESTS_FAST = "\
nettle \
opkg \
popt \
+ procps \
python3-atomicwrites \
python3-attrs \
python3-bcrypt \
diff --git a/meta/recipes-extended/procps/procps/run-ptest b/meta/recipes-extended/procps/procps/run-ptest
new file mode 100644
index 0000000000..c999876bd8
--- /dev/null
+++ b/meta/recipes-extended/procps/procps/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cd ./testsuite
+for tool in @DEJATOOL@;do
+ runtest -a --tool $tool --outdir ../log
+done
+
diff --git a/meta/recipes-extended/procps/procps_4.0.5.bb b/meta/recipes-extended/procps/procps_4.0.5.bb
index 0e0e06f0d2..b4697f7ce3 100644
--- a/meta/recipes-extended/procps/procps_4.0.5.bb
+++ b/meta/recipes-extended/procps/procps_4.0.5.bb
@@ -10,11 +10,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
DEPENDS = "ncurses"
-inherit autotools gettext pkgconfig update-alternatives
+inherit autotools gettext pkgconfig update-alternatives ptest
SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master;tag=v${PV} \
file://sysctl.conf \
file://top_large_pid_fix.patch \
+ file://run-ptest \
"
SRCREV = "f46b2f7929cdfe2913ed0a7f585b09d6adbf994e"
@@ -47,8 +48,51 @@ do_install:append () {
fi
}
-CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
+do_compile_ptest() {
+ oe_runmake -C testsuite site.exp
+ oe_runmake src/tests/test_process src/tests/test_strutils src/tests/test_fileutils src/tests/test_shm
+ DEJATOOL=$(make -C testsuite -s -f Makefile -f - <<'EOF'
+all:
+ $(info $(DEJATOOL))
+EOF
+)
+ echo $DEJATOOL > ${B}/testsuite/.dejatool
+}
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/testsuite
+ install -d ${D}${PTEST_PATH}/src
+ install -d ${D}${PTEST_PATH}/log
+
+ cp -r ${S}/testsuite/* ${D}${PTEST_PATH}/testsuite/
+ cp -r ${B}/testsuite/* ${D}${PTEST_PATH}/testsuite/
+ cp -r ${B}/src/tests ${D}${PTEST_PATH}/src/
+
+ rm -rf ${D}${PTEST_PATH}/testsuite/Makefile*
+ rm -rf ${D}${PTEST_PATH}/testsuite/README
+ find ${D}${PTEST_PATH}/testsuite/ -type f -name "*.o" -exec rm -f {} +
+ find ${D}${PTEST_PATH}/src/ -type f -name "*.o" -exec rm -f {} +
+
+ sed -i -e "/set srcdir/c\set srcdir ${PTEST_PATH}/testsuite" \
+ -e "/set objdir/c\set objdir ${PTEST_PATH}/testsuite" ${D}${PTEST_PATH}/testsuite/site.exp
+
+ DEJATOOL=$(cat ${B}/testsuite/.dejatool)
+ sed -i -e "s#@DEJATOOL@#$DEJATOOL#g" ${D}${PTEST_PATH}/run-ptest
+ for p in $DEJATOOL; do
+ if [ "$p" = "ps" ]; then
+ install -d ${D}${PTEST_PATH}/src/ps
+ ln -sf ${base_bindir}/ps ${D}${PTEST_PATH}/src/ps/pscommand
+ elif [ "$p" = "sysctl" ]; then
+ ln -sf ${base_sbindir}/$p ${D}${PTEST_PATH}/src/$p
+ elif [ "$p" = "kill" ] || [ "$p" = "pidof" ] || [ "$p" = "watch" ]; then
+ ln -sf ${base_bindir}/$p ${D}${PTEST_PATH}/src/$p
+ else
+ ln -sf ${bindir}/$p ${D}${PTEST_PATH}/src/$p
+ fi
+ done
+}
+
+CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w"
base_bindir_progs += "kill pidof ps watch"
base_sbindir_progs += "sysctl"
@@ -80,6 +124,8 @@ RDEPENDS:${PN} += "${PROCPS_PACKAGES}"
RDEPENDS:${PN}-ps += "${PN}-lib"
RDEPENDS:${PN}-sysctl += "${PN}-lib"
+RDEPENDS:${PN}-ptest += "dejagnu bash glibc-utils"
+
FILES:${PN}-lib = "${libdir}"
FILES:${PN}-ps = "${base_bindir}/ps.${BPN}"
FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d"
--
2.34.1
next reply other threads:[~2026-01-14 4:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 4:43 changqing.li [this message]
2026-01-15 7:53 ` [OE-core] [PATCH] procps: support ptest Antonin Godard
2026-01-16 9:31 ` Changqing Li
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=20260114044319.2830540-1-changqing.li@windriver.com \
--to=changqing.li@windriver.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