;;;; guile-test --- run the Guile test suite
;;;; Jim Blandy <jimb@red-bean.com> --- 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
(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 _)
\f
;;; Local Variables:
;;; mode: scheme
+;;; eval: (put 'with-locale 'scheme-indent-function 1)
;;; End:
;;;; 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
\f
;; 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"
;;;; 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
(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
(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))
;;;; 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
(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
(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))
;;;; 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
(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
(let ((芥川龍之介 1)
(ñ 2))
(eqv? (+ 芥川龍之介 ñ) 3))))
-
-(if (defined? 'setlocale)
- (setlocale LC_ALL oldlocale))
;;;; format.test --- test suite for Guile's CL-ish format -*- scheme -*-
;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- 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
;;; ~h
;;;
-(setlocale LC_ALL "C")
+(when (defined? 'setlocale)
+ (setlocale LC_ALL "C"))
+
(with-test-prefix "~h localized number"
(pass-if "1234.5"
;;;; Jim Blandy <jimb@red-bean.com> --- 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
#: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)
;;;; --- 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
(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)"
(map (lambda (x) (+ #x80 x))
(iota #x20))))))
char-set:iso-control)))
-
-(if (defined? 'setlocale)
- (setlocale LC_ALL oldlocale))
;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- 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
: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
;;;; tree-il.test --- test suite for compiling tree-il -*- scheme -*-
;;;; Andy Wingo <wingo@pobox.com> --- 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
;;;
;; 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)))