Skip to contentSkip to conversation

libyaml: add ptest support

PATCH Superseded Pratik Farkase 3 participants 11 messages Nov 21, 2025 – Jan 8

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libyaml: add ptest support

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

---
 .../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
meta/recipes-support/libyaml/libyaml/run-ptest new file +49 -0
new file mode 100755
index 0000000000..885e4b68d5
@@ -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
meta/recipes-support/libyaml/libyaml_0.2.5.bb +19 -2
index 0d8e8762d5..1d950572ab 100644
@@ -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"
Signature · 1 line
2.43.0
#1 lore raw

Hello,

Quoted 58 lines · Pratik Farkase via lists.openembedded.org

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

---
 .../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
meta/recipes-support/libyaml/libyaml/run-ptest new file +25 -0
new file mode 100755
index 0000000000..885e4b68d5
@@ -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}"

meta/recipes-support/libyaml/libyaml/run-ptest line 35

Quoted 10 lines
meta/recipes-support/libyaml/libyaml/run-ptest new file +10 -0
+        PASS=$((PASS + 1))
+    else
+        echo "FAIL: ${test_name}"
+        FAIL=$((FAIL + 1))
+        return 1
+    fi
+}
+
+run_test "test-version"
+run_test "test-reader"

This is the duplication of PTEST_TESTS. Is there any way to avoid the repetition?
Run every binary in tests/ maybe?

Quoted 5 lines
meta/recipes-support/libyaml/libyaml/run-ptest new file +2 -0
+
+echo

"============================================================================" +echo "Testsuite summary for yaml 0.2.5"

This hard-coded "0.2.5" version will most likely *not* be updated on future upgrades.
Either remove it (my recommendation) or generate it from $PV.

Quoted 10 lines

+echo "============================================================================"

meta/recipes-support/libyaml/libyaml/run-ptest new file +8 -0
+echo "# TOTAL: ${TOTAL}"
+echo "# PASS:  ${PASS}"
+echo "# SKIP:  ${SKIP}"
+echo "# XFAIL: 0"
+echo "# FAIL:  ${FAIL}"
+echo "# XPASS: 0"
+echo "# ERROR: 0"
+echo
Quoted 2 lines

"============================================================================"

The lines forced to "0" are not used by any tools (that I know of) and provide little info (being static). How about removing them?

Quoted 39 lines
meta/recipes-support/libyaml/libyaml/run-ptest new file +2 -0
+
+test ${FAIL} -eq 0
meta/recipes-support/libyaml/libyaml_0.2.5.bb +3 -1
index 0d8e8762d5..1d950572ab 100644
@@ -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}"

meta/recipes-support/libyaml/libyaml_0.2.5.bb +11 -1
-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/

meta/recipes-support/libyaml/libyaml_0.2.5.bb SECTION = "libs/devel" · line 37

Quoted 5 lines
meta/recipes-support/libyaml/libyaml_0.2.5.bb +5 -0
+        fi
+    done
+}
+
+PTEST_TESTS = "test-version test-reader"

Can you put this definition above the tasks where it is used? That would make the code easier to read.

Thanks!

Quoted 15 lines

--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#226667):
https://lists.openembedded.org/g/openembedded-core/message/226667
Mute This Topic: https://lists.openembedded.org/mt/116405792/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS
#2 lore raw

Hi Yoann,

Thank you for the quick review and helpful feedback!

I've addressed all your comments in v2:
- Removed hardcoded "0.2.5" version from test summary
- Removed static XFAIL/XPASS/ERROR lines (always 0)
- Moved PTEST_TESTS definition above the functions for better readability
- Changed run-ptest to auto-discover test binaries instead of hardcoding names

v2 patch is sent separately.

Thanks again for the review!

Best Regards,
Pratik

________________________________________
From: Yoann Congal <[email protected]>
Sent: Friday, November 21, 2025 12:22 PM
To: Pratik Farkase
Cc: [email protected]; [email protected]
Subject: Re: [OE-core][PATCH] libyaml: add ptest support

