From: Andy Wingo Date: Sat, 8 Feb 2014 13:48:56 +0000 (+0100) Subject: Merge commit '0ce224594ae5a673f6a397c284db5f5a61935334' X-Git-Url: https://git.hcoop.net/bpt/guile.git/commitdiff_plain/12b8487d5d7272ae5bda62477df60d3e795aa645?hp=adf06a72d53821d34e14fa69b20b10e2f809f593 Merge commit '0ce224594ae5a673f6a397c284db5f5a61935334' --- diff --git a/test-suite/guile-test b/test-suite/guile-test index cdcfe4928..43ea48174 100755 --- a/test-suite/guile-test +++ b/test-suite/guile-test @@ -5,7 +5,7 @@ ;;;; guile-test --- run the Guile test suite ;;;; Jim Blandy --- May 1999 ;;;; -;;;; Copyright (C) 1999, 2001, 2006, 2010 Free Software Foundation, Inc. +;;;; Copyright (C) 1999, 2001, 2006, 2010, 2014 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -239,8 +239,9 @@ (lambda () (for-each (lambda (test) (display (string-append "Running " test "\n")) - (with-test-prefix test - (load (test-file-name test)))) + (with-locale "C" + (with-test-prefix test + (load (test-file-name test))))) tests)))) (if (opt 'coverage #f) (let-values (((coverage-data _) @@ -262,4 +263,5 @@ ;;; Local Variables: ;;; mode: scheme +;;; eval: (put 'with-locale 'scheme-indent-function 1) ;;; End: diff --git a/test-suite/tests/bytevectors.test b/test-suite/tests/bytevectors.test index de207218f..c4ae1bbbb 100644 --- a/test-suite/tests/bytevectors.test +++ b/test-suite/tests/bytevectors.test @@ -1,6 +1,8 @@ ;;;; bytevectors.test --- R6RS bytevectors. -*- mode: scheme; coding: utf-8; -*- ;;;; -;;;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2011, 2012, 2013, +;;;; 2014 Free Software Foundation, Inc. +;;;; ;;;; Ludovic Courtès ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -393,7 +395,8 @@ ;; Default to the C locale for the following tests. -(setlocale LC_ALL "C") +(when (defined? 'setlocale) + (setlocale LC_ALL "C")) (with-test-prefix "2.9 Operations on Strings" diff --git a/test-suite/tests/encoding-iso88591.test b/test-suite/tests/encoding-iso88591.test index 8265ff14f..2af2b4833 100644 --- a/test-suite/tests/encoding-iso88591.test +++ b/test-suite/tests/encoding-iso88591.test @@ -1,6 +1,6 @@ ;;;; encoding-iso88591.test --- test suite for Guile's string encodings -*- mode: scheme; coding: iso-8859-1 -*- ;;;; -;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -25,9 +25,8 @@ (apply string (map integer->char args))) ;; Set locale to the environment's locale, so that the prints look OK. -(define oldlocale #f) -(if (defined? 'setlocale) - (set! oldlocale (setlocale LC_ALL ""))) +(when (defined? 'setlocale) + (setlocale LC_ALL "")) (define ascii-a (integer->char 65)) ; LATIN CAPITAL LETTER A (define a-acute (integer->char #x00c1)) ; LATIN CAPITAL LETTER A WITH ACUTE @@ -177,7 +176,3 @@ (set-port-encoding! pt "ISO-8859-1") (set-port-conversion-strategy! pt 'error) (display (string-ints 256) pt)))) - -;; Reset locales -(if (defined? 'setlocale) - (setlocale LC_ALL oldlocale)) diff --git a/test-suite/tests/encoding-iso88597.test b/test-suite/tests/encoding-iso88597.test index a577b2a60..e88b9d301 100644 --- a/test-suite/tests/encoding-iso88597.test +++ b/test-suite/tests/encoding-iso88597.test @@ -1,6 +1,6 @@ ;;;; encoding-iso88697.test --- test suite for Guile's string encodings -*- mode: scheme; coding: iso-8859-7 -*- ;;;; -;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -24,9 +24,9 @@ (define (string-ints . args) (apply string (map integer->char args))) -(define oldlocale #f) -(if (defined? 'setlocale) - (set! oldlocale (setlocale LC_ALL ""))) +(when (defined? 'setlocale) + (setlocale LC_ALL "")) + (define ascii-a (integer->char 65)) ; LATIN CAPITAL LETTER A (define a-acute (integer->char #x00c1)) ; LATIN CAPITAL LETTER A WITH ACUTE (define alpha (integer->char #x03b1)) ; GREEK SMALL LETTER ALPHA @@ -167,7 +167,3 @@ (set-port-encoding! pt "ISO-8859-7") (set-port-conversion-strategy! pt 'error) (display (string-ints #x0400) pt)))) - -;; Reset locale -(if (defined? 'setlocale) - (setlocale LC_ALL oldlocale)) diff --git a/test-suite/tests/encoding-utf8.test b/test-suite/tests/encoding-utf8.test index 1de3fa7ef..786170ed9 100644 --- a/test-suite/tests/encoding-utf8.test +++ b/test-suite/tests/encoding-utf8.test @@ -1,6 +1,6 @@ ;;;; encoding-utf8.test --- test suite for Guile's string encodings -*- mode: scheme; coding: utf-8 -*- ;;;; -;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -24,9 +24,8 @@ (define (string-ints . args) (apply string (map integer->char args))) -(define oldlocale #f) -(if (defined? 'setlocale) - (set! oldlocale (setlocale LC_ALL ""))) +(when (defined? 'setlocale) + (setlocale LC_ALL "")) (define ascii-a (integer->char 65)) ; LATIN CAPITAL LETTER A (define a-acute (integer->char #x00c1)) ; LATIN CAPITAL LETTER A WITH ACUTE @@ -189,6 +188,3 @@ (let ((芥川龍之介 1) (ñ 2)) (eqv? (+ 芥川龍之介 ñ) 3)))) - -(if (defined? 'setlocale) - (setlocale LC_ALL oldlocale)) diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test index a411b49e7..334984703 100644 --- a/test-suite/tests/format.test +++ b/test-suite/tests/format.test @@ -1,7 +1,8 @@ ;;;; format.test --- test suite for Guile's CL-ish format -*- scheme -*- ;;;; Matthias Koeppe --- June 2001 ;;;; -;;;; Copyright (C) 2001, 2003, 2004, 2006, 2010, 2011, 2012 Free Software Foundation, Inc. +;;;; Copyright (C) 2001, 2003, 2004, 2006, 2010, 2011, 2012, +;;;; 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -101,7 +102,9 @@ ;;; ~h ;;; -(setlocale LC_ALL "C") +(when (defined? 'setlocale) + (setlocale LC_ALL "C")) + (with-test-prefix "~h localized number" (pass-if "1234.5" diff --git a/test-suite/tests/regexp.test b/test-suite/tests/regexp.test index d25a3d42d..2446dc7c7 100644 --- a/test-suite/tests/regexp.test +++ b/test-suite/tests/regexp.test @@ -2,7 +2,7 @@ ;;;; Jim Blandy --- September 1999 ;;;; ;;;; Copyright (C) 1999, 2004, 2006, 2007, 2008, 2009, 2010, -;;;; 2012, 2013 Free Software Foundation, Inc. +;;;; 2012, 2013, 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -23,8 +23,8 @@ #:use-module (srfi srfi-1) #:use-module (ice-9 regex)) -(if (defined? 'setlocale) - (setlocale LC_ALL "C")) +(when (defined? 'setlocale) + (setlocale LC_ALL "C")) ;; Don't fail if we can't display a test name to stdout/stderr. (set-port-conversion-strategy! (current-output-port) 'escape) diff --git a/test-suite/tests/srfi-14.test b/test-suite/tests/srfi-14.test index 5f937604f..f511f1c2c 100644 --- a/test-suite/tests/srfi-14.test +++ b/test-suite/tests/srfi-14.test @@ -2,7 +2,7 @@ ;;;; --- Test suite for Guile's SRFI-14 functions. ;;;; Martin Grabmueller, 2001-07-16 ;;;; -;;;; Copyright (C) 2001, 2006, 2009, 2010 Free Software Foundation, Inc. +;;;; Copyright (C) 2001, 2006, 2009, 2010, 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -745,9 +745,8 @@ (define (every? pred lst) (not (not (every pred lst)))) -(define oldlocale #f) -(if (defined? 'setlocale) - (set! oldlocale (setlocale LC_ALL ""))) +(when (defined? 'setlocale) + (setlocale LC_ALL "")) (with-test-prefix "Latin-1 (8-bit charset)" @@ -844,6 +843,3 @@ (map (lambda (x) (+ #x80 x)) (iota #x20)))))) char-set:iso-control))) - -(if (defined? 'setlocale) - (setlocale LC_ALL oldlocale)) diff --git a/test-suite/tests/srfi-19.test b/test-suite/tests/srfi-19.test index 8819c4f4d..d63e62222 100644 --- a/test-suite/tests/srfi-19.test +++ b/test-suite/tests/srfi-19.test @@ -2,7 +2,7 @@ ;;;; Matthias Koeppe --- June 2001 ;;;; ;;;; Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, -;;;; 2011 Free Software Foundation, Inc. +;;;; 2011, 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,8 @@ :use-module (ice-9 format)) ;; Make sure we use the default locale. -(setlocale LC_ALL "C") +(when (defined? 'setlocale) + (setlocale LC_ALL "C")) (define (with-tz* tz thunk) "Temporarily set the TZ environment variable to the passed string diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test index c2e6c6591..0f6d9451b 100644 --- a/test-suite/tests/tree-il.test +++ b/test-suite/tests/tree-il.test @@ -1,7 +1,8 @@ ;;;; tree-il.test --- test suite for compiling tree-il -*- scheme -*- ;;;; Andy Wingo --- May 2009 ;;;; -;;;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +;;;; Copyright (C) 2009, 2010, 2011, 2012, 2013, +;;;; 2014 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -200,7 +201,8 @@ ;;; ;; Make sure we get English messages. -(setlocale LC_ALL "C") +(when (defined? 'setlocale) + (setlocale LC_ALL "C")) (define (call-with-warnings thunk) (let ((port (open-output-string)))