diff mbox series

[V2] kbd: Add ptest support

Message ID 1684284787-11933-1-git-send-email-qiutt@fujitsu.com
State New
Headers show
Series [V2] kbd: Add ptest support | expand

Commit Message

qiutt@fujitsu.com May 17, 2023, 12:53 a.m. UTC
From: Qiu Tingting <qiutt@fujitsu.com>

Add a ptest for kbd
- It is taking around 1s to execute with kvm, so added it to PTESTS_FAST
- It contains libkeymap unit tests(27 cases) and libkbdfile unit tests(13 cases)

Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
---
 meta/recipes-core/kbd/files/run-ptest | 11 +++++
 meta/recipes-core/kbd/kbd_2.5.1.bb    | 71 ++++++++++++++++++++++++++-
 2 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/kbd/files/run-ptest

Comments

Alexandre Belloni May 19, 2023, 2:27 p.m. UTC | #1
Hello,

This doesn't build:

https://autobuilder.yoctoproject.org/typhoon/#/builders/103/builds/6024/steps/12/logs/stdio

| make[1]: Entering directory '/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build/tests/libtswrap'
| /bin/bash ../../libtool  --tag=CC   --mode=compile i686-poky-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../kbd-2.5.1/tests/libtswrap -I../..   -I../../../kbd-2.5.1/tests/libtswrap -I.   -g -O0 -O2 -D_FORTIFY_SOURCE=2  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native=  -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -c -o ioctl.lo ../../../kbd-2.5.1/tests/libtswrap/ioctl.c
| libtool: compile:  i686-poky-linux-gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../kbd-2.5.1/tests/libtswrap -I../.. -I../../../kbd-2.5.1/tests/libtswrap -I. -g -O0 -O2 -D_FORTIFY_SOURCE=2 -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native= -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -c ../../../kbd-2.5.1/tests/libtswrap/ioctl.c  -fPIC -DPIC -o .libs/ioctl.o
| ../../../kbd-2.5.1/tests/libtswrap/ioctl.c: In function 'print_kbsentry':
| ../../../kbd-2.5.1/tests/libtswrap/ioctl.c:257:55: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
|   257 |         dprintf(outfd, "\t\tunsigned char kb_string[%ld] = {\n", sz);
|       |                                                     ~~^          ~~
|       |                                                       |          |
|       |                                                       long int   size_t {aka unsigned int}
|       |                                                     %d
| /bin/bash ../../libtool  --tag=CC   --mode=link i686-poky-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot  -g -O0 -O2 -D_FORTIFY_SOURCE=2  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native=  -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -export-symbols-regex ^ioctl -version-info 1:0:0 -rpath /nowhere -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now -o libtswrap.la  ioctl.lo -ldl
| libtool: link: i686-poky-linux-gcc-nm  .libs/ioctl.o   | sed -n -e 's/^.*[	 ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[	 ][	 ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | sed 's/.* //' | sort | uniq > .libs/libtswrap.exp
| libtool: link: /home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/hosttools/grep -E -e "^ioctl" ".libs/libtswrap.exp" > ".libs/libtswrap.expT"
| libtool: link: mv -f ".libs/libtswrap.expT" ".libs/libtswrap.exp"
| libtool: link: echo "{ global:" > .libs/libtswrap.ver
| libtool: link:  cat .libs/libtswrap.exp | sed -e "s/\(.*\)/\1;/" >> .libs/libtswrap.ver
| libtool: link:  echo "local: *; };" >> .libs/libtswrap.ver
| libtool: link:  i686-poky-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -shared  -fPIC -DPIC  .libs/ioctl.o   -ldl  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -O2 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -g -O0 -O2 -O2 -g -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native= -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,libtswrap.so.1 -Wl,-version-script -Wl,.libs/libtswrap.ver -o .libs/libtswrap.so.1.0.0
| /home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/i686-poky-linux/../../libexec/i686-poky-linux/gcc/i686-poky-linux/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
| collect2: error: ld returned 1 exit status

This also warns:

WARNING: kbd-2.5.1-r0 do_package_qa: QA Issue: supports ptests but is not included in oe-core's ptest-packagelists.inc [missing-ptest]


On 17/05/2023 08:53:07+0800, qiutt@fujitsu.com wrote:
> From: Qiu Tingting <qiutt@fujitsu.com>
> 
> Add a ptest for kbd
> - It is taking around 1s to execute with kvm, so added it to PTESTS_FAST
> - It contains libkeymap unit tests(27 cases) and libkbdfile unit tests(13 cases)
> 
> Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
> ---
>  meta/recipes-core/kbd/files/run-ptest | 11 +++++
>  meta/recipes-core/kbd/kbd_2.5.1.bb    | 71 ++++++++++++++++++++++++++-
>  2 files changed, 81 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-core/kbd/files/run-ptest
> 
> diff --git a/meta/recipes-core/kbd/files/run-ptest b/meta/recipes-core/kbd/files/run-ptest
> new file mode 100644
> index 0000000000..3b154c4d73
> --- /dev/null
> +++ b/meta/recipes-core/kbd/files/run-ptest
> @@ -0,0 +1,11 @@
> +#!/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/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb
> index 7662b8f685..943cd8a6ba 100644
> --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
> +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
> @@ -5,7 +5,7 @@ DESCRIPTION = "The kbd project contains tools for managing Linux console (Linux
>  LICENSE = "GPL-2.0-or-later"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>  
> -inherit autotools gettext pkgconfig
> +inherit autotools gettext pkgconfig ptest
>  
>  DEPENDS += "flex-native"
>  
> @@ -14,6 +14,7 @@ RPROVIDES:${PN} = "console-tools"
>  RCONFLICTS:${PN} = "console-tools"
>  
>  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
> +           file://run-ptest \
>             "
>  
>  SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
> @@ -45,3 +46,71 @@ ALTERNATIVE:${PN} = "chvt deallocvt fgconsole openvt showkey \
>  ALTERNATIVE_PRIORITY = "100"
>  
>  BBCLASSEXTEND = "native"
> +
> +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
> +
> +    # 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/
> +    install -d ${D}${PTEST_PATH}/tests/data/keymaps/i386/qwerty/
> +    install ${S}/tests/data/keymaps/i386/qwerty/* ${D}${PTEST_PATH}/tests/data/keymaps/i386/qwerty/
> +    install -d ${D}${PTEST_PATH}/tests/data/keymaps/i386/include/
> +    install ${S}/tests/data/keymaps/i386/include/* ${D}${PTEST_PATH}/tests/data/keymaps/i386/include/
> +    install -d ${D}${PTEST_PATH}/tests/data/keymaps/include/
> +    install ${S}/tests/data/keymaps/include/* ${D}${PTEST_PATH}/tests/data/keymaps/include/
> +
> +
> +    # update PTEST_PATH in run-ptest and atconfig
> +    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.5.1,,g' ${D}${PTEST_PATH}/tests/atconfig
> +}
> -- 
> 2.25.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#181425): https://lists.openembedded.org/g/openembedded-core/message/181425
> Mute This Topic: https://lists.openembedded.org/mt/98939715/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Khem Raj May 19, 2023, 3:50 p.m. UTC | #2
On Fri, May 19, 2023 at 7:27 AM Alexandre Belloni via
lists.openembedded.org
<alexandre.belloni=bootlin.com@lists.openembedded.org> wrote:
>
> Hello,
>
> This doesn't build:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/103/builds/6024/steps/12/logs/stdio
>
> | make[1]: Entering directory '/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build/tests/libtswrap'
> | /bin/bash ../../libtool  --tag=CC   --mode=compile i686-poky-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../kbd-2.5.1/tests/libtswrap -I../..   -I../../../kbd-2.5.1/tests/libtswrap -I.   -g -O0 -O2 -D_FORTIFY_SOURCE=2  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native=  -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -c -o ioctl.lo ../../../kbd-2.5.1/tests/libtswrap/ioctl.c
> | libtool: compile:  i686-poky-linux-gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../../kbd-2.5.1/tests/libtswrap -I../.. -I../../../kbd-2.5.1/tests/libtswrap -I. -g -O0 -O2 -D_FORTIFY_SOURCE=2 -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native= -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -c ../../../kbd-2.5.1/tests/libtswrap/ioctl.c  -fPIC -DPIC -o .libs/ioctl.o
> | ../../../kbd-2.5.1/tests/libtswrap/ioctl.c: In function 'print_kbsentry':
> | ../../../kbd-2.5.1/tests/libtswrap/ioctl.c:257:55: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
> |   257 |         dprintf(outfd, "\t\tunsigned char kb_string[%ld] = {\n", sz);
> |       |                                                     ~~^          ~~
> |       |                                                       |          |
> |       |                                                       long int   size_t {aka unsigned int}
> |       |                                                     %d
> | /bin/bash ../../libtool  --tag=CC   --mode=link i686-poky-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot  -g -O0 -O2 -D_FORTIFY_SOURCE=2  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native=  -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization -Wextra -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -export-symbols-regex ^ioctl -version-info 1:0:0 -rpath /nowhere -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot=  -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now -o libtswrap.la  ioctl.lo -ldl
> | libtool: link: i686-poky-linux-gcc-nm  .libs/ioctl.o   | sed -n -e 's/^.*[     ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | sed 's/.* //' | sort | uniq > .libs/libtswrap.exp
> | libtool: link: /home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/hosttools/grep -E -e "^ioctl" ".libs/libtswrap.exp" > ".libs/libtswrap.expT"
> | libtool: link: mv -f ".libs/libtswrap.expT" ".libs/libtswrap.exp"
> | libtool: link: echo "{ global:" > .libs/libtswrap.ver
> | libtool: link:  cat .libs/libtswrap.exp | sed -e "s/\(.*\)/\1;/" >> .libs/libtswrap.ver
> | libtool: link:  echo "local: *; };" >> .libs/libtswrap.ver
> | libtool: link:  i686-poky-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -shared  -fPIC -DPIC  .libs/ioctl.o   -ldl  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -O2 --sysroot=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot -g -O0 -O2 -O2 -g -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0 -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0 -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fmacro-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot= -fdebug-prefix-map=/home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native= -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,libtswrap.so.1 -Wl,-version-script -Wl,.libs/libtswrap.ver -o .libs/libtswrap.so.1.0.0
> | /home/pokybuild/yocto-worker/genericx86-alt/build/build/tmp/work/core2-32-poky-linux/kbd/2.5.1-r0/recipe-sysroot-native/usr/bin/i686-poky-linux/../../libexec/i686-poky-linux/gcc/i686-poky-linux/12.2.0/ld:.libs/libtswrap.ver:2: syntax error in VERSION script
> | collect2: error: ld returned 1 exit status
>
> This also warns:
>
> WARNING: kbd-2.5.1-r0 do_package_qa: QA Issue: supports ptests but is not included in oe-core's ptest-packagelists.inc [missing-ptest]
>
>

Seeing the same errors with clang

https://errors.yoctoproject.org/Errors/Details/704724/


> On 17/05/2023 08:53:07+0800, qiutt@fujitsu.com wrote:
> > From: Qiu Tingting <qiutt@fujitsu.com>
> >
> > Add a ptest for kbd
> > - It is taking around 1s to execute with kvm, so added it to PTESTS_FAST
> > - It contains libkeymap unit tests(27 cases) and libkbdfile unit tests(13 cases)
> >
> > Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
> > ---
> >  meta/recipes-core/kbd/files/run-ptest | 11 +++++
> >  meta/recipes-core/kbd/kbd_2.5.1.bb    | 71 ++++++++++++++++++++++++++-
> >  2 files changed, 81 insertions(+), 1 deletion(-)
> >  create mode 100644 meta/recipes-core/kbd/files/run-ptest
> >
> > diff --git a/meta/recipes-core/kbd/files/run-ptest b/meta/recipes-core/kbd/files/run-ptest
> > new file mode 100644
> > index 0000000000..3b154c4d73
> > --- /dev/null
> > +++ b/meta/recipes-core/kbd/files/run-ptest
> > @@ -0,0 +1,11 @@
> > +#!/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/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb
> > index 7662b8f685..943cd8a6ba 100644
> > --- a/meta/recipes-core/kbd/kbd_2.5.1.bb
> > +++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
> > @@ -5,7 +5,7 @@ DESCRIPTION = "The kbd project contains tools for managing Linux console (Linux
> >  LICENSE = "GPL-2.0-or-later"
> >  LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
> >
> > -inherit autotools gettext pkgconfig
> > +inherit autotools gettext pkgconfig ptest
> >
> >  DEPENDS += "flex-native"
> >
> > @@ -14,6 +14,7 @@ RPROVIDES:${PN} = "console-tools"
> >  RCONFLICTS:${PN} = "console-tools"
> >
> >  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
> > +           file://run-ptest \
> >             "
> >
> >  SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
> > @@ -45,3 +46,71 @@ ALTERNATIVE:${PN} = "chvt deallocvt fgconsole openvt showkey \
> >  ALTERNATIVE_PRIORITY = "100"
> >
> >  BBCLASSEXTEND = "native"
> > +
> > +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
> > +
> > +    # 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/
> > +    install -d ${D}${PTEST_PATH}/tests/data/keymaps/i386/qwerty/
> > +    install ${S}/tests/data/keymaps/i386/qwerty/* ${D}${PTEST_PATH}/tests/data/keymaps/i386/qwerty/
> > +    install -d ${D}${PTEST_PATH}/tests/data/keymaps/i386/include/
> > +    install ${S}/tests/data/keymaps/i386/include/* ${D}${PTEST_PATH}/tests/data/keymaps/i386/include/
> > +    install -d ${D}${PTEST_PATH}/tests/data/keymaps/include/
> > +    install ${S}/tests/data/keymaps/include/* ${D}${PTEST_PATH}/tests/data/keymaps/include/
> > +
> > +
> > +    # update PTEST_PATH in run-ptest and atconfig
> > +    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.5.1,,g' ${D}${PTEST_PATH}/tests/atconfig
> > +}
> > --
> > 2.25.1
> >
>
> >
> >
> >
>
>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#181552): https://lists.openembedded.org/g/openembedded-core/message/181552
> Mute This Topic: https://lists.openembedded.org/mt/98939715/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
qiutt@fujitsu.com May 25, 2023, 2:16 a.m. UTC | #3
I tried to build it with

> 
> TARGET_SYS           = "i686-oe-linux"
> MACHINE              = "qemux86"
> 

but there is no error in do_compile_ptest_base.

> 
> make[1]: Entering directory
> '/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build/tests/helpers'
> 
> i686-oe-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
> --sysroot=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot
> -DHAVE_CONFIG_H -I. -I../../../kbd-2.5.1/tests/helpers -I../..  
> -I../../../kbd-2.5.1/src/libcommon -I../../../kbd-2.5.1/src/libkeymap
> -I../../../kbd-2.5.1/src/libkbdfile -DDATADIR=\"/usr/lib/kbd/ptest/tests\"
> -DBUILDDIR=\"/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build/tests/helpers\"
> -O2 -D_FORTIFY_SOURCE=2  -O2 -pipe -g -feliminate-unused-debug-types
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot-native=
> -Waggregate-return -Wall -Wcast-align -Wconversion -Wdisabled-optimization
> -Wextra -Wmissing-declarations -Wmissing-format-attribute
> -Wmissing-noreturn -Wmissing-prototypes -Wpointer-arith -Wredundant-decls
> -Wshadow -Wstrict-prototypes -Wwrite-strings -c -o libkeymap-bkeymap.o
> ../../../kbd-2.5.1/tests/helpers/libkeymap-bkeymap.c
> ...
> libtool: link:  echo "local: *; };" >> .libs/libtswrap.ver
> libtool: link:  i686-oe-linux-gcc  -m32 -march=core2 -mtune=core2 -msse3
> -mfpmath=sse
> --sysroot=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot
> -shared  -fPIC -DPIC  .libs/ioctl.o   -ldl  -m32 -march=core2 -mtune=core2
> -msse3 -mfpmath=sse
> --sysroot=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot
> -g -O0 -O2 -O2 -g
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot-native=
> -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/kbd-2.5.1=/usr/src/debug/kbd/2.5.1-r0
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build=/usr/src/debug/kbd/2.5.1-r0
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=
> -fmacro-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot=
> -fdebug-prefix-map=/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/recipe-sysroot-native=
> -Wl,-soname -Wl,libtswrap.so.1 -Wl,-version-script -Wl,.libs/libtswrap.ver
> -o .libs/libtswrap.so.1.0.0
> libtool: link: (cd ".libs" && rm -f "libtswrap.so.1" && ln -s
> "libtswrap.so.1.0.0" "libtswrap.so.1")
> libtool: link: (cd ".libs" && rm -f "libtswrap.so" && ln -s
> "libtswrap.so.1.0.0" "libtswrap.so")
> libtool: link: i686-oe-linux-gcc-ar cr .libs/libtswrap.a  ioctl.o
> libtool: link: i686-oe-linux-gcc-ranlib .libs/libtswrap.a
> libtool: link: ( cd ".libs" && rm -f "libtswrap.la" && ln -s
> "../libtswrap.la" "libtswrap.la" )
> make[1]: Leaving directory
> '/AGL-WORK/Yocto/oe-core/build-genericx86/tmp-glibc/work/core2-32-oe-linux/kbd/2.5.1-r0/build/tests/libtswrap'
> 
> 

Maybe the gcc is different.
Could you share your build steps?
diff mbox series

Patch

diff --git a/meta/recipes-core/kbd/files/run-ptest b/meta/recipes-core/kbd/files/run-ptest
new file mode 100644
index 0000000000..3b154c4d73
--- /dev/null
+++ b/meta/recipes-core/kbd/files/run-ptest
@@ -0,0 +1,11 @@ 
+#!/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/recipes-core/kbd/kbd_2.5.1.bb b/meta/recipes-core/kbd/kbd_2.5.1.bb
index 7662b8f685..943cd8a6ba 100644
--- a/meta/recipes-core/kbd/kbd_2.5.1.bb
+++ b/meta/recipes-core/kbd/kbd_2.5.1.bb
@@ -5,7 +5,7 @@  DESCRIPTION = "The kbd project contains tools for managing Linux console (Linux
 LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-inherit autotools gettext pkgconfig
+inherit autotools gettext pkgconfig ptest
 
 DEPENDS += "flex-native"
 
@@ -14,6 +14,7 @@  RPROVIDES:${PN} = "console-tools"
 RCONFLICTS:${PN} = "console-tools"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
+           file://run-ptest \
            "
 
 SRC_URI[sha256sum] = "ccdf452387a6380973d2927363e9cbb939fa2068915a6f937ff9d24522024683"
@@ -45,3 +46,71 @@  ALTERNATIVE:${PN} = "chvt deallocvt fgconsole openvt showkey \
 ALTERNATIVE_PRIORITY = "100"
 
 BBCLASSEXTEND = "native"
+
+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
+
+    # 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/
+    install -d ${D}${PTEST_PATH}/tests/data/keymaps/i386/qwerty/
+    install ${S}/tests/data/keymaps/i386/qwerty/* ${D}${PTEST_PATH}/tests/data/keymaps/i386/qwerty/
+    install -d ${D}${PTEST_PATH}/tests/data/keymaps/i386/include/
+    install ${S}/tests/data/keymaps/i386/include/* ${D}${PTEST_PATH}/tests/data/keymaps/i386/include/
+    install -d ${D}${PTEST_PATH}/tests/data/keymaps/include/
+    install ${S}/tests/data/keymaps/include/* ${D}${PTEST_PATH}/tests/data/keymaps/include/
+
+
+    # update PTEST_PATH in run-ptest and atconfig
+    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.5.1,,g' ${D}${PTEST_PATH}/tests/atconfig
+}