Hello,

Le ven. 21 nov. 2025 à 11:56, Pratik Farkase via lists.openembedded.org<http://lists.openembedded.org> <[email protected]<mailto:[email protected]>> a écrit :
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

---
 .../recipes-support/libyaml/libyaml/run-ptest | 49 +++++++++++++++++++
 meta/recipes-support/libyaml/libyaml_0.2.5.bb<http://libyaml_0.2.5.bb> | 21 +++++++-
 2 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
meta/recipes-support/libyaml/libyaml/run-ptest new file +35 -0
new file mode 100755
index 0000000000..885e4b68d5
@@ -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"

This is the duplication of PTEST_TESTS. Is there any way to avoid the repetition? Run every binary in tests/ maybe?

+
+echo "============================================================================" +echo "Testsuite summary for yaml 0.2.5"

This hard-coded "0.2.5" version will most likely *not* be updated on future upgrades. Either remove it (my recommendation) or generate it from $PV.

+echo "============================================================================" +echo "# TOTAL: ${TOTAL}"
+echo "# PASS: ${PASS}"
+echo "# SKIP: ${SKIP}"
+echo "# XFAIL: 0"
+echo "# FAIL: ${FAIL}"
+echo "# XPASS: 0"
+echo "# ERROR: 0"
+echo "============================================================================"

The lines forced to "0" are not used by any tools (that I know of) and provide little info (being static). How about removing them?

+
+test ${FAIL} -eq 0

meta/recipes-support/libyaml/libyaml_0.2.5.bb<http://libyaml_0.2.5.bb> +19 -2
index 0d8e8762d5..1d950572ab 100644
@@ -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<https://pyyaml.org/download/libyaml/yaml-$%7BPV%7D.tar.gz>"
+SRC_URI = "https://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz<https://pyyaml.org/download/libyaml/yaml-$%7BPV%7D.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"

Can you put this definition above the tasks where it is used? That would make the code easier to read.

Thanks!

--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226667): https://lists.openembedded.org/g/openembedded-core/message/226667
Mute This Topic: https://lists.openembedded.org/mt/116405792/4316185
Group Owner: [email protected]<mailto:openembedded-core%[email protected]>
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]<mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-

--
Yoann Congal
Smile ECS

#3 lore raw

PATCH v2 1/1 libyaml: add ptest support

In reply to Pratik Farkase

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

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

Changes in v2:
- Remove hardcoded version from test summary
- Remove static XFAIL/XPASS/ERROR lines (always 0)
- Move PTEST_TESTS definition above functions for better readability
- Auto-discover test binaries in run-ptest

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libyaml/libyaml/run-ptest | 46 +++++++++++++++++++
 meta/recipes-support/libyaml/libyaml_0.2.5.bb | 21 ++++++++-
 3 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..6a0c23586e 100644
@@ -49,6 +49,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libyaml \
     logrotate \
     lua \
     lzo \
meta/recipes-support/libyaml/libyaml/run-ptest new file +46 -0

46 lines not on this page · raw message

meta/recipes-support/libyaml/libyaml_0.2.5.bb +19 -2
index 0d8e8762d5..9a905215d3 100644
@@ -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"
+
+PTEST_TESTS = "test-version test-reader"
+
+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
+}
Signature · 1 line
2.43.0
#4 lore raw
Quoted 15 lines · Pratik Farkase via lists.openembedded.org

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

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

Quoted 6 lines

Changes in v2:
- Remove hardcoded version from test summary
- Remove static XFAIL/XPASS/ERROR lines (always 0)
- Move PTEST_TESTS definition above functions for better readability
- Auto-discover test binaries in run-ptest

^ this changelog is nice but need to go after the "---" line (that way, it is in mails for review but not in final commit message)

