aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2015-08-04 11:25:36 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-09 15:14:30 -0700
commita79435797ee60f5858c952646f864c04113e5803 (patch)
treecc32606f7205f280e0a23dd203ac2347ef8ce309 /meta/recipes-devtools/qemu
parenta172c208c821af7f9527fe25f337f51c52ba8793 (diff)
downloadopenembedded-core-contrib-a79435797ee60f5858c952646f864c04113e5803.tar.gz
qemu: add ptest sub-package
Add sub-package ptest which runs all unit tests cases for qemu. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu')
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc16
-rw-r--r--meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch29
-rw-r--r--meta/recipes-devtools/qemu/qemu/run-ptest8
3 files changed, 52 insertions, 1 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 6a744c3e34..c3f73d1ec5 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -3,9 +3,10 @@ HOMEPAGE = "http://qemu.org"
LICENSE = "GPLv2 & LGPLv2.1"
DEPENDS = "glib-2.0 zlib pixman"
RDEPENDS_${PN}_class-target += "bash python"
+RDEPENDS_${PN}-ptest = "bash make"
require qemu-targets.inc
-inherit autotools
+inherit autotools ptest
BBCLASSEXTEND = "native nativesdk"
PR = "r1"
@@ -18,6 +19,8 @@ SRC_URI = "\
file://disable-grabs.patch \
file://exclude-some-arm-EABI-obsolete-syscalls.patch \
file://wacom.patch \
+ file://add-ptest-in-makefile.patch \
+ file://run-ptest \
"
SRC_URI_append_class-native = "\
@@ -54,6 +57,17 @@ do_configure() {
test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
}
+do_compile_ptest() {
+ make buildtest-TESTS
+}
+
+do_install_ptest() {
+ cp -rL ${B}/tests ${D}${PTEST_PATH}
+ find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
+
+ cp ${S}/tests/Makefile ${D}${PTEST_PATH}/tests
+}
+
do_install () {
export STRIP="true"
autotools_do_install
diff --git a/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch b/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
new file mode 100644
index 0000000000..a99f72098c
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Add subpackage -ptest which runs all unit test cases for qemu.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ tests/Makefile | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index 88f7105..3f40b4b 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -405,3 +405,12 @@ all: $(QEMU_IOTESTS_HELPERS-y)
+
+ -include $(wildcard tests/*.d)
+ -include $(wildcard tests/libqos/*.d)
++
++buildtest-TESTS: $(check-unit-y)
++
++runtest-TESTS:
++ for f in $(check-unit-y); do \
++ nf=$$(echo $$f | sed 's/tests\//\.\//g'); \
++ $$nf; \
++ done
++
+--
+1.7.9.5
+
diff --git a/meta/recipes-devtools/qemu/qemu/run-ptest b/meta/recipes-devtools/qemu/qemu/run-ptest
new file mode 100644
index 0000000000..f4b8e97e1e
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+#This script is used to run qemu test suites
+ptestdir=$(pwd)
+cd tests
+
+export SRC_PATH=$ptestdir
+make -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'