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
Signed-off-by: Pratik Farkase <[email protected]>
---
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
diff --git a/meta/conf/distro/include/ptest-packagelists.inc
b/meta/conf/distro/include/ptest-packagelists.inc
index 06d113e264..6a0c23586e 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -49,6 +49,7 @@ PTESTS_FAST = "\
libxml-simple-perl \
libxml2 \
libxmlb \
+ libyaml \
logrotate \
lua \
lzo \
diff --git a/meta/recipes-support/libyaml/libyaml/run-ptest
b/meta/recipes-support/libyaml/libyaml/run-ptest
new file mode 100755
index 0000000000..fa7d9bdb5a
--- /dev/null
+++ b/meta/recipes-support/libyaml/libyaml/run-ptest
@@ -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
diff --git a/meta/recipes-support/libyaml/libyaml_0.2.5.bb
b/meta/recipes-support/libyaml/libyaml_0.2.5.bb
index 0d8e8762d5..3587f2f250 100644
--- a/meta/recipes-support/libyaml/libyaml_0.2.5.bb
+++ b/meta/recipes-support/libyaml/libyaml_0.2.5.bb
@@ -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
+}
--
2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#229046):
https://lists.openembedded.org/g/openembedded-core/message/229046
Mute This Topic: https://lists.openembedded.org/mt/117149753/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-