Fix test failures on mingw.
authorBruno Haible <bruno@clisp.org>
Mon, 21 Apr 2008 22:43:52 +0000 (00:43 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 21 Apr 2008 22:43:52 +0000 (00:43 +0200)
ChangeLog
tests/test-xstrtoimax.sh
tests/test-xstrtol.c
tests/test-xstrtol.sh
tests/test-xstrtoumax.sh

index 32fdae9c311506dd16786fa2bc49de7ad450dd6e..0fa1a4e19366ec9bd7929ff0f62f65689348d77d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-21  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Fix test failure on mingw.
index 7925170d27fe735356e54817dbaa2e94ebf87bd7..14cb9e07ed48731b590741c2e390a547aad52644 100755 (executable)
@@ -20,7 +20,7 @@ result=0
 ./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
index fa9cf72a45327872018282e79e49dc8a4475d44a..6aa5e895ccd5fe1fffc3eb85562337162927df87 100644 (file)
@@ -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
 
 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 @@ main (int argc, char **argv)
   int i;
 
   program_name = argv[0];
+  error_print_progname = print_no_progname;
+
   for (i = 1; i < argc; i++)
     {
       char *p;
index 70022236a0f81614e894cbf0b04a293d7447ca80..4c65122bca88dc6035d27720e73217798439e688 100755 (executable)
@@ -32,7 +32,7 @@ result=0
 ./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
index f37dd9ae615e03dc507eed02fcb4275910ed192e..c86c9fbfcaf6c6bb3bbf2ba0ab9a62f5d7066b1d 100755 (executable)
@@ -20,7 +20,7 @@ result=0
 ./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