summaryrefslogtreecommitdiffstats
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-10-01 21:45:56 +0100
commit1ab3a237397663cdbffc914b51f086682623c4a3 (patch)
treef7258363eea990d0b8bb03924b474bf40d52d174 /meta/recipes-core/kbd/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/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 @@
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