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] libyaml: add ptest support
Date: Fri, 21 Nov 2025 11:56:12 +0100 [thread overview]
Message-ID: <20251121105612.12259-1-pratik.farkase@est.tech> (raw)
Add ptest support for libyaml to enable running the test suite
on target devices. This includes:
- test-version: Verifies library version information
- test-reader: Tests YAML reading functionality
The tests are built from the upstream test suite using the
autotools check_PROGRAMS infrastructure.
All 2 upstream tests pass successfully:
START: ptest-runner
BEGIN: /usr/lib/libyaml/ptest
PASS: test-version
PASS: test-reader
DURATION: 0
END: /usr/lib/libyaml/ptest
STOP: ptest-runner
Signed-off-by: Pratik Farkase <pratik.farkase@est.tech>
---
.../recipes-support/libyaml/libyaml/run-ptest | 49 +++++++++++++++++++
meta/recipes-support/libyaml/libyaml_0.2.5.bb | 21 +++++++-
2 files changed, 68 insertions(+), 2 deletions(-)
create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
diff --git a/meta/recipes-support/libyaml/libyaml/run-ptest b/meta/recipes-support/libyaml/libyaml/run-ptest
new file mode 100755
index 0000000000..885e4b68d5
--- /dev/null
+++ b/meta/recipes-support/libyaml/libyaml/run-ptest
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# run-ptest - Execute libyaml test suite
+
+cd tests || exit 1
+
+TOTAL=0
+PASS=0
+FAIL=0
+SKIP=0
+
+run_test() {
+ test_name="$1"
+ test_bin="./${test_name}"
+
+ TOTAL=$((TOTAL + 1))
+
+ if [ ! -x "${test_bin}" ]; then
+ echo "SKIP: ${test_name}"
+ SKIP=$((SKIP + 1))
+ return
+ fi
+
+ if ${test_bin} >/dev/null 2>&1; then
+ echo "PASS: ${test_name}"
+ PASS=$((PASS + 1))
+ else
+ echo "FAIL: ${test_name}"
+ FAIL=$((FAIL + 1))
+ return 1
+ fi
+}
+
+run_test "test-version"
+run_test "test-reader"
+
+echo "============================================================================"
+echo "Testsuite summary for yaml 0.2.5"
+echo "============================================================================"
+echo "# TOTAL: ${TOTAL}"
+echo "# PASS: ${PASS}"
+echo "# SKIP: ${SKIP}"
+echo "# XFAIL: 0"
+echo "# FAIL: ${FAIL}"
+echo "# XPASS: 0"
+echo "# ERROR: 0"
+echo "============================================================================"
+
+test ${FAIL} -eq 0
diff --git a/meta/recipes-support/libyaml/libyaml_0.2.5.bb b/meta/recipes-support/libyaml/libyaml_0.2.5.bb
index 0d8e8762d5..1d950572ab 100644
--- a/meta/recipes-support/libyaml/libyaml_0.2.5.bb
+++ b/meta/recipes-support/libyaml/libyaml_0.2.5.bb
@@ -7,14 +7,31 @@ SECTION = "libs/devel"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://License;md5=7bbd28caa69f81f5cd5f48647236663d"
-SRC_URI = "https://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz"
+SRC_URI = "https://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz \
+ file://run-ptest \
+"
SRC_URI[sha256sum] = "c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4"
S = "${UNPACKDIR}/yaml-${PV}"
-inherit autotools
+inherit autotools ptest
DISABLE_STATIC:class-nativesdk = ""
DISABLE_STATIC:class-native = ""
BBCLASSEXTEND = "native nativesdk"
+
+do_compile_ptest() {
+ oe_runmake -C tests ${PTEST_TESTS}
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ for test in ${PTEST_TESTS}; do
+ if [ -f ${B}/tests/.libs/${test} ]; then
+ install -m 0755 ${B}/tests/.libs/${test} ${D}${PTEST_PATH}/tests/
+ fi
+ done
+}
+
+PTEST_TESTS = "test-version test-reader"
--
2.43.0
next reply other threads:[~2025-11-21 10:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 10:56 Pratik Farkase [this message]
2025-11-21 11:22 ` [OE-core][PATCH] libyaml: add ptest support Yoann Congal
2025-11-21 11:57 ` Pratik Farkase
2025-11-21 11:54 ` [OE-core][PATCH v2] " Pratik Farkase
2025-11-21 12:32 ` Yoann Congal
2025-11-21 13:17 ` Pratik Farkase
2025-11-21 13:13 ` [OE-core][PATCH v3] " Pratik Farkase
2025-11-21 14:46 ` Yoann Congal
2025-12-01 17:39 ` Ross Burton
2025-12-04 13:24 ` Ross Burton
2026-01-08 9:17 ` [OE-core][PATCH v4] " Pratik Farkase
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=20251121105612.12259-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