bug-gnulib
[Top][All Lists]
Advanced

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

Re: xstrtol: fix test failure on mingw


From: Jim Meyering
Subject: Re: xstrtol: fix test failure on mingw
Date: Tue, 22 Apr 2008 19:23:51 +0200

Bruno Haible <address@hidden> wrote:

> The tests test-xstrtol.sh, test-xstrtoimax.sh, test-xstrtoumax.sh, for two
> reasons:
>   1) The test wants to filter out the program name from the error message,
>      but this does not work on mingw: when the error message is
>        c:\work space\gltests\test-xstrtol.exe: invalid X argument
>      it is no easy to determine where the file name end and where the error
>      message begins. In particular, searching for the first colon does not 
> work.
>   2) The output has CRLFs, but is compared against expected output with only 
> NLs.
>
> This fixes it.
>
>
> 2008-04-21  Bruno Haible  <address@hidden>
>
>       Fix test failures on mingw.
>       * tests/test-xstrtol.c (print_no_progname): New function.
>       (main): Install it in error_print_progname hook.
>       * tests/test-xstrtol.sh: Convert CR/LF to NL in output.
>       * tests/test-xstrtoimax.sh: Likewise.
>       * tests/test-xstrtoumax.sh: Likewise.

> *** tests/test-xstrtoimax.sh.orig     2008-04-22 00:41:25.000000000 +0200
> --- tests/test-xstrtoimax.sh  2008-04-22 00:39:23.000000000 +0200
> ***************
> *** 20,26 ****
>   ./test-xstrtoimax${EXEEXT} MiB >> t-xstrtoimax.tmp 2>&1 || result=1
>
>   # normalize output
> ! sed -e 's/^[^:]*: //' < t-xstrtoimax.tmp > t-xstrtoimax.xo
>   mv t-xstrtoimax.xo t-xstrtoimax.tmp
>
>   # compare expected output
> --- 20,26 ----
>   ./test-xstrtoimax${EXEEXT} MiB >> t-xstrtoimax.tmp 2>&1 || result=1
>
>   # normalize output
> ! LC_ALL=C tr -d '\r' < t-xstrtoimax.tmp > t-xstrtoimax.xo

Hi Bruno,

I hear that there really do exist systems in actual use
on which tr still does not honor backslash-escapes like \r and \n.
So you might want to change that \r to \015, in spite of the
ASCII dependency.




reply via email to

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