Quoted 42 lines
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libyaml/libyaml/run-ptest | 46 +++++++++++++++++++
 meta/recipes-support/libyaml/libyaml_0.2.5.bb | 21 ++++++++-
 3 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..6a0c23586e 100644
@@ -49,6 +49,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libyaml \
     logrotate \
     lua \
     lzo \
meta/recipes-support/libyaml/libyaml/run-ptest new file +12 -0
new file mode 100755
index 0000000000..a9cbe9cf0d
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# run-ptest - Execute libyaml test suite
+
+cd tests || exit 1
+
+TOTAL=0
+PASS=0
+FAIL=0
+SKIP=0
+
+run_test() {

meta/recipes-support/libyaml/libyaml/run-ptest line 22

Quoted 10 lines
meta/recipes-support/libyaml/libyaml/run-ptest new file +10 -0
+    test_name="$1"
+    test_bin="./${test_name}"
+
+    TOTAL=$((TOTAL + 1))
+
+    if [ ! -x "${test_bin}" ]; then
+        echo "SKIP: ${test_name}"
+        SKIP=$((SKIP + 1))
+        return
+    fi

This test is now redundant. You can remove it.

Quoted 79 lines
meta/recipes-support/libyaml/libyaml/run-ptest new file +24 -0
+
+    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
+}
+
+for test_bin in ./test-*; do
+    if [ -x "${test_bin}" ]; then
+        test_name=$(basename "${test_bin}")
+        run_test "${test_name}"
+    fi
+done
+
+echo "# TOTAL: ${TOTAL}"
+echo "# PASS:  ${PASS}"
+echo "# SKIP:  ${SKIP}"
+echo "# FAIL:  ${FAIL}"
+
+test ${FAIL} -eq 0
meta/recipes-support/libyaml/libyaml_0.2.5.bb +3 -1
index 0d8e8762d5..9a905215d3 100644
@@ -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}"

meta/recipes-support/libyaml/libyaml_0.2.5.bb +13 -1
-inherit autotools
+inherit autotools ptest
 
 DISABLE_STATIC:class-nativesdk = ""
 DISABLE_STATIC:class-native = ""
 
 BBCLASSEXTEND = "native nativesdk"
+
+PTEST_TESTS = "test-version test-reader"
+
+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/

meta/recipes-support/libyaml/libyaml_0.2.5.bb +3 -1
+        fi
+    done
+}
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#226673):
https://lists.openembedded.org/g/openembedded-core/message/226673
Mute This Topic: https://lists.openembedded.org/mt/116406209/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS
#5 lore raw

Hi Yoann,

Thanks again for feedback, sent a v3 addressing the comments.

Best Regards,
Pratik

________________________________________
From: Yoann Congal <[email protected]>
Sent: Friday, November 21, 2025 1:32 PM
To: Pratik Farkase
Cc: [email protected]; [email protected]
Subject: Re: [OE-core][PATCH v2] libyaml: add ptest support

Le ven. 21 nov. 2025 à 12:54, Pratik Farkase via lists.openembedded.org<http://lists.openembedded.org> <[email protected]<mailto:[email protected]>> a écrit :
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

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

Changes in v2:
- Remove hardcoded version from test summary
- Remove static XFAIL/XPASS/ERROR lines (always 0)
- Move PTEST_TESTS definition above functions for better readability
- Auto-discover test binaries in run-ptest

^ this changelog is nice but need to go after the "---" line (that way, it is in mails for review but not in final commit message)

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libyaml/libyaml/run-ptest | 46 +++++++++++++++++++
 meta/recipes-support/libyaml/libyaml_0.2.5.bb<http://libyaml_0.2.5.bb> | 21 ++++++++-
 3 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..6a0c23586e 100644
@@ -49,6 +49,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libyaml \
     logrotate \
     lua \
     lzo \
meta/recipes-support/libyaml/libyaml/run-ptest new file +22 -0
new file mode 100755
index 0000000000..a9cbe9cf0d
@@ -0,0 +1,46 @@
+#!/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

This test is now redundant. You can remove it.

