diff options
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/test-suite/lib.scm | 13 | ||||
-rw-r--r-- | test-suite/tests/c-api.test | 5 | ||||
-rw-r--r-- | test-suite/tests/popen.test | 6 |
3 files changed, 19 insertions, 5 deletions
diff --git a/test-suite/test-suite/lib.scm b/test-suite/test-suite/lib.scm index e25df7891..5628ae02a 100644 --- a/test-suite/test-suite/lib.scm +++ b/test-suite/test-suite/lib.scm @@ -1,6 +1,6 @@ ;;;; test-suite/lib.scm --- generic support for testing ;;;; Copyright (C) 1999, 2000, 2001, 2004, 2006, 2007, 2009, 2010, -;;;; 2011, 2012, 2013 Free Software Foundation, Inc. +;;;; 2011, 2012, 2013, 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 @@ -63,6 +63,9 @@ ;; Using a given locale with-locale with-locale* with-latin1-locale with-latin1-locale* + ;; The bit bucket. + %null-device + ;; Reporting results in various ways. register-reporter unregister-reporter reporter-registered? make-count-reporter print-counts @@ -571,6 +574,14 @@ ((_ body ...) (with-latin1-locale* (lambda () body ...))))) +(define %null-device + ;; On Windows (MinGW), /dev/null does not exist and we must instead + ;; use NUL. Note that file system procedures automatically translate + ;; /dev/null, so this variable is only useful for shell snippets. + (if (file-exists? "/dev/null") + "/dev/null" + "NUL")) + ;;;; REPORTERS ;;;; diff --git a/test-suite/tests/c-api.test b/test-suite/tests/c-api.test index 9a2108e69..5ce033f8d 100644 --- a/test-suite/tests/c-api.test +++ b/test-suite/tests/c-api.test @@ -1,7 +1,7 @@ ;;;; c-api.test --- complementary test suite for the c-api -*- scheme -*- ;;;; MDJ 990915 <djurfeldt@nada.kth.se> ;;;; -;;;; Copyright (C) 1999, 2006, 2012 Free Software Foundation, Inc. +;;;; Copyright (C) 1999, 2006, 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 @@ -22,7 +22,8 @@ (define srcdir (cdr (assq 'srcdir %guile-build-info))) (define (egrep string filename) - (zero? (system (string-append "egrep '" string "' " filename " >/dev/null")))) + (zero? (system (string-append "egrep '" string "' " filename + " >" %null-device)))) (define (seek-offset-test dirname) (let ((dir (opendir dirname))) diff --git a/test-suite/tests/popen.test b/test-suite/tests/popen.test index 2818be01b..27e15dcad 100644 --- a/test-suite/tests/popen.test +++ b/test-suite/tests/popen.test @@ -1,6 +1,6 @@ ;;;; popen.test --- exercise ice-9/popen.scm -*- scheme -*- ;;;; -;;;; Copyright 2003, 2006, 2010, 2011, 2013 Free Software Foundation, Inc. +;;;; Copyright 2003, 2006, 2010, 2011, 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 @@ -109,7 +109,9 @@ (with-input-from-port (car p2c) (lambda () (open-input-pipe - "exec 1>/dev/null; echo closed 1>&2; exec 2>/dev/null; read REPLY"))))))) + (format #f "exec 1>~a; echo closed 1>&2; \ +exec 2>~a; read REPLY" + %null-device %null-device)))))))) (close-port (cdr c2p)) ;; write side (let ((result (eof-object? (read-char port)))) (display "hello!\n" (cdr p2c)) |