summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/kbd
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2016-09-30 16:49:55 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-01 21:45:56 +0100
commit1ab3a237397663cdbffc914b51f086682623c4a3 (patch)
treef7258363eea990d0b8bb03924b474bf40d52d174 /meta/recipes-core/kbd
parent315973803278cf0fc6197e61daaf93cbf820ab59 (diff)
downloadpoky-1ab3a237397663cdbffc914b51f086682623c4a3.tar.gz
kbd: create ptest sub-package
Create kbd-ptest sub-package: * add file run-ptest and runtime dependency make * modify installed Makefile to disable remake Makefile and the test cases when run the ptest * add patch to set proper path for test cases to get resource files (From OE-Core rev: 901ccb3e70e9036112c51acc6d18d05025f6e1bb) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/kbd')
-rw-r--r--meta/recipes-core/kbd/kbd/run-ptest4
-rw-r--r--meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch56
-rw-r--r--meta/recipes-core/kbd/kbd_2.0.3.bb19
3 files changed, 79 insertions, 0 deletions
diff --git a/meta/recipes-core/kbd/kbd/run-ptest b/meta/recipes-core/kbd/kbd/run-ptest
new file mode 100644
index 0000000000..7a2d205f54
--- /dev/null
+++ b/meta/recipes-core/kbd/kbd/run-ptest
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3CURDIR=$(dirname `readlink -f $0`)
4make -k -C ${CURDIR}/tests check-TESTS
diff --git a/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch b/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
new file mode 100644
index 0000000000..27d6f42aae
--- /dev/null
+++ b/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3kbd is out of source built, then the value of $(srcdir) is relative path of
4${S}/tests to ${B}/tests. Macro DATADIR is defined with $(srcdir) and replaced
5in .c files by compiler, and string @DATADIR@ is replaced with $(srdir) by rule
6"%: %.in" in Makefile.
7
8But kbd-ptest puts test cases and resource files in same directory, then some
9ptest cases fail to find resources.
10
11Replace DATADIR and @DATADIR@ with current directory(dot) to make test cases
12run as expected.
13
14Signed-off-by: Kai Kang <kai.kang@windriver.com>
15
16diff --git a/tests/Makefile.am b/tests/Makefile.am
17index 1976333..b36aef3 100644
18--- a/tests/Makefile.am
19+++ b/tests/Makefile.am
20@@ -1,7 +1,7 @@
21 AM_CPPFLAGS = \
22 -I$(srcdir)/../src/libkeymap \
23 -I$(builddir)/../src/libkeymap \
24- -DDATADIR=\"$(srcdir)\" -DBUILDDIR=\"$(builddir)\"
25+ -DDATADIR=\".\" -DBUILDDIR=\"$(builddir)\"
26
27 AM_CFLAGS = $(CHECK_CFLAGS)
28 LDADD = $(top_builddir)/src/libkeymap/libkeymap.la $(CHECK_LIBS)
29diff --git a/tests/alt-is-meta.in b/tests/alt-is-meta.in
30index ddd5ed8..772fb51 100755
31--- a/tests/alt-is-meta.in
32+++ b/tests/alt-is-meta.in
33@@ -7,8 +7,8 @@ cd "$cwd"
34 rc=0
35 temp="$(mktemp "@BUILDDIR@/temp.XXXXXXXXX")"
36
37-./libkeymap-showmaps "@DATADIR@"/alt-is-meta.map > "$temp" || rc=$?
38-cmp -s "@DATADIR@//alt-is-meta.output" "$temp" || rc=$?
39+./libkeymap-showmaps ./alt-is-meta.map > "$temp" || rc=$?
40+cmp -s "./alt-is-meta.output" "$temp" || rc=$?
41
42 if [ "$rc" != 0 ]; then
43 printf 'failed\n'
44diff --git a/tests/dumpkeys-fulltable.in b/tests/dumpkeys-fulltable.in
45index 7c856e5..14d92c1 100755
46--- a/tests/dumpkeys-fulltable.in
47+++ b/tests/dumpkeys-fulltable.in
48@@ -5,7 +5,7 @@ cwd="$(readlink -ev "${0%/*}")"
49 cd "$cwd"
50
51 BUILDDIR="@BUILDDIR@"
52-DATADIR="@DATADIR@"
53+DATADIR="."
54
55 check_keymap() {
56 local kmap temp rc
diff --git a/meta/recipes-core/kbd/kbd_2.0.3.bb b/meta/recipes-core/kbd/kbd_2.0.3.bb
index ea1e0b48d1..54d16835fc 100644
--- a/meta/recipes-core/kbd/kbd_2.0.3.bb
+++ b/meta/recipes-core/kbd/kbd_2.0.3.bb
@@ -11,6 +11,8 @@ RPROVIDES_${PN} = "console-tools"
11RCONFLICTS_${PN} = "console-tools" 11RCONFLICTS_${PN} = "console-tools"
12 12
13SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \ 13SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
14 file://run-ptest \
15 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://set-proper-path-of-resources.patch', '', d)} \
14 " 16 "
15 17
16SRC_URI[md5sum] = "231b46e7142eb41ea3ae06d2ded3c208" 18SRC_URI[md5sum] = "231b46e7142eb41ea3ae06d2ded3c208"
@@ -19,6 +21,21 @@ SRC_URI[sha256sum] = "7a899de1c0eb75f3aea737095a736f2375e1cbfbe693fc14a3fe0bfb46
19PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" 21PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
20PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam," 22PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
21 23
24do_compile_ptest() {
25 oe_runmake -C ${B}/tests dumpkeys-fulltable alt-is-meta
26}
27
28do_install_ptest() {
29 install -D ${B}/tests/Makefile ${D}${PTEST_PATH}/tests/Makefile
30 sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
31 -e '/libkeymap_.*_SOURCES =/d' -e '/$(EXEEXT):/,/^$/d' ${D}${PTEST_PATH}/tests/Makefile
32
33 find ${B}/tests -executable -exec install {} ${D}${PTEST_PATH}/tests \;
34 find ${S}/tests \( -name \*.map -o -name \*.bin -o -name \*.output \) -exec install {} ${D}${PTEST_PATH}/tests \;
35
36 install -D -m 755 ${S}/config/test-driver ${D}${PTEST_PATH}/config/test-driver
37}
38
22PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans" 39PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
23 40
24FILES_${PN}-consolefonts = "${datadir}/consolefonts" 41FILES_${PN}-consolefonts = "${datadir}/consolefonts"
@@ -26,6 +43,8 @@ FILES_${PN}-consoletrans = "${datadir}/consoletrans"
26FILES_${PN}-keymaps = "${datadir}/keymaps" 43FILES_${PN}-keymaps = "${datadir}/keymaps"
27FILES_${PN}-unimaps = "${datadir}/unimaps" 44FILES_${PN}-unimaps = "${datadir}/unimaps"
28 45
46RDEPENDS_${PN}-ptest = "make"
47
29inherit update-alternatives 48inherit update-alternatives
30 49
31ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt" 50ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt"