# HG changeset patch # User Bruno Haible # Date 1208817832 -7200 # Node ID 3e7edaaecea226edfedeb63c0680c86df99f6d6b # Parent a5ec2702e64a3a00ca3dd3d1127322332032474a Fix test failures on mingw. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-04-21 Bruno Haible + + 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. + 2008-04-21 Bruno Haible Fix test failure on mingw. diff --git a/tests/test-xstrtoimax.sh b/tests/test-xstrtoimax.sh --- a/tests/test-xstrtoimax.sh +++ b/tests/test-xstrtoimax.sh @@ -20,7 +20,7 @@ ./test-xstrtoimax${EXEEXT} MiB >> t-xstrtoimax.tmp 2>&1 || result=1 # normalize output -sed -e 's/^[^:]*: //' < t-xstrtoimax.tmp > t-xstrtoimax.xo +LC_ALL=C tr -d '\r' < t-xstrtoimax.tmp > t-xstrtoimax.xo mv t-xstrtoimax.xo t-xstrtoimax.tmp # compare expected output diff --git a/tests/test-xstrtol.c b/tests/test-xstrtol.c --- a/tests/test-xstrtol.c +++ b/tests/test-xstrtol.c @@ -1,6 +1,6 @@ /* Test of xstrtol module. Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2005, - 2006, 2007 Free Software Foundation, Inc. + 2006, 2007, 2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,12 @@ char *program_name; +/* Don't show the program name in error messages. */ +static void +print_no_progname (void) +{ +} + int main (int argc, char **argv) { @@ -39,6 +45,8 @@ int i; program_name = argv[0]; + error_print_progname = print_no_progname; + for (i = 1; i < argc; i++) { char *p; diff --git a/tests/test-xstrtol.sh b/tests/test-xstrtol.sh --- a/tests/test-xstrtol.sh +++ b/tests/test-xstrtol.sh @@ -32,7 +32,7 @@ ./test-xstrtoul${EXEEXT} MiB >> t-xstrtol.tmp 2>&1 || result=1 # normalize output -sed -e 's/^[^:]*: //' < t-xstrtol.tmp > t-xstrtol.xo +LC_ALL=C tr -d '\r' < t-xstrtol.tmp > t-xstrtol.xo mv t-xstrtol.xo t-xstrtol.tmp # compare expected output diff --git a/tests/test-xstrtoumax.sh b/tests/test-xstrtoumax.sh --- a/tests/test-xstrtoumax.sh +++ b/tests/test-xstrtoumax.sh @@ -20,7 +20,7 @@ ./test-xstrtoumax${EXEEXT} MiB >> t-xstrtoumax.tmp 2>&1 || result=1 # normalize output -sed -e 's/^[^:]*: //' < t-xstrtoumax.tmp > t-xstrtoumax.xo +LC_ALL=C tr -d '\r' < t-xstrtoumax.tmp > t-xstrtoumax.xo mv t-xstrtoumax.xo t-xstrtoumax.tmp # compare expected output