summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2021-02-04 17:07:14 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-05 08:16:28 +0000
commita5c1290e8a24b844f0ba62df270f976096394d87 (patch)
treed361267a0c8bd6176f74889eb6f0f310d75e44e6 /meta
parent551ce73a90757ba43501fe5cf9ac84a7b77de549 (diff)
downloadopenembedded-core-contrib-a5c1290e8a24b844f0ba62df270f976096394d87.tar.gz
qemu: make ptest rework
After qemu upgrades to 5.2.0 in commit [1], if also switches to meson and the previous logic which introduces the testsuites changes in [2] and results in below error when run ptest test: # ./run-ptest for f in ; do \ nf=$(echo $f | sed 's/tests\//\.\//g'); \ $nf; \ done So refactor the ptest part code to make it work again. [1] https://git.openembedded.org/openembedded-core/commit/?id=181c635567aafb9b4787d8d6d0bcd4a615ceae80 [2] https://git.qemu.org/?p=qemu.git;a=commitdiff;h=279588d4deea2694ebe9ceb29dfdc5c08a7c4e27 Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc12
-rw-r--r--meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch35
-rw-r--r--meta/recipes-devtools/qemu/qemu/run-ptest5
3 files changed, 6 insertions, 46 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index c894b81b10..cb854914b2 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -6,7 +6,7 @@ a variety of guest operating systems"
HOMEPAGE = "http://qemu.org"
LICENSE = "GPLv2 & LGPLv2.1"
-RDEPENDS_${PN}-ptest = "bash make"
+RDEPENDS_${PN}-ptest = "bash"
require qemu-targets.inc
inherit pkgconfig ptest
@@ -18,7 +18,6 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://powerpc_rom.bin \
file://run-ptest \
file://0001-qemu-Add-missing-wacom-HID-descriptor.patch \
- file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \
file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \
file://0004-qemu-disable-Valgrind.patch \
file://0006-chardev-connect-socket-to-a-spawned-command.patch \
@@ -50,18 +49,11 @@ do_install_append() {
if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
}
-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 {}
+ find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcodp]" | xargs -i rm -rf {}
- cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
# Don't check the file genreated by configure
- sed -i -e '/wildcard config-host.mak/d' \
- -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include
sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \
${D}/${PTEST_PATH}/tests/qemu-iotests/common.env
sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh
diff --git a/meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch b/meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch
deleted file mode 100644
index 3cb1dac9c3..0000000000
--- a/meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 5da6cef7761157a003e7ebde74fb3cf90ab396d9 Mon Sep 17 00:00:00 2001
-From: Juro Bystricky <juro.bystricky@intel.com>
-Date: Thu, 31 Aug 2017 11:06:56 -0700
-Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for
- qemu.
-
-Upstream-Status: Pending
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
-
-Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
-
-[update patch context]
-Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
----
- tests/Makefile.include | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-Index: qemu-5.2.0/tests/Makefile.include
-===================================================================
---- qemu-5.2.0.orig/tests/Makefile.include
-+++ qemu-5.2.0/tests/Makefile.include
-@@ -155,4 +155,12 @@ clean: check-clean
-
- check-speed: bench-speed
-
-+buildtest-TESTS: $(check-unit-y)
-+
-+runtest-TESTS:
-+ for f in $(check-unit-y); do \
-+ nf=$$(echo $$f | sed 's/tests\//\.\//g'); \
-+ $$nf; \
-+ done
-+
- endif
diff --git a/meta/recipes-devtools/qemu/qemu/run-ptest b/meta/recipes-devtools/qemu/qemu/run-ptest
index b25a792d4f..f9a4e8fb2b 100644
--- a/meta/recipes-devtools/qemu/qemu/run-ptest
+++ b/meta/recipes-devtools/qemu/qemu/run-ptest
@@ -7,4 +7,7 @@ ptestdir=$(dirname "$(readlink -f "$0")")
export SRC_PATH=$ptestdir
cd $ptestdir/tests
-make -f Makefile.include -k runtest-TESTS | sed '/^ok /s/ok /PASS: /g'
+tests=$(find . -name "test-*" ! -name "*.p")
+for f in $tests; do
+ $f | sed '/^ok/ s/ok/PASS:/g'
+done