bug-gnulib
[Top][All Lists]
Advanced

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

Re: dfa tests: Fix test failure on mingw


From: Bruno Haible
Subject: Re: dfa tests: Fix test failure on mingw
Date: Thu, 20 Apr 2023 21:55:54 +0200

Paul Eggert wrote:
> > +LC_ALL=C ${CHECKER} test-dfa-match-aux '[[:foo:]]' a > tmp 2>&1
> > +LC_ALL=C tr -d '\r' < tmp > out
> 
> This sort of change means we won't catch stray CRs in the output.
> 
> Is there some way we can instead compile or run MinGW apps so that they 
> instead follow the POSIX LF convention?

Sure. Instead of the change above, I can alternatively add a
  set_binary_mode (STDOUT_FILENO, O_BINARY);
call to the C program.

In general, though, I prefer the approach to filter out the CRs
(or convert CR-LF pairs to LF) to the O_BINARY approach.
Rationale: On native Windows, the default is the O_TEXT mode, and therefore
it is more important to test the behaviour of that mode, than of the
O_BINARY mode that few programs use.
Think of: How to maximize the usefulness of a test, while keeping it
essentially at the same code size?

Bruno






reply via email to

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