+
+ 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
+}
+
+for test_bin in ./test-*; do
+ if [ -x "${test_bin}" ]; then
+ test_name=$(basename "${test_bin}")
+ run_test "${test_name}"
+ fi
+done
+
+echo "# TOTAL: ${TOTAL}"

+echo "# PASS:  ${PASS}"
+echo "# SKIP:  ${SKIP}"
+echo "# FAIL:  ${FAIL}"

+
+test ${FAIL} -eq 0

meta/recipes-support/libyaml/libyaml_0.2.5.bb<http://libyaml_0.2.5.bb> +19 -2
index 0d8e8762d5..9a905215d3 100644
@@ -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<https://pyyaml.org/download/libyaml/yaml-$%7BPV%7D.tar.gz>"
+SRC_URI = "https://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz<https://pyyaml.org/download/libyaml/yaml-$%7BPV%7D.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"
+
+PTEST_TESTS = "test-version test-reader"
+
+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
+}

--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226673): https://lists.openembedded.org/g/openembedded-core/message/226673
Mute This Topic: https://lists.openembedded.org/mt/116406209/4316185
Group Owner: [email protected]<mailto:openembedded-core%[email protected]>
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]<mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-

--
Yoann Congal
Smile ECS

#6 lore raw

PATCH v3 1/1 libyaml: add ptest support

In reply to Pratik Farkase

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

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

---
Changes in v3:
- Remove redundant executable check in run_test function

Changes in v2:
- Remove hardcoded version from test summary
- Remove static XFAIL/XPASS/ERROR lines (always 0)
- Move PTEST_TESTS definition above functions for better readability
- Auto-discover test binaries in run-ptest

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libyaml/libyaml/run-ptest | 38 +++++++++++++++++++
 meta/recipes-support/libyaml/libyaml_0.2.5.bb | 21 +++++++++-
 3 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..6a0c23586e 100644
@@ -49,6 +49,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libyaml \
     logrotate \
     lua \
     lzo \
meta/recipes-support/libyaml/libyaml/run-ptest new file +38 -0
new file mode 100755
index 0000000000..a5f554a15b
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# run-ptest - Execute libyaml test suite
+
+cd tests || exit 1
+
+TOTAL=0
+PASS=0
+FAIL=0
+
+run_test() {
+    test_name="$1"
+    test_bin="./${test_name}"
+
+    TOTAL=$((TOTAL + 1))
+
+    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
+}
+
+for test_bin in ./test-*; do
+    if [ -x "${test_bin}" ]; then
+        test_name=$(basename "${test_bin}")
+        run_test "${test_name}"
+    fi
+done
+
+echo "# TOTAL: ${TOTAL}"
+echo "# PASS:  ${PASS}"
+echo "# FAIL:  ${FAIL}"
+
+test ${FAIL} -eq 0
meta/recipes-support/libyaml/libyaml_0.2.5.bb +19 -2
index 0d8e8762d5..9a905215d3 100644
@@ -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"
+
+PTEST_TESTS = "test-version test-reader"
+
+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
+}
Signature · 1 line
2.43.0
Reviewed-by on v3 1/1
#7 lore raw
Quoted 15 lines · Pratik Farkase via lists.openembedded.org

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

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

Quoted 2 lines

Thanks! Looks good to me now :)

Quoted 131 lines

---
Changes in v3:
- Remove redundant executable check in run_test function

Changes in v2:
- Remove hardcoded version from test summary
- Remove static XFAIL/XPASS/ERROR lines (always 0)
- Move PTEST_TESTS definition above functions for better readability
- Auto-discover test binaries in run-ptest

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libyaml/libyaml/run-ptest | 38 +++++++++++++++++++
 meta/recipes-support/libyaml/libyaml_0.2.5.bb | 21 +++++++++-
 3 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..6a0c23586e 100644
@@ -49,6 +49,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libyaml \
     logrotate \
     lua \
     lzo \
