[PATCH 2/3] tests: skip serial test on windows

Marc-André Lureau posted 3 patches 6 years, 1 month ago
Maintainers: Stefan Weil <sw@weilnetz.de>, Fam Zheng <fam@euphon.net>, Stefan Hajnoczi <stefanha@redhat.com>
[PATCH 2/3] tests: skip serial test on windows
Posted by Marc-André Lureau 6 years, 1 month ago
Serial test is currently hard-coded to /dev/null.

On Windows, serial chardev expect a COM: device, which may not be
availble.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/test-char.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test-char.c b/tests/test-char.c
index d62de1b088..45e42af290 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -1103,7 +1103,7 @@ static void char_socket_server_two_clients_test(gconstpointer opaque)
 }
 
 
-#ifdef HAVE_CHARDEV_SERIAL
+#if defined(HAVE_CHARDEV_SERIAL) && !defined(WIN32)
 static void char_serial_test(void)
 {
     QemuOpts *opts;
@@ -1460,7 +1460,7 @@ int main(int argc, char **argv)
 #endif
 
     g_test_add_func("/char/udp", char_udp_test);
-#ifdef HAVE_CHARDEV_SERIAL
+#if defined(HAVE_CHARDEV_SERIAL) && !defined(WIN32)
     g_test_add_func("/char/serial", char_serial_test);
 #endif
     g_test_add_func("/char/hotswap", char_hotswap_test);
-- 
2.23.0


Re: [PATCH 2/3] tests: skip serial test on windows
Posted by Philippe Mathieu-Daudé 6 years, 1 month ago
On 10/1/19 3:26 PM, Marc-André Lureau wrote:
> Serial test is currently hard-coded to /dev/null.
> 
> On Windows, serial chardev expect a COM: device, which may not be
> availble.

"available"

> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   tests/test-char.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/test-char.c b/tests/test-char.c
> index d62de1b088..45e42af290 100644
> --- a/tests/test-char.c
> +++ b/tests/test-char.c
> @@ -1103,7 +1103,7 @@ static void char_socket_server_two_clients_test(gconstpointer opaque)
>   }
>   
>   
> -#ifdef HAVE_CHARDEV_SERIAL
> +#if defined(HAVE_CHARDEV_SERIAL) && !defined(WIN32)
>   static void char_serial_test(void)
>   {
>       QemuOpts *opts;
> @@ -1460,7 +1460,7 @@ int main(int argc, char **argv)
>   #endif
>   
>       g_test_add_func("/char/udp", char_udp_test);
> -#ifdef HAVE_CHARDEV_SERIAL
> +#if defined(HAVE_CHARDEV_SERIAL) && !defined(WIN32)
>       g_test_add_func("/char/serial", char_serial_test);
>   #endif
>       g_test_add_func("/char/hotswap", char_hotswap_test);
>