1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Make temporary file in coding.test work on MS-Windows.

* test-suite/tests/coding.test (with-temp-file): Instead of
  hard-coding "/tmp" as the temporary directory, use $TMPDIR or
  $TEMP from the environment, and fall back on "/tmp" if none of
  those 2 is defined.
This commit is contained in:
Eli Zaretskii 2014-08-13 18:41:15 +03:00
parent 1e9249e0cd
commit 7c848fe572

View file

@ -20,7 +20,10 @@
#:use-module (test-suite lib))
(define (with-temp-file proc)
(let* ((name (string-copy "/tmp/coding-test.XXXXXX"))
(let* ((tmpdir (or (getenv "TMPDIR")
(getenv "TEMP")
"/tmp"))
(name (string-append tmpdir "/coding-test.XXXXXX"))
(port (mkstemp! name)))
(let ((res (with-throw-handler
#t