]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemu: add ptest sub-package
authorKai Kang <kai.kang@windriver.com>
Tue, 4 Aug 2015 03:25:36 +0000 (11:25 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 9 Aug 2015 22:14:30 +0000 (15:14 -0700)
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>
meta/recipes-devtools/qemu/qemu.inc
meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch [new file with mode: 0644]
meta/recipes-devtools/qemu/qemu/run-ptest [new file with mode: 0644]

index 6a744c3e34a2aaa66c5339ca21dab8f5bf96c13a..c3f73d1ec5f3c199f9d08164f6aebe1fa3aa1023 100644 (file)
@@ -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 (file)
index 0000000..a99f720
--- /dev/null
@@ -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 (file)
index 0000000..f4b8e97
--- /dev/null
@@ -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'