Skip to contentSkip to conversation

tests: mingw32 make check fixes

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

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover tests: mingw32 make check fixes

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 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH 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
#6 lore raw

PATCH 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/Makefile +2 -1
index 803c8e6..e1960c1 100644
@@ -277,7 +277,8 @@ tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_hel
 # QTest rules
 
 TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
-QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
+QTEST_TARGETS=$(foreach TARGET,$(TARGETS), \
+                $(if $(check-qtest-$(TARGET)-$(CONFIG_POSIX)), $(TARGET),))
 check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
 
 qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
Signature · 1 line
1.8.5.3
#8 lore raw
In reply to Stefan Hajnoczi
Quoted 6 lines · Stefan Hajnoczi

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

Quoted 6 lines

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

 tests/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Forgot to mark this for-2.0.

#2 lore raw

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

In reply to Stefan Hajnoczi

Il 27/03/2014 12:11, Stefan Hajnoczi ha scritto:

Quoted 1 line

test-aio, test-rfifolock, and test-vmstate only build on POSIX hosts.

test-aio should build on Win32. Can be fixed in 2.1 though.

Paolo

Quoted 32 lines

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
 
#7 lore raw

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

In reply to Stefan Hajnoczi

Am 27.03.2014 12:11, schrieb Stefan Hajnoczi:

Quoted 27 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 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/Makefile +0 -0
index 803c8e6..e1960c1 100644

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

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

This strikes me as wrong. Essentially this is working around the fact that tests get added to -y although they should've been added for $(CONFIG_POSIX) only. I have a patch pending that adds a virtio-9p qtest, which is conditional on having the three ugly conditions evaluate to y, and otherwise will evaluate to -n. So this new query would actually find a non-empty -n variable on !CONFIG_POSIX and would still add the target to QTEST_TARGETS.

My suggestion would be to simply put this line into ifeq ($(CONFIG_POSIX),y) to keep the logic simple and safe.

Regards,
Andreas

Quoted 3 lines
tests/Makefile +0 -0
 check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
 
 qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#3 lore raw

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

In reply to Paolo Bonzini
Quoted 6 lines · Paolo Bonzini

Il 27/03/2014 12:11, Stefan Hajnoczi ha scritto:

Quoted 1 line

test-aio, test-rfifolock, and test-vmstate only build on POSIX hosts.

test-aio should build on Win32. Can be fixed in 2.1 though.

Yes, we may be able to make the tests support Windows. test-aio was broken due to qemu_pipe() usage.

If anyone wants to make the tests build on Windows for 2.1, great.

Stefan

#4 lore raw

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

Am 27.03.2014 15:01, schrieb Stefan Hajnoczi:

Quoted 6 lines · Paolo Bonzini
Quoted 5 lines

Il 27/03/2014 12:11, Stefan Hajnoczi ha scritto:

Quoted 1 line

test-aio, test-rfifolock, and test-vmstate only build on POSIX hosts.

Quoted 6 lines
Quoted 1 line

test-aio should build on Win32. Can be fixed in 2.1 though.

Yes, we may be able to make the tests support Windows. test-aio was broken due to qemu_pipe() usage.

If anyone wants to make the tests build on Windows for 2.1, great.

...or 2.0 for that matter, but unless that happens I intend to queue this patch. :)

Cheers,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#5 lore raw

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

In reply to Paolo Bonzini

Am 27.03.2014 12:53, schrieb Paolo Bonzini:

Quoted 7 lines

Il 27/03/2014 12:11, Stefan Hajnoczi ha scritto:

Quoted 1 line

test-aio, test-rfifolock, and test-vmstate only build on POSIX hosts.

test-aio should build on Win32. Can be fixed in 2.1 though.

Paolo

The modifications for tests-aio.c are trivial: conditionally remove test_timer_schedule, test_source_timer_schedule and all related code.

Here is a patch which does this:

http://repo.or.cz/w/qemu/ar7.git/commit/1df736569169f20ae27a62ecd786a61fbd43d7cd

Regards
Stefan