bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pipe-filter-gi tests: Fix long-standing failure on native Windows


From: Bruno Haible
Subject: pipe-filter-gi tests: Fix long-standing failure on native Windows
Date: Fri, 09 Sep 2022 14:49:34 +0200

In a testdir with SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN set to 1 instead of 0,
there is a test failure:
  FAIL: test-pipe-filter-gi2.sh

This patch fixes it. Similar to the corresponding patch
"pipe-filter-ii tests: Fix long-standing failure on native Windows" from
2021-06-15.


2022-09-09  Bruno Haible  <bruno@clisp.org>

        pipe-filter-gi tests: Fix long-standing failure on native Windows.
        * tests/test-pipe-filter-gi2-main.c: Include binary-io.h.
        (main): Avoid NL to CRLF conversion on standard output.
        * tests/test-pipe-filter-gi2-child.c: Include <unistd.h>, binary-io.h.
        (main): Avoid NL to CRLF conversion on standard output.

diff --git a/tests/test-pipe-filter-gi2-child.c 
b/tests/test-pipe-filter-gi2-child.c
index f9f7884deb..684d907de5 100644
--- a/tests/test-pipe-filter-gi2-child.c
+++ b/tests/test-pipe-filter-gi2-child.c
@@ -20,10 +20,15 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
+
+#include "binary-io.h"
 
 int
 main ()
 {
+  set_binary_mode (STDOUT_FILENO, O_BINARY);
+
   /* Repeatedly: Read two integers i and j, then output all integers in the
      range i..j, one per line.  */
   for (;;)
diff --git a/tests/test-pipe-filter-gi2-main.c 
b/tests/test-pipe-filter-gi2-main.c
index 09d0f55412..e0f97e4c0c 100644
--- a/tests/test-pipe-filter-gi2-main.c
+++ b/tests/test-pipe-filter-gi2-main.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <signal.h>
 
+#include "binary-io.h"
 #include "full-write.h"
 #include "macros.h"
 
@@ -74,6 +75,8 @@ main (int argc, char **argv)
 
   ASSERT (argc == 2);
 
+  set_binary_mode (STDOUT_FILENO, O_BINARY);
+
   /* Test writing to a nonexistent program traps sooner or later.  */
   {
     int rc;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]