From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: pipe-filter-ii tests: Fix long-standing failure on native Windows
Date: Tue, 15 Jun 2021 18:38:01 +0200 [thread overview]
Message-ID: <6200769.fZFnhCkfei@omega> (raw)
The test-pipe-filter-ii2.sh test never worked on native Windows, due
to CR-LF and even CR-CR-LF seequences in the output.
2021-06-15 Bruno Haible <bruno@clisp.org>
pipe-filter-ii tests: Fix long-standing failure on native Windows.
* tests/test-pipe-filter-ii2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-ii2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
diff --git a/tests/test-pipe-filter-ii2-child.c b/tests/test-pipe-filter-ii2-child.c
index 14c9863..2610988 100644
--- a/tests/test-pipe-filter-ii2-child.c
+++ b/tests/test-pipe-filter-ii2-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-ii2-main.c b/tests/test-pipe-filter-ii2-main.c
index 3674e01..aad0505 100644
--- a/tests/test-pipe-filter-ii2-main.c
+++ b/tests/test-pipe-filter-ii2-main.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <signal.h>
+#include "binary-io.h"
#include "full-write.h"
#include "macros.h"
@@ -88,6 +89,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. */
{
struct locals l;
reply other threads:[~2021-06-15 16:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6200769.fZFnhCkfei@omega \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).