From: Pratik Farkase <pratik.farkase@est.tech>
To: openembedded-core@lists.openembedded.org
Cc: pratik.farkase@ericsson.com, Pratik Farkase <pratik.farkase@est.tech>
Subject: [OE-core][PATCH v5] libconfig: add ptest support
Date: Tue, 10 Feb 2026 21:39:05 +0100 [thread overview]
Message-ID: <20260210203905.6407-1-pratik.farkase@est.tech> (raw)
In-Reply-To: <20260128140635.43214-1-pratik.farkase@est.tech>
Add ptest support to enable automated testing of libconfig
using ptest-runner.
The implementation uses libtool --mode=install to properly
install test binaries, avoiding issues with libtool wrapper
scripts. Tests are built via 'make check TESTS=' to compile
without running during the build phase.
The test suite includes 16 tests covering parsing, formatting,
binary/hex values, escaped strings, and various edge cases.
All tests pass successfully on qemux86-64 :
START: ptest-runner
BEGIN: /usr/lib/libconfig/ptest
[TEST] ParsingAndFormatting
parsing testdata/input_0.cfg
parsing testdata/input_1.cfg
parsing testdata/input_2.cfg
parsing testdata/input_3.cfg
parsing testdata/input_4.cfg
parsing testdata/input_5.cfg
parsing testdata/input_6.cfg
parsing testdata/input_7.cfg
[ OK ] ParsingAndFormatting
[TEST] ParseInvalidFiles
[ OK ] ParseInvalidFiles
[TEST] ParseInvalidStrings
[ OK ] ParseInvalidStrings
[TEST] BigInt1
[ OK ] BigInt1
[TEST] BigInt2
[ OK ] BigInt2
[TEST] BigInt3
[ OK ] BigInt3
[TEST] BigInt4
[ OK ] BigInt4
[TEST] BigInt5
[ OK ] BigInt5
[TEST] BigInt6
[ OK ] BigInt6
[TEST] BigInt7
[ OK ] BigInt7
[TEST] RemoveSetting
[ OK ] RemoveSetting
[TEST] EscapedStrings
[ OK ] EscapedStrings
[TEST] OverrideSetting
[ OK ] OverrideSetting
[TEST] SettingLookups
[ OK ] SettingLookups
[TEST] ReadStream
[ OK ] ReadStream
[TEST] BinaryAndHex
some auto big hex: 4294967296
some auto big bin: 8589934591
negativehex: -1430532899
[ OK ] BinaryAndHex
16 tests; 16 passed, 0 failed
PASS: libconfig_tests
DURATION: 0
END: /usr/lib/libconfig/ptest
STOP: ptest-runner
TOTAL: 1 FAIL: 0
Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
Changes in v5:
- Remove existence checks from run-ptest
Changes in v4:
- Remove conditional installation guards in do_install_ptest()
Changes in v3:
- Use ${B}/libtool instead of libtool from PATH
- Fixes TMPDIR build path leakage
- Resolves ptest runtime dependency QA warnings
Changes in v2:
- Removed RDEPENDS on bash
---
meta/conf/distro/include/ptest-packagelists.inc | 1 +
meta/recipes-extended/libconfig/libconfig/run-ptest | 12 ++++++++++++
meta/recipes-extended/libconfig/libconfig_1.8.2.bb | 13 ++++++++++++-
3 files changed, 25 insertions(+), 1 deletion(-)
create mode 100755 meta/recipes-extended/libconfig/libconfig/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 739995bcfe..7c5810f252 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -29,6 +29,7 @@ PTESTS_FAST = "\
json-c \
json-glib \
libcheck \
+ libconfig \
libconvert-asn1-perl \
libexif \
libgpg-error\
diff --git a/meta/recipes-extended/libconfig/libconfig/run-ptest b/meta/recipes-extended/libconfig/libconfig/run-ptest
new file mode 100755
index 0000000000..047d9554be
--- /dev/null
+++ b/meta/recipes-extended/libconfig/libconfig/run-ptest
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd tests
+
+for t in libconfig_tests; do
+ ./$t
+ if [ $? -eq 0 ]; then
+ echo "PASS: $t"
+ else
+ echo "FAIL: $t"
+ fi
+done
diff --git a/meta/recipes-extended/libconfig/libconfig_1.8.2.bb b/meta/recipes-extended/libconfig/libconfig_1.8.2.bb
index 6e08a7b04b..c3582828f7 100644
--- a/meta/recipes-extended/libconfig/libconfig_1.8.2.bb
+++ b/meta/recipes-extended/libconfig/libconfig_1.8.2.bb
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=17c8e32f0f72580cc2906b409d46b5ac"
SRC_URI = " \
git://github.com/hyperrealm/libconfig.git;protocol=https;branch=master;tag=v${PV} \
+ file://run-ptest \
"
SRCREV = "a42cb47c1526a4f2ed025fcbb2289863375bc898"
@@ -17,7 +18,7 @@ DEPENDS += "bison-native flex-native"
UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$"
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
PACKAGE_BEFORE_PN = "${PN}++"
FILES:${PN}++ = "${libdir}/${BPN}++*${SOLIBS}"
@@ -27,3 +28,13 @@ do_compile:prepend() {
rm -f ${S}/lib/grammar.[ch]
rm -f ${S}/lib/scanner.[ch]
}
+
+do_compile_ptest() {
+ oe_runmake -C tests check TESTS=
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ ${B}/libtool --mode=install install -m 0755 ${B}/tests/libconfig_tests ${D}${PTEST_PATH}/tests/libconfig_tests
+ cp -r ${S}/tests/testdata ${D}${PTEST_PATH}/tests/
+}
--
2.43.0
prev parent reply other threads:[~2026-02-10 20:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 14:06 [OE-core][PATCH v1] libconfig: add ptest support Pratik Farkase
2026-01-29 0:26 ` Randy MacLeod
2026-01-29 8:33 ` Pratik Farkase
2026-02-04 11:09 ` Alexander Kanavin
2026-02-04 12:02 ` Mathieu Dubois-Briand
2026-02-04 15:12 ` Pratik Farkase
2026-02-04 15:14 ` Alexander Kanavin
2026-02-04 15:16 ` Pratik Farkase
2026-02-04 15:18 ` Quentin Schulz
2026-01-29 8:30 ` [OE-core][PATCH v2] " Pratik Farkase
2026-02-04 14:58 ` [OE-core][PATCH v3] " Pratik Farkase
2026-02-10 12:13 ` Ross Burton
2026-02-10 18:54 ` Pratik Farkase
2026-02-10 20:41 ` Pratik Farkase
2026-02-10 18:47 ` [OE-core][PATCH v4] " Pratik Farkase
2026-02-10 20:39 ` Pratik Farkase [this message]
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=20260210203905.6407-1-pratik.farkase@est.tech \
--to=pratik.farkase@est.tech \
--cc=openembedded-core@lists.openembedded.org \
--cc=pratik.farkase@ericsson.com \
/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