meta/recipes-support/libyaml/libyaml/run-ptest new file +38 -0
new file mode 100755
index 0000000000..a5f554a15b
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# run-ptest - Execute libyaml test suite
+
+cd tests || exit 1
+
+TOTAL=0
+PASS=0
+FAIL=0
+
+run_test() {
+    test_name="$1"
+    test_bin="./${test_name}"
+
+    TOTAL=$((TOTAL + 1))
+
+    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
+}
+
+for test_bin in ./test-*; do
+    if [ -x "${test_bin}" ]; then
+        test_name=$(basename "${test_bin}")
+        run_test "${test_name}"
+    fi
+done
+
+echo "# TOTAL: ${TOTAL}"
+echo "# PASS:  ${PASS}"
+echo "# FAIL:  ${FAIL}"
+
+test ${FAIL} -eq 0
meta/recipes-support/libyaml/libyaml_0.2.5.bb +3 -1
index 0d8e8762d5..9a905215d3 100644
@@ -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}"

meta/recipes-support/libyaml/libyaml_0.2.5.bb +13 -1
-inherit autotools
+inherit autotools ptest
 
 DISABLE_STATIC:class-nativesdk = ""
 DISABLE_STATIC:class-native = ""
 
 BBCLASSEXTEND = "native nativesdk"
+
+PTEST_TESTS = "test-version test-reader"
+
+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/

meta/recipes-support/libyaml/libyaml_0.2.5.bb +3 -1
+        fi
+    done
+}
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#226677):
https://lists.openembedded.org/g/openembedded-core/message/226677
Mute This Topic: https://lists.openembedded.org/mt/116406990/4316185
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 2 lines
Yoann Congal
Smile ECS
#8 lore raw
In reply to Pratik Farkase
Quoted 1 line · Pratik Farkase via lists.openembedded.org

+ if [ -f ${B}/tests/.libs/${test} ]; then

Don’t make this conditional, as otherwise the test list won’t be updated.

Quoted 1 line

+ install -m 0755 ${B}/tests/.libs/${test} ${D}${PTEST_PATH}/tests/

Use ${B}/libtool —mode=install install ${B}/tests/$test ${D}${PTEST_PATH}/tests/ please. Assuming that libtool writes into .libs/ is a bad assumption.

Ross

#9 lore raw
In reply to Pratik Farkase
Quoted 2 lines · Pratik Farkase via lists.openembedded.org

+ if ${test_bin} >/dev/null 2>&1; then

If the test fails, it would be useful to have output to say why it failed. So I suggest not redirecting the output.

Ross

#10 lore raw

PATCH v4 1/1 libyaml: add ptest support

In reply to Pratik Farkase

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

All 2 upstream tests pass successfully:
START: ptest-runner
BEGIN: /usr/lib/libyaml/ptest
checking utf-8 sequences...
a simple test:
+ (no error)

an empty line:
+ (no error)

