We need to check for the correct line endings on Windows (\r\n) for the
echo tests and currently need to skip the test_echo_eof test there, as
it depends on the cat utility that is not normally found on Windows, and
using an external installation of cat via MSYS or Cygwin would render the
test program to hang as cat waits for user input.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
#include <gio/gfiledescriptorbased.h>
#endif
#include <gio/gfiledescriptorbased.h>
#endif
+#ifdef G_OS_WIN32
+#define LINEEND "\r\n"
+#define EXEEXT ".exe"
+#else
+#define LINEEND "\n"
+#define EXEEXT
+#endif
+
static GPtrArray *
get_test_subprocess_args (const char *mode,
...) G_GNUC_NULL_TERMINATED;
static GPtrArray *
get_test_subprocess_args (const char *mode,
...) G_GNUC_NULL_TERMINATED;
result = splice_to_string (stdout, error);
g_assert_no_error (local_error);
result = splice_to_string (stdout, error);
g_assert_no_error (local_error);
- g_assert_cmpstr (result, ==, "hello\nworld!\n");
+ g_assert_cmpstr (result, ==, "hello" LINEEND "world!" LINEEND);
g_free (result);
g_object_unref (proc);
g_free (result);
g_object_unref (proc);
+#ifdef G_OS_WIN32
+ g_test_skip ("This test has not been ported to Win32");
+ return;
+#endif
+
/* Spawn 'cat' */
cat = g_subprocess_new (G_SUBPROCESS_FLAGS_STDIN_PIPE | G_SUBPROCESS_FLAGS_STDOUT_PIPE, &error, "cat", NULL);
g_assert_no_error (error);
/* Spawn 'cat' */
cat = g_subprocess_new (G_SUBPROCESS_FLAGS_STDIN_PIPE | G_SUBPROCESS_FLAGS_STDOUT_PIPE, &error, "cat", NULL);
g_assert_no_error (error);