diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2021-02-04 17:07:14 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-02-05 08:16:32 +0000 |
commit | 03bf6b3ec0aaa24e9f81b3b0024c59f7cc77b410 (patch) | |
tree | 7eabda26432abde9b6d8136cf911498dab046d0b | |
parent | c05385c88746b8e969d79b6140f5916c4a8bac86 (diff) | |
download | poky-03bf6b3ec0aaa24e9f81b3b0024c59f7cc77b410.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
(From OE-Core rev: a5c1290e8a24b844f0ba62df270f976096394d87)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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" | |||
6 | HOMEPAGE = "http://qemu.org" | 6 | HOMEPAGE = "http://qemu.org" |
7 | LICENSE = "GPLv2 & LGPLv2.1" | 7 | LICENSE = "GPLv2 & LGPLv2.1" |
8 | 8 | ||
9 | RDEPENDS_${PN}-ptest = "bash make" | 9 | RDEPENDS_${PN}-ptest = "bash" |
10 | 10 | ||
11 | require qemu-targets.inc | 11 | require qemu-targets.inc |
12 | inherit pkgconfig ptest | 12 | inherit pkgconfig ptest |
@@ -18,7 +18,6 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
18 | file://powerpc_rom.bin \ | 18 | file://powerpc_rom.bin \ |
19 | file://run-ptest \ | 19 | file://run-ptest \ |
20 | file://0001-qemu-Add-missing-wacom-HID-descriptor.patch \ | 20 | file://0001-qemu-Add-missing-wacom-HID-descriptor.patch \ |
21 | file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \ | ||
22 | file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ | 21 | file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ |
23 | file://0004-qemu-disable-Valgrind.patch \ | 22 | file://0004-qemu-disable-Valgrind.patch \ |
24 | file://0006-chardev-connect-socket-to-a-spawned-command.patch \ | 23 | file://0006-chardev-connect-socket-to-a-spawned-command.patch \ |
@@ -50,18 +49,11 @@ do_install_append() { | |||
50 | if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi | 49 | if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi |
51 | } | 50 | } |
52 | 51 | ||
53 | do_compile_ptest() { | ||
54 | make buildtest-TESTS | ||
55 | } | ||
56 | |||
57 | do_install_ptest() { | 52 | do_install_ptest() { |
58 | cp -rL ${B}/tests ${D}${PTEST_PATH} | 53 | cp -rL ${B}/tests ${D}${PTEST_PATH} |
59 | find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {} | 54 | find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcodp]" | xargs -i rm -rf {} |
60 | 55 | ||
61 | cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests | ||
62 | # Don't check the file genreated by configure | 56 | # Don't check the file genreated by configure |
63 | sed -i -e '/wildcard config-host.mak/d' \ | ||
64 | -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include | ||
65 | sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \ | 57 | sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \ |
66 | ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env | 58 | ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env |
67 | sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh | 59 | 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 @@ | |||
1 | From 5da6cef7761157a003e7ebde74fb3cf90ab396d9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Juro Bystricky <juro.bystricky@intel.com> | ||
3 | Date: Thu, 31 Aug 2017 11:06:56 -0700 | ||
4 | Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for | ||
5 | qemu. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
10 | |||
11 | Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> | ||
12 | |||
13 | [update patch context] | ||
14 | Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> | ||
15 | --- | ||
16 | tests/Makefile.include | 8 ++++++++ | ||
17 | 1 file changed, 8 insertions(+) | ||
18 | |||
19 | Index: qemu-5.2.0/tests/Makefile.include | ||
20 | =================================================================== | ||
21 | --- qemu-5.2.0.orig/tests/Makefile.include | ||
22 | +++ qemu-5.2.0/tests/Makefile.include | ||
23 | @@ -155,4 +155,12 @@ clean: check-clean | ||
24 | |||
25 | check-speed: bench-speed | ||
26 | |||
27 | +buildtest-TESTS: $(check-unit-y) | ||
28 | + | ||
29 | +runtest-TESTS: | ||
30 | + for f in $(check-unit-y); do \ | ||
31 | + nf=$$(echo $$f | sed 's/tests\//\.\//g'); \ | ||
32 | + $$nf; \ | ||
33 | + done | ||
34 | + | ||
35 | 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")") | |||
7 | export SRC_PATH=$ptestdir | 7 | export SRC_PATH=$ptestdir |
8 | 8 | ||
9 | cd $ptestdir/tests | 9 | cd $ptestdir/tests |
10 | make -f Makefile.include -k runtest-TESTS | sed '/^ok /s/ok /PASS: /g' | 10 | tests=$(find . -name "test-*" ! -name "*.p") |
11 | for f in $tests; do | ||
12 | $f | sed '/^ok/ s/ok/PASS:/g' | ||
13 | done | ||