Skip to contentSkip to conversation

tests: mingw32 make check fixes

PATCH Superseded Stefan Hajnoczi 2 participants 5 messages Mar 27, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover tests: mingw32 make check fixes

v2:
* Use ifeq instead of using *-n [Andreas]

make check is broken on mingw32 builds because we the CONFIG_POSIX checks are outdated. This series fixes them.

It should make the buildbot happy again for mingw32 where we fail make check:
http://buildbot.b1-systems.de/qemu/builders

Stefan Hajnoczi (2):
tests: skip POSIX-only tests on Windows
tests: correctly skip qtest on non-POSIX hosts

 tests/Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH v2 1/2 tests: skip POSIX-only tests on Windows

test-aio, test-rfifolock, and test-vmstate only build on POSIX hosts. Exclude them if building for Windows.

---
 tests/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/Makefile +3 -3
index 2d021fb..803c8e6 100644
@@ -34,8 +34,8 @@ gcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
 check-unit-y += tests/test-iov$(EXESUF)
 gcov-files-test-iov-y = util/iov.c
-check-unit-y += tests/test-aio$(EXESUF)
-check-unit-y += tests/test-rfifolock$(EXESUF)
+check-unit-$(CONFIG_POSIX) += tests/test-aio$(EXESUF)
+check-unit-$(CONFIG_POSIX) += tests/test-rfifolock$(EXESUF)
 check-unit-y += tests/test-throttle$(EXESUF)
 gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
 gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
@@ -59,7 +59,7 @@ check-unit-y += tests/test-bitops$(EXESUF)
 check-unit-y += tests/test-qdev-global-props$(EXESUF)
 check-unit-y += tests/check-qom-interface$(EXESUF)
 gcov-files-check-qom-interface-y = qom/object.c
-check-unit-y += tests/test-vmstate$(EXESUF)
+check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
 
 check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
Signature · 1 line
1.8.5.3
Reviewed-by on v2 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH v2 1/2] tests: skip POSIX-only tests on Windows

Am 27.03.2014 15:28, schrieb Stefan Hajnoczi:

Quoted 24 lines

test-aio, test-rfifolock, and test-vmstate only build on POSIX hosts. Exclude them if building for Windows.

---
 tests/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/Makefile +2 -2
index 2d021fb..803c8e6 100644
@@ -34,8 +34,8 @@ gcov-files-test-coroutine-y = coroutine-$(CONFIG_COROUTINE_BACKEND).c
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
 check-unit-y += tests/test-iov$(EXESUF)
 gcov-files-test-iov-y = util/iov.c
-check-unit-y += tests/test-aio$(EXESUF)
-check-unit-y += tests/test-rfifolock$(EXESUF)
+check-unit-$(CONFIG_POSIX) += tests/test-aio$(EXESUF)
+check-unit-$(CONFIG_POSIX) += tests/test-rfifolock$(EXESUF)
 check-unit-y += tests/test-throttle$(EXESUF)
 gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
 gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c

tests/Makefile check-unit-y += tests/test-bitops$(EXESUF) · line 64

Quoted 7 lines
tests/Makefile +1 -1
@@ -59,7 +59,7 @@ check-unit-y += tests/test-bitops$(EXESUF)
 check-unit-y += tests/test-qdev-global-props$(EXESUF)
 check-unit-y += tests/check-qom-interface$(EXESUF)
 gcov-files-check-qom-interface-y = qom/object.c
-check-unit-y += tests/test-vmstate$(EXESUF)
+check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF)
 
 check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh

Hi Stefan,

can you add
http://repo.or.cz/w/qemu/ar7.git/patch/1df736569169f20ae27a62ecd786a61fbd43d7cd
to your series instead of removing test-aio for Windows?

For the rest:

#3 lore raw

PATCH v2 2/2 tests: correctly skip qtest on non-POSIX hosts

In reply to Stefan Hajnoczi

qtest test cases only work on POSIX hosts. The following line only defines dependencies for qtest binaries on POSIX hosts:

  check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS),$(check-qtest-$(TARGET)-y))

But the QTEST_TARGETS definition earlier in the Makefile fails to check CONFIG_POSIX. The causes targets to be generated for qtest test cases even though we don't know how to build the binaries.

The following error message is printed when trying to run gtester on a binary that was never built:

GLib-WARNING **: Failed to execute test binary: tests/endianness-test.exe: Failed to execute child process "tests/endianness-test.exe" (No such file or directory)

This patch makes QTEST_TARGETS empty on non-POSIX hosts. This prevents the targets from being generated.

---
 tests/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/Makefile +3 -1
index 803c8e6..679cfbc 100644
@@ -277,8 +277,10 @@ tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_hel
 # QTest rules
 
 TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
+ifeq ($(CONFIG_POSIX),y)
 QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
-check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
+check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
+endif
 
 qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
 $(check-qtest-y): $(qtest-obj-y)
Signature · 1 line
1.8.5.3
Reviewed-by on v2 2/2
#4 lore raw

Re: [Qemu-devel] [PATCH v2 2/2] tests: correctly skip qtest on non-POSIX hosts

Am 27.03.2014 15:28, schrieb Stefan Hajnoczi:

Quoted 7 lines

qtest test cases only work on POSIX hosts. The following line only defines dependencies for qtest binaries on POSIX hosts:

  check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS),$(check-qtest-$(TARGET)-y))

But the QTEST_TARGETS definition earlier in the Makefile fails to check CONFIG_POSIX. The causes targets to be generated for qtest test cases

That causes targets ... ?

Quoted 20 lines

even though we don't know how to build the binaries.

The following error message is printed when trying to run gtester on a binary that was never built:

GLib-WARNING **: Failed to execute test binary: tests/endianness-test.exe: Failed to execute child process "tests/endianness-test.exe" (No such file or directory)

This patch makes QTEST_TARGETS empty on non-POSIX hosts. This prevents the targets from being generated.

---
 tests/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/Makefile +0 -0
index 803c8e6..679cfbc 100644

tests/Makefile tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_hel · line 282

Quoted 7 lines
tests/Makefile +2 -1
@@ -277,8 +277,10 @@ tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_hel
 # QTest rules
 
 TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
+ifeq ($(CONFIG_POSIX),y)
 QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
-check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
+check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))

I'd keep this line unmodified after the endif, but that's just my personal style preference.

tests/Makefile tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_hel · line 286

Quoted 5 lines
tests/Makefile +1 -0
+endif
 
 qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
 $(check-qtest-y): $(qtest-obj-y)

My own patch also works because CONFIG_POSIX is undefined for Windows:
http://repo.or.cz/w/qemu/ar7.git/patch/fb8019dc75641ce7b35d40d4836663acb9c17b8b