Skip to contentSkip to conversation

tests: mingw32 make check fixes

PATCH In review Stefan Hajnoczi 3 participants 8 messages Mar 28, 2014 – Mar 31, 2014

lore
Share & tools
lore
#0 lore raw

v3 cover tests: mingw32 make check fixes

v3:
* Add Stefan Weil's test-aio fix patch [Stefan Weil]
* Patch 3 commit description s/The causes targets/This causes make targets/ [Stefan Weil]

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

Stefan Weil (1):
tests: Remove unsupported tests for MinGW

 tests/Makefile   |  8 +++++---
 tests/test-aio.c | 16 ++++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH v3 1/3 tests: Remove unsupported tests for MinGW

From: Stefan Weil <[email protected]>

test_timer_schedule and test_source_timer_schedule don't compile for MinGW because some functions are not implemented for MinGW (qemu_pipe, aio_set_fd_handler).

---
 tests/test-aio.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
tests/test-aio.c +16 -0
index 56f4288..e5f8b55 100644
@@ -65,6 +65,8 @@ static void bh_test_cb(void *opaque)
     }
 }
 
+#if !defined(_WIN32)
+
 static void timer_test_cb(void *opaque)
 {
     TimerTestData *data = opaque;
@@ -78,6 +80,8 @@ static void dummy_io_handler_read(void *opaque)
 {
 }
 
+#endif /* !_WIN32 */
+
 static void bh_delete_cb(void *opaque)
 {
     BHTestData *data = opaque;
@@ -423,6 +427,8 @@ static void test_wait_event_notifier_noflush(void)
     event_notifier_cleanup(&data.e);
 }
 
+#if !defined(_WIN32)
+
 static void test_timer_schedule(void)
 {
     TimerTestData data = { .n = 0, .ctx = ctx, .ns = SCALE_MS * 750LL,
@@ -484,6 +490,8 @@ static void test_timer_schedule(void)
     timer_del(&data.timer);
 }
 
+#endif /* !_WIN32 */
+
 /* Now the same tests, using the context as a GSource.  They are
  * very similar to the ones above, with g_main_context_iteration
  * replacing aio_poll.  However:
@@ -766,6 +774,8 @@ static void test_source_wait_event_notifier_noflush(void)
     event_notifier_cleanup(&data.e);
 }
 
+#if !defined(_WIN32)
+
 static void test_source_timer_schedule(void)
 {
     TimerTestData data = { .n = 0, .ctx = ctx, .ns = SCALE_MS * 750LL,
@@ -815,6 +825,8 @@ static void test_source_timer_schedule(void)
     timer_del(&data.timer);
 }
 
+#endif /* !_WIN32 */
+
 
 /* End of tests.  */
 
@@ -845,7 +857,9 @@ int main(int argc, char **argv)
     g_test_add_func("/aio/event/wait",              test_wait_event_notifier);
     g_test_add_func("/aio/event/wait/no-flush-cb",  test_wait_event_notifier_noflush);
     g_test_add_func("/aio/event/flush",             test_flush_event_notifier);
+#if !defined(_WIN32)
     g_test_add_func("/aio/timer/schedule",          test_timer_schedule);
+#endif
 
     g_test_add_func("/aio-gsource/notify",                  test_source_notify);
     g_test_add_func("/aio-gsource/flush",                   test_source_flush);
@@ -860,6 +874,8 @@ int main(int argc, char **argv)
     g_test_add_func("/aio-gsource/event/wait",              test_source_wait_event_notifier);
     g_test_add_func("/aio-gsource/event/wait/no-flush-cb",  test_source_wait_event_notifier_noflush);
     g_test_add_func("/aio-gsource/event/flush",             test_source_flush_event_notifier);
+#if !defined(_WIN32)
     g_test_add_func("/aio-gsource/timer/schedule",          test_source_timer_schedule);
+#endif
     return g_test_run();
 }
Signature · 1 line
1.8.5.3
#2 lore raw

PATCH v3 2/3 tests: skip POSIX-only tests on Windows

In reply to Stefan Hajnoczi

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

---
 tests/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/Makefile +2 -2
index 2d021fb..ef286e7 100644
@@ -35,7 +35,7 @@ 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-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
#4 lore raw

PATCH v3 3/3 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. This causes make 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 ef286e7..0e3eb44 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 v3 2/3
#3 lore raw

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

In reply to Stefan Hajnoczi

Am 28.03.2014 10:55, schrieb Stefan Hajnoczi:

Quoted 22 lines

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

---
 tests/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/Makefile +1 -1
index 2d021fb..ef286e7 100644
@@ -35,7 +35,7 @@ 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-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

Thanks.

#5 lore raw
In reply to Stefan Hajnoczi
Quoted 17 lines · Stefan Hajnoczi

v3:
* Add Stefan Weil's test-aio fix patch [Stefan Weil]
* Patch 3 commit description s/The causes targets/This causes make targets/ [Stefan Weil]

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

Quoted 6 lines

Stefan Weil (1):
tests: Remove unsupported tests for MinGW

 tests/Makefile   |  8 +++++---
 tests/test-aio.c | 16 ++++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)

Andreas: Can you take this series or should I send a pull request?

#6 lore raw

Am 31.03.2014 09:26, schrieb Stefan Hajnoczi:

Quoted 18 lines · Stefan Hajnoczi
Quoted 17 lines

v3:
* Add Stefan Weil's test-aio fix patch [Stefan Weil]
* Patch 3 commit description s/The causes targets/This causes make targets/ [Stefan Weil]

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

Quoted 8 lines
Quoted 6 lines

Stefan Weil (1):
tests: Remove unsupported tests for MinGW

 tests/Makefile   |  8 +++++---
 tests/test-aio.c | 16 ++++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)

Andreas: Can you take this series or should I send a pull request?

I still have v2 on qom-next; I'll exchange them later in the day.

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

Am 31.03.2014 10:04, schrieb Andreas Färber:

Quoted 22 lines

Am 31.03.2014 09:26, schrieb Stefan Hajnoczi:

Quoted 21 lines · Stefan Hajnoczi
Quoted 20 lines

v3:
* Add Stefan Weil's test-aio fix patch [Stefan Weil]
* Patch 3 commit description s/The causes targets/This causes make targets/ [Stefan Weil]

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

Stefan Weil (1):
tests: Remove unsupported tests for MinGW

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
 tests/Makefile   |  8 +++++---
 tests/test-aio.c | 16 ++++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)

Andreas: Can you take this series or should I send a pull request?

I still have v2 on qom-next; I'll exchange them later in the day.

Done: https://github.com/afaerber/qemu-cpu/commits/qom-next

Thanks,
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