aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/kbd/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-09-30 17:15:10 +0100
commit901ccb3e70e9036112c51acc6d18d05025f6e1bb (patch)
tree40a3416b4237fe08ebea98d148b7a5395c66a92f /meta/recipes-core/kbd/kbd
parent23cca700870230b46d251086441136e99659ef12 (diff)
downloadopenembedded-core-contrib-901ccb3e70e9036112c51acc6d18d05025f6e1bb.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 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/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
2 files changed, 60 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 @@
+#!/bin/sh
+
+CURDIR=$(dirname `readlink -f $0`)
+make -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 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+kbd is out of source built, then the value of $(srcdir) is relative path of
+${S}/tests to ${B}/tests. Macro DATADIR is defined with $(srcdir) and replaced
+in .c files by compiler, and string @DATADIR@ is replaced with $(srdir) by rule
+"%: %.in" in Makefile.
+
+But kbd-ptest puts test cases and resource files in same directory, then some
+ptest cases fail to find resources.
+
+Replace DATADIR and @DATADIR@ with current directory(dot) to make test cases
+run as expected.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 1976333..b36aef3 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -1,7 +1,7 @@
+ AM_CPPFLAGS = \
+ -I$(srcdir)/../src/libkeymap \
+ -I$(builddir)/../src/libkeymap \
+- -DDATADIR=\"$(srcdir)\" -DBUILDDIR=\"$(builddir)\"
++ -DDATADIR=\".\" -DBUILDDIR=\"$(builddir)\"
+
+ AM_CFLAGS = $(CHECK_CFLAGS)
+ LDADD = $(top_builddir)/src/libkeymap/libkeymap.la $(CHECK_LIBS)
+diff --git a/tests/alt-is-meta.in b/tests/alt-is-meta.in
+index ddd5ed8..772fb51 100755
+--- a/tests/alt-is-meta.in
++++ b/tests/alt-is-meta.in
+@@ -7,8 +7,8 @@ cd "$cwd"
+ rc=0
+ temp="$(mktemp "@BUILDDIR@/temp.XXXXXXXXX")"
+
+-./libkeymap-showmaps "@DATADIR@"/alt-is-meta.map > "$temp" || rc=$?
+-cmp -s "@DATADIR@//alt-is-meta.output" "$temp" || rc=$?
++./libkeymap-showmaps ./alt-is-meta.map > "$temp" || rc=$?
++cmp -s "./alt-is-meta.output" "$temp" || rc=$?
+
+ if [ "$rc" != 0 ]; then
+ printf 'failed\n'
+diff --git a/tests/dumpkeys-fulltable.in b/tests/dumpkeys-fulltable.in
+index 7c856e5..14d92c1 100755
+--- a/tests/dumpkeys-fulltable.in
++++ b/tests/dumpkeys-fulltable.in
+@@ -5,7 +5,7 @@ cwd="$(readlink -ev "${0%/*}")"
+ cd "$cwd"
+
+ BUILDDIR="@BUILDDIR@"
+-DATADIR="@DATADIR@"
++DATADIR="."
+
+ check_keymap() {
+ local kmap temp rc