diff options
Diffstat (limited to 'tests/spawn-test.c')
-rw-r--r-- | tests/spawn-test.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/spawn-test.c b/tests/spawn-test.c index b4091faff..87ad8eed5 100644 --- a/tests/spawn-test.c +++ b/tests/spawn-test.c @@ -60,6 +60,7 @@ run_tests (void) printf ("Errors after this are not supposed to happen:\n"); err = NULL; +#ifdef G_OS_UNIX if (!g_spawn_command_line_sync ("/bin/sh -c 'echo hello'", &output, NULL, NULL, &err)) @@ -82,6 +83,33 @@ run_tests (void) g_free (output); } +#else +#ifdef G_OS_WIN32 + if (!g_spawn_command_line_sync ("ipconfig /all", + &output, NULL, NULL, + &err)) + { + fprintf (stderr, "Error: %s\n", err->message); + g_error_free (err); + exit (1); + } + else + { + g_assert (output != NULL); + + if (strstr (output, "IP Configuration") == 0) + { + printf ("output was '%s', should have contained 'IP Configuration'\n", + output); + + exit (1); + } + + g_free (output); + } + +#endif +#endif } int |