u-0 is a control character:
+ (reader error: control characters are not allowed: #0 at 0)

u-80 is a control character:
+ (reader error: control characters are not allowed: #80 at 0)

u-800 is valid:
+ (no error)

u-10000 is valid:
+ (no error)

5 bytes sequences are not allowed:
+ (reader error: invalid leading UTF-8 octet: #F8 at 0)

6 bytes sequences are not allowed:
+ (reader error: invalid leading UTF-8 octet: #FC at 0)

u-7f is a control character:
+ (reader error: control characters are not allowed: #7F at 0)

u-7FF is valid:
+ (no error)

u-FFFF is a control character:
+ (reader error: control characters are not allowed: #FFFF at 0)

u-1FFFFF is too large:
+ (reader error: invalid Unicode character: #1FFFFF at 0)

u-3FFFFFF is 5 bytes:
+ (reader error: invalid leading UTF-8 octet: #FB at 0)

u-7FFFFFFF is 6 bytes:
+ (reader error: invalid leading UTF-8 octet: #FD at 0)

u-D7FF:
+ (no error)

u-E000:
+ (no error)

u-FFFD:
+ (no error)

u-10FFFF:
+ (no error)

u-110000:
+ (reader error: invalid Unicode character: #110000 at 0)

first continuation byte:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)

last continuation byte:
+ (reader error: invalid leading UTF-8 octet: #BF at 0)

2 continuation bytes:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)

3 continuation bytes:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)

4 continuation bytes:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)

5 continuation bytes:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)

6 continuation bytes:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)

7 continuation bytes:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)

sequence of all 64 possible continuation bytes:
+ (reader error: invalid leading UTF-8 octet: #80 at 0)
+ (reader error: invalid leading UTF-8 octet: #81 at 0)
+ (reader error: invalid leading UTF-8 octet: #82 at 0)
+ (reader error: invalid leading UTF-8 octet: #83 at 0)
+ (reader error: invalid leading UTF-8 octet: #84 at 0)
+ (reader error: invalid leading UTF-8 octet: #85 at 0)
+ (reader error: invalid leading UTF-8 octet: #86 at 0)
+ (reader error: invalid leading UTF-8 octet: #87 at 0)
+ (reader error: invalid leading UTF-8 octet: #88 at 0)
+ (reader error: invalid leading UTF-8 octet: #89 at 0)
+ (reader error: invalid leading UTF-8 octet: #8A at 0)
+ (reader error: invalid leading UTF-8 octet: #8B at 0)
+ (reader error: invalid leading UTF-8 octet: #8C at 0)
+ (reader error: invalid leading UTF-8 octet: #8D at 0)
+ (reader error: invalid leading UTF-8 octet: #8E at 0)
+ (reader error: invalid leading UTF-8 octet: #8F at 0)
+ (reader error: invalid leading UTF-8 octet: #90 at 0)
+ (reader error: invalid leading UTF-8 octet: #91 at 0)
+ (reader error: invalid leading UTF-8 octet: #92 at 0)
+ (reader error: invalid leading UTF-8 octet: #93 at 0)
+ (reader error: invalid leading UTF-8 octet: #94 at 0)
+ (reader error: invalid leading UTF-8 octet: #95 at 0)
+ (reader error: invalid leading UTF-8 octet: #96 at 0)
+ (reader error: invalid leading UTF-8 octet: #97 at 0)
+ (reader error: invalid leading UTF-8 octet: #98 at 0)
+ (reader error: invalid leading UTF-8 octet: #99 at 0)
+ (reader error: invalid leading UTF-8 octet: #9A at 0)
+ (reader error: invalid leading UTF-8 octet: #9B at 0)
+ (reader error: invalid leading UTF-8 octet: #9C at 0)
+ (reader error: invalid leading UTF-8 octet: #9D at 0)
+ (reader error: invalid leading UTF-8 octet: #9E at 0)
+ (reader error: invalid leading UTF-8 octet: #9F at 0)
+ (reader error: invalid leading UTF-8 octet: #A0 at 0)
+ (reader error: invalid leading UTF-8 octet: #A1 at 0)
+ (reader error: invalid leading UTF-8 octet: #A2 at 0)
+ (reader error: invalid leading UTF-8 octet: #A3 at 0)
+ (reader error: invalid leading UTF-8 octet: #A4 at 0)
+ (reader error: invalid leading UTF-8 octet: #A5 at 0)
+ (reader error: invalid leading UTF-8 octet: #A6 at 0)
+ (reader error: invalid leading UTF-8 octet: #A7 at 0)
+ (reader error: invalid leading UTF-8 octet: #A8 at 0)
+ (reader error: invalid leading UTF-8 octet: #A9 at 0)
+ (reader error: invalid leading UTF-8 octet: #AA at 0)
+ (reader error: invalid leading UTF-8 octet: #AB at 0)
+ (reader error: invalid leading UTF-8 octet: #AC at 0)
+ (reader error: invalid leading UTF-8 octet: #AD at 0)
+ (reader error: invalid leading UTF-8 octet: #AE at 0)
+ (reader error: invalid leading UTF-8 octet: #AF at 0)
+ (reader error: invalid leading UTF-8 octet: #B0 at 0)
+ (reader error: invalid leading UTF-8 octet: #B1 at 0)
+ (reader error: invalid leading UTF-8 octet: #B2 at 0)
+ (reader error: invalid leading UTF-8 octet: #B3 at 0)
+ (reader error: invalid leading UTF-8 octet: #B4 at 0)
+ (reader error: invalid leading UTF-8 octet: #B5 at 0)
+ (reader error: invalid leading UTF-8 octet: #B6 at 0)
+ (reader error: invalid leading UTF-8 octet: #B7 at 0)
+ (reader error: invalid leading UTF-8 octet: #B8 at 0)
+ (reader error: invalid leading UTF-8 octet: #B9 at 0)
+ (reader error: invalid leading UTF-8 octet: #BA at 0)
+ (reader error: invalid leading UTF-8 octet: #BB at 0)
+ (reader error: invalid leading UTF-8 octet: #BC at 0)
+ (reader error: invalid leading UTF-8 octet: #BD at 0)
+ (reader error: invalid leading UTF-8 octet: #BE at 0)
+ (reader error: invalid leading UTF-8 octet: #BF at 0)

32 first bytes of 2-byte sequences {0xc0-0xdf}:
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)
+ (reader error: invalid trailing UTF-8 octet: #20 at 1)

16 first bytes of 3-byte sequences {0xe0-0xef}:
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)

8 first bytes of 4-byte sequences {0xf0-0xf7}:
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)

4 first bytes of 5-byte sequences {0xf8-0xfb}:
+ (reader error: invalid leading UTF-8 octet: #F8 at 0)
+ (reader error: invalid leading UTF-8 octet: #F9 at 0)
+ (reader error: invalid leading UTF-8 octet: #FA at 0)
+ (reader error: invalid leading UTF-8 octet: #FB at 0)

2 first bytes of 6-byte sequences {0xfc-0xfd}:
+ (reader error: invalid leading UTF-8 octet: #FC at 0)
+ (reader error: invalid leading UTF-8 octet: #FD at 0)

sequences with last byte missing {u-0}:
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: invalid leading UTF-8 octet: #F8 at 0)
+ (reader error: invalid leading UTF-8 octet: #FC at 0)

sequences with last byte missing {u-...FF}:
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: incomplete UTF-8 octet sequence at 0)
+ (reader error: invalid leading UTF-8 octet: #FB at 0)
+ (reader error: invalid leading UTF-8 octet: #FD at 0)

impossible bytes:
+ (reader error: invalid leading UTF-8 octet: #FE at 0)
+ (reader error: invalid leading UTF-8 octet: #FF at 0)
+ (reader error: invalid leading UTF-8 octet: #FE at 0)

overlong sequences {u-2f}:
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid leading UTF-8 octet: #F8 at 0)
+ (reader error: invalid leading UTF-8 octet: #FC at 0)

maximum overlong sequences:
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid leading UTF-8 octet: #F8 at 0)
+ (reader error: invalid leading UTF-8 octet: #FC at 0)

overlong representation of the NUL character:
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid length of a UTF-8 sequence at 0)
+ (reader error: invalid leading UTF-8 octet: #F8 at 0)
+ (reader error: invalid leading UTF-8 octet: #FC at 0)

single UTF-16 surrogates:
+ (reader error: invalid Unicode character: #D800 at 0)
+ (reader error: invalid Unicode character: #DB7F at 0)
+ (reader error: invalid Unicode character: #DB80 at 0)
+ (reader error: invalid Unicode character: #DBFF at 0)
+ (reader error: invalid Unicode character: #DC00 at 0)
+ (reader error: invalid Unicode character: #DF80 at 0)
+ (reader error: invalid Unicode character: #DFFF at 0)

paired UTF-16 surrogates:
+ (reader error: invalid Unicode character: #D800 at 0)
+ (reader error: invalid Unicode character: #D800 at 0)
+ (reader error: invalid Unicode character: #DB7F at 0)
+ (reader error: invalid Unicode character: #DB7F at 0)
+ (reader error: invalid Unicode character: #DB80 at 0)
+ (reader error: invalid Unicode character: #DB80 at 0)
+ (reader error: invalid Unicode character: #DBFF at 0)
+ (reader error: invalid Unicode character: #DBFF at 0)

other illegal code positions:
+ (reader error: control characters are not allowed: #FFFE at 0)
+ (reader error: control characters are not allowed: #FFFF at 0)

checking utf-8 sequences: 0 fail(s)
checking boms...

	no bom (utf-8): +
	bom (utf-8): +
	bom (utf-16-le): +
	bom (utf-16-be): +

checking boms: 0 fail(s)
checking a long utf8 sequence...
checking a long utf8 sequence: 0 fail(s)
checking a long utf16 sequence...
checking a long utf16 sequence: 0 fail(s)
PASS: test-reader
sizeof(token) = 80
sizeof(event) = 104
sizeof(parser) = 480
PASS: test-version
DURATION: 0
END: /usr/lib/libyaml/ptest
STOP: ptest-runner

---
Changes in v4:
- Remove conditional check in do_install_ptest
- Use libtool --mode=install instead of direct install from .libs/
- Don't redirect test output to allow debugging of failures

Changes in v3:
- Remove redundant executable check in run_test function

Changes in v2:
- Remove hardcoded version from test summary
- Remove static XFAIL/XPASS/ERROR lines (always 0)
- Move PTEST_TESTS definition above functions for better readability
- Auto-discover test binaries in run-ptest

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../recipes-support/libyaml/libyaml/run-ptest | 38 +++++++++++++++++++
 meta/recipes-support/libyaml/libyaml_0.2.5.bb | 19 +++++++++-
 3 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-support/libyaml/libyaml/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..6a0c23586e 100644
@@ -49,6 +49,7 @@ PTESTS_FAST = "\
     libxml-simple-perl \
     libxml2 \
     libxmlb \
+    libyaml \
     logrotate \
     lua \
     lzo \
meta/recipes-support/libyaml/libyaml/run-ptest new file +38 -0
new file mode 100755
index 0000000000..fa7d9bdb5a
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# run-ptest - Execute libyaml test suite
+
+cd tests || exit 1
+
+TOTAL=0
+PASS=0
+FAIL=0
+
+run_test() {
+    test_name="$1"
+    test_bin="./${test_name}"
+
+    TOTAL=$((TOTAL + 1))
+
+    if ${test_bin}; then
+        echo "PASS: ${test_name}"
+        PASS=$((PASS + 1))
+    else
+        echo "FAIL: ${test_name}"
+        FAIL=$((FAIL + 1))
+        return 1
+    fi
+}
+
+for test_bin in ./test-*; do
+    if [ -x "${test_bin}" ]; then
+        test_name=$(basename "${test_bin}")
+        run_test "${test_name}"
+    fi
+done
+
+echo "# TOTAL: ${TOTAL}"
+echo "# PASS:  ${PASS}"
+echo "# FAIL:  ${FAIL}"
+
+test ${FAIL} -eq 0
meta/recipes-support/libyaml/libyaml_0.2.5.bb +17 -2
index 0d8e8762d5..3587f2f250 100644
@@ -7,14 +7,29 @@ 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"
+
+PTEST_TESTS = "test-version test-reader"
+
+do_compile_ptest() {
+    oe_runmake -C tests ${PTEST_TESTS}
+}
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    for test in ${PTEST_TESTS}; do
+        ${B}/libtool --mode=install install ${B}/tests/${test} ${D}${PTEST_PATH}/tests/
+    done
+}
Signature · 1 line
2.43.0