aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiu Tingting <qiutt@fujitsu.com>2023-06-28 10:53:25 +0800
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2023-07-18 18:09:16 +0000
commit1712fa4839d373fb0f9ea7d92925a57a9aee4c52 (patch)
tree6779ca1c31b66069e030228fcce26dc0b60e682c
parentabe0dd1124c58d10c3156091cdd99651ee5439d5 (diff)
kbd: Add ptest supportpike_15.92.0pike/15.92.015.92.0
Add a ptest for kbd. It is a backport for https://lists.openembedded.org/g/openembedded-core/topic/patch_v4_kbd_add_ptest/99258821 It should be deleted after yocto version up. SPEC-4753 Signed-off-by: Qiu Tingting <qiutt@fujitsu.com> Change-Id: I98d0781239f17b01bb9cba3f06a3dfc100fc201f
-rw-r--r--meta-agl-test/recipes-core/kbd/files/run-ptest12
-rw-r--r--meta-agl-test/recipes-core/kbd/kbd_2.4.0.bbappend76
2 files changed, 88 insertions, 0 deletions
diff --git a/meta-agl-test/recipes-core/kbd/files/run-ptest b/meta-agl-test/recipes-core/kbd/files/run-ptest
new file mode 100644
index 00000000..0eab90ea
--- /dev/null
+++ b/meta-agl-test/recipes-core/kbd/files/run-ptest
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Define test work dir
+WORKDIR=@PTEST_PATH@/tests/
+
+# Run test
+cd ${WORKDIR}
+
+./testsuite -k unittest | sed -e '/[0-9]:/s/://' \
+ -e '/ ok/s/^/PASS: /;/ FAILED/s/^/FAIL: /;/ skipped/s/^/SKIP: /' \
+ -e '/ ok/s/ ok.*//;/ skipped/s/ skipped.*//;/ FAILED/s/ FAILED.*//'
+
diff --git a/meta-agl-test/recipes-core/kbd/kbd_2.4.0.bbappend b/meta-agl-test/recipes-core/kbd/kbd_2.4.0.bbappend
new file mode 100644
index 00000000..a588bf51
--- /dev/null
+++ b/meta-agl-test/recipes-core/kbd/kbd_2.4.0.bbappend
@@ -0,0 +1,76 @@
+# Add ptest support
+# backport of yocto
+#
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI += " \
+ file://run-ptest \
+"
+
+inherit ptest
+
+do_compile_ptest() {
+ # update DATADIR in Makefile
+ sed -i 's,-DDATADIR=.*,-DDATADIR=\\\"${PTEST_PATH}/tests\\\" \\,g' ${B}/tests/libkeymap/Makefile
+ sed -i 's,-DDATADIR=.*,-DDATADIR=\\\"${PTEST_PATH}/tests\\\" \\,g' ${B}/tests/helpers/Makefile
+ sed -i 's,-DDATADIR=.*,-DDATADIR=\\\"${PTEST_PATH}/tests\\\" \\,g' ${B}/tests/libkbdfile/Makefile
+
+ # unset -D_TIME_BITS=64 in Makefile
+ sed -i 's,-D_TIME_BITS=64,,g' ${B}/tests/libtswrap/Makefile
+
+ # recompile tests
+ oe_runmake -C ${B}/tests/ clean
+ oe_runmake -C ${B}/tests/
+}
+
+do_install_ptest() {
+ # install files from build directory
+ install -d ${D}${PTEST_PATH}/tests/
+ install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
+ install --mode=755 ${B}/tests/testsuite ${D}${PTEST_PATH}/tests/
+ install -d ${D}${PTEST_PATH}/tests/libkeymap/
+ find ${B}/tests/libkeymap/ -type f -not -name "*.o" -not -name "Makefile" \
+ -exec install --mode=755 {} ${D}${PTEST_PATH}/tests/libkeymap/ \;
+ install -d ${D}${PTEST_PATH}/tests/helpers/
+ find ${B}/tests/helpers/ -type f -not -name "*.o" -not -name "Makefile" \
+ -exec install --mode=755 {} ${D}${PTEST_PATH}/tests/helpers/ \;
+ install -d ${D}${PTEST_PATH}/tests/libkbdfile/
+ find ${B}/tests/libkbdfile/ -type f -not -name "*.o" -not -name "Makefile" \
+ -exec install --mode=755 {} ${D}${PTEST_PATH}/tests/libkbdfile/ \;
+ install -d ${D}${PTEST_PATH}/src/
+ install --mode=755 ${B}/src/loadkeys ${D}${PTEST_PATH}/src/
+
+ # install files from src/data directory
+ install -d ${D}${PTEST_PATH}/data/keymaps/i386/qwerty/
+ install ${S}/data/keymaps/i386/qwerty/defkeymap.map ${D}${PTEST_PATH}/data/keymaps/i386/qwerty/
+
+ # install files from src/tests/data directory
+ install -d ${D}${PTEST_PATH}/tests/data/
+ install -d ${D}${PTEST_PATH}/tests/data/libkeymap/
+ install ${S}/tests/data/libkeymap/* ${D}${PTEST_PATH}/tests/data/libkeymap/
+ install -d ${D}${PTEST_PATH}/tests/data/alt-is-meta/
+ install ${S}/tests/data/alt-is-meta/* ${D}${PTEST_PATH}/tests/data/alt-is-meta/
+ install -d ${D}${PTEST_PATH}/tests/data/bkeymap-2.0.4/
+ install ${S}/tests/data/bkeymap-2.0.4/* ${D}${PTEST_PATH}/tests/data/bkeymap-2.0.4/
+ install -d ${D}${PTEST_PATH}/tests/data/dumpkeys-mktable/
+ install ${S}/tests/data/dumpkeys-mktable/* ${D}${PTEST_PATH}/tests/data/dumpkeys-mktable/
+ install -d ${D}${PTEST_PATH}/tests/data/dumpkeys-fulltable/
+ install ${S}/tests/data/dumpkeys-fulltable/* ${D}${PTEST_PATH}/tests/data/dumpkeys-fulltable/
+ install -d ${D}${PTEST_PATH}/tests/data/findfile/test_1/consolefonts/
+ install ${S}/tests/data/findfile/test_1/consolefonts/* ${D}${PTEST_PATH}/tests/data/findfile/test_1/consolefonts/
+ install -d ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/include/
+ install ${S}/tests/data/findfile/test_0/keymaps/test0.map ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/
+ install ${S}/tests/data/findfile/test_0/keymaps/include/* ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/include/
+ install -d ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/i386/include/
+ install ${S}/tests/data/findfile/test_0/keymaps/i386/include/* ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/i386/include/
+ install -d ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/i386/qwerty/
+ install ${S}/tests/data/findfile/test_0/keymaps/i386/qwerty/* ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/i386/qwerty/
+ install -d ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/i386/qwertz/
+ install ${S}/tests/data/findfile/test_0/keymaps/i386/qwertz/* ${D}${PTEST_PATH}/tests/data/findfile/test_0/keymaps/i386/qwertz/
+
+
+ # update PTEST_PATH in run-ptest
+ sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/run-ptest
+ sed -i -e 's,${B},${PTEST_PATH},g' -e 's,/\.\./kbd-2.4.0,,g' ${D}${PTEST_PATH}/tests/atconfig
+}
+