summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-06-12 23:19:29 +0200
committerLudovic Courtès <ludo@gnu.org>2014-06-12 23:19:37 +0200
commitf0893308461d9586d4fd00d78fd7999a660058ff (patch)
tree4df821c3abfc243f4504583a7927070b652b371d
parent700f6cd86b939789e19fd325f3ad2862eac5975e (diff)
downloadguile-f0893308461d9586d4fd00d78fd7999a660058ff.tar.gz
tests: Improve lack-of-/dev/null detection.
Suggested by Eli Zaretskii <eliz@gnu.org>. * test-suite/test-suite/lib.scm (%null-device): Test for Windows based by checking for a drive letter in the current directory name.
-rw-r--r--test-suite/test-suite/lib.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/test-suite/test-suite/lib.scm b/test-suite/test-suite/lib.scm
index 5628ae02a..54360b361 100644
--- a/test-suite/test-suite/lib.scm
+++ b/test-suite/test-suite/lib.scm
@@ -578,9 +578,12 @@
;; 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"))
+
+ ;; Test for Windowsness by checking whether the current directory name
+ ;; starts with a drive letter.
+ (if (string-match "^[a-zA-Z]:[/\\]" (getcwd))
+ "NUL"
+ "/dev/null"))
;;;; REPORTERS