Bruno Haible <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
>